Added shortcut support for all pyfa child windows (ctrl/cmd + w = close window)

This commit is contained in:
HomeWorld
2010-10-16 15:22:53 +03:00
parent c89839fc67
commit 14d0f50aff
4 changed files with 58 additions and 1 deletions

View File

@@ -122,6 +122,17 @@ class CharacterEditor(wx.Frame):
self.registerEvents()
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
hiddenMenu = wx.Menu()
hiddenMenu.Append(9912,"Close window")
self.Bind(wx.EVT_MENU,self.HCloseWindow, id = 9913)
actb = [(wx.ACCEL_CTRL, ord('W'), 9913),
(wx.ACCEL_CMD, ord('W'), 9913)]
atable = wx.AcceleratorTable(actb)
self.SetAcceleratorTable(atable)
def HCloseWindow(self,event):
self.Destroy()
event.Skip()
def editingFinished(self, event):
wx.PostEvent(self.mainFrame, CharListUpdated())