-
- EVT_MENU(self, wxID_NEW, self.doNew)
- EVT_MENU(self, wxID_OPEN, self.doOpen)
- EVT_MENU(self, wxID_CLOSE, self.doClose)
- EVT_MENU(self, wxID_SAVE, self.doSave)
- EVT_MENU(self, wxID_SAVEAS, self.doSaveAs)
- EVT_MENU(self, wxID_REVERT, self.doRevert)
- EVT_MENU(self, wxID_EXIT, self.doExit)
-
- EVT_MENU(self, menu_UNDO, self.doUndo)
- EVT_MENU(self, menu_SELECT_ALL, self.doSelectAll)
- EVT_MENU(self, menu_DUPLICATE, self.doDuplicate)
- EVT_MENU(self, menu_EDIT_TEXT, self.doEditText)
- EVT_MENU(self, menu_DELETE, self.doDelete)
-
- EVT_MENU(self, menu_SELECT, self.doChooseSelectTool)
- EVT_MENU(self, menu_LINE, self.doChooseLineTool)
- EVT_MENU(self, menu_RECT, self.doChooseRectTool)
- EVT_MENU(self, menu_ELLIPSE, self.doChooseEllipseTool)
- EVT_MENU(self, menu_TEXT, self.doChooseTextTool)
-
- EVT_MENU(self, menu_MOVE_FORWARD, self.doMoveForward)
- EVT_MENU(self, menu_MOVE_TO_FRONT, self.doMoveToFront)
- EVT_MENU(self, menu_MOVE_BACKWARD, self.doMoveBackward)
- EVT_MENU(self, menu_MOVE_TO_BACK, self.doMoveToBack)
-
- EVT_MENU(self, menu_ABOUT, self.doShowAbout)
-
+ menuHandlers = [
+ (wx.ID_NEW, self.doNew),
+ (wx.ID_OPEN, self.doOpen),
+ (wx.ID_CLOSE, self.doClose),
+ (wx.ID_SAVE, self.doSave),
+ (wx.ID_SAVEAS, self.doSaveAs),
+ (wx.ID_REVERT, self.doRevert),
+ (wx.ID_EXIT, self.doExit),
+
+ (menu_UNDO, self.doUndo),
+ (menu_SELECT_ALL, self.doSelectAll),
+ (menu_DUPLICATE, self.doDuplicate),
+ (menu_EDIT_TEXT, self.doEditText),
+ (menu_DELETE, self.doDelete),
+
+ (menu_SELECT, self.doChooseSelectTool),
+ (menu_LINE, self.doChooseLineTool),
+ (menu_RECT, self.doChooseRectTool),
+ (menu_ELLIPSE, self.doChooseEllipseTool),
+ (menu_TEXT, self.doChooseTextTool),
+
+ (menu_MOVE_FORWARD, self.doMoveForward),
+ (menu_MOVE_TO_FRONT, self.doMoveToFront),
+ (menu_MOVE_BACKWARD, self.doMoveBackward),
+ (menu_MOVE_TO_BACK, self.doMoveToBack),
+
+ (menu_ABOUT, self.doShowAbout)]
+ for combo in menuHandlers:
+ id, handler = combo
+ self.Bind(wx.EVT_MENU, handler, id = id)
+
+