Change how attribute editor frame is closed

This commit is contained in:
DarkPhoenix
2019-08-10 02:50:20 +03:00
parent 817e99a05d
commit 2160cc4aaa
4 changed files with 4 additions and 19 deletions

View File

@@ -60,6 +60,7 @@ class ErrorHandler:
class ErrorFrame(wx.Frame):
def __init__(self, parent=None, error_title='Error!'):
wx.Frame.__init__(self, parent, id=wx.ID_ANY, title="pyfa error", pos=wx.DefaultPosition, size=wx.Size(500, 600),
style=wx.DEFAULT_FRAME_STYLE ^ wx.RESIZE_BORDER | wx.STAY_ON_TOP)
@@ -115,12 +116,8 @@ class ErrorFrame(wx.Frame):
self.Layout()
self.Centre(wx.BOTH)
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Show()
def OnClose(self, evt):
self.Hide()
def addException(self, text):
self.errorTextCtrl.AppendText("\n{}\n\n{}".format("#" * 20, text))

View File

@@ -70,7 +70,6 @@ class EveFittings(wx.Frame):
self.importBtn.Bind(wx.EVT_BUTTON, self.importFitting)
self.deleteBtn.Bind(wx.EVT_BUTTON, self.deleteFitting)
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent)
self.statusbar = wx.StatusBar(self)
@@ -103,9 +102,6 @@ class EveFittings(wx.Frame):
return
event.Skip()
def OnClose(self, event):
event.Skip()
def getActiveCharacter(self):
selection = self.charChoice.GetCurrentSelection()
return self.charChoice.GetClientData(selection) if selection is not None else None
@@ -226,7 +222,6 @@ class ExportToEve(wx.Frame):
self.statusbar.SetFieldsCount(2)
self.statusbar.SetStatusWidths([100, -1])
self.Bind(wx.EVT_CLOSE, self.OnClose)
self.Bind(wx.EVT_CHAR_HOOK, self.kbEvent)
self.SetSizer(mainSizer)
@@ -256,9 +251,6 @@ class ExportToEve(wx.Frame):
return
event.Skip()
def OnClose(self, event):
event.Skip()
def getActiveCharacter(self):
selection = self.charChoice.GetCurrentSelection()
return self.charChoice.GetClientData(selection) if selection is not None else None

View File

@@ -63,8 +63,7 @@ class ItemStatsFrame(wx.Frame):
empty = getattr(victim, "isEmpty", False)
if empty:
self.Hide()
self.Destroy()
self.Close()
return
srcContext = fullContext[0]

View File

@@ -96,18 +96,15 @@ class AttributeEditor(wx.Frame):
keycode = event.GetKeyCode()
mstate = wx.GetMouseState()
if keycode == wx.WXK_ESCAPE and mstate.GetModifiers() == wx.MOD_NONE:
self.closeWindow()
self.Close()
return
event.Skip()
def OnClose(self, event):
self.closeWindow()
def closeWindow(self):
fitID = self.mainFrame.getActiveFit()
if fitID is not None:
wx.PostEvent(self.mainFrame, GE.FitChanged(fitIDs=(fitID,)))
self.Destroy()
event.Skip()
def OnImport(self, event):
with wx.FileDialog(