diff --git a/gui/builtinShipBrowser/sfBrowserItem.py b/gui/builtinShipBrowser/sfBrowserItem.py index 16b7a4f24..bb30a040b 100644 --- a/gui/builtinShipBrowser/sfBrowserItem.py +++ b/gui/builtinShipBrowser/sfBrowserItem.py @@ -1,6 +1,7 @@ # noinspection PyPackageRequirements import wx import gui.utils.draw as drawUtils +import gui.mainFrame SB_ITEM_NORMAL = 0 SB_ITEM_SELECTED = 1 @@ -245,6 +246,7 @@ class SFBrowserItem(wx.Window): self.highlighted = False self.selected = False self.bkBitmap = None + self.mainFrame = gui.mainFrame.MainFrame.getInstance() self.canBeDragged = False @@ -311,6 +313,10 @@ class SFBrowserItem(wx.Window): self.canBeDragged = mode def OnLeftUp(self, event): + if self.mainFrame.supress_left_up: + wx.Yield() + self.mainFrame.supress_left_up = False + return if self.HasCapture(): self.ReleaseMouse() diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 9bd02feee..e5f9fd830 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -155,6 +155,7 @@ class MainFrame(wx.Frame): pyfalog.debug("Initialize MainFrame") self.title = title wx.Frame.__init__(self, None, wx.ID_ANY, self.title) + self.supress_left_up = False MainFrame.__instance = self @@ -433,6 +434,7 @@ class MainFrame(wx.Frame): style=wx.FD_SAVE, defaultFile=defaultFile) if dlg.ShowModal() == wx.ID_OK: + self.supress_left_up = True format_ = dlg.GetFilterIndex() path = dlg.GetPath() if format_ == 0: @@ -977,6 +979,7 @@ class MainFrame(wx.Frame): ) if dlg.ShowModal() == wx.ID_OK: + self.supress_left_up = True self.waitDialog = wx.BusyInfo("Importing Character...") sCharacter = Character.getInstance() sCharacter.importCharacter(dlg.GetPaths(), self.importCharacterCallback)