From 540fc7361ca40a708fc79d517ac6d2ec150d7fdc Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Mon, 17 Jan 2011 06:35:49 +0200 Subject: [PATCH] Fixed a focus issue in shipbrowser when doing a search (it made the search edit ctrl go hide in a corner and start crying when displaying the search results) --- gui/PFListPane.py | 5 +++-- gui/shipBrowser.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gui/PFListPane.py b/gui/PFListPane.py index 48b2d6e9e..c19a41065 100644 --- a/gui/PFListPane.py +++ b/gui/PFListPane.py @@ -122,7 +122,7 @@ class PFListPane(wx.ScrolledWindow): def IsWidgetSelectedByContext(self, widget): return False - def RefreshList(self, doRefresh = False): + def RefreshList(self, doRefresh = False, doFocus = True): ypos = 0 maxy = 0 scrollTo = 0 @@ -151,7 +151,8 @@ class PFListPane(wx.ScrolledWindow): if itemY >=-iheight and itemY< clientH: self._wList[i].Refresh() - self.SetFocus() + if doFocus: + self.SetFocus() def RemoveWidget(self, child): child.Destroy() diff --git a/gui/shipBrowser.py b/gui/shipBrowser.py index d64468262..a59b11211 100644 --- a/gui/shipBrowser.py +++ b/gui/shipBrowser.py @@ -282,7 +282,7 @@ class ShipBrowser(wx.Panel): self.lpane.AddWidget(FitItem(self.lpane, ID, (shipName, name,timestamp), shipID)) if len(shipList) == 0 and len(fitList) == 0 : self.lpane.AddWidget(PFStaticText(self.lpane, label = "No matching results.")) - self.lpane.RefreshList() + self.lpane.RefreshList(doFocus = False) self.lpane.Thaw() class PFStaticText(wx.StaticText):