Inherits mainFrameContainer::mainFrameContainer.
Public Member Functions | |
| def | __init__ |
| def | createMenuBar |
| Creates the menubar, and attached it to the parent. | |
| def | createMenu |
| Creates the menu item, given a dictionary containing the menu's properties. | |
| def | createMenuItem |
| Creates a single menu item. | |
| def | menuData |
| Menu data hash. | |
Public Attributes | |
| mainFrame | |
The menu bar is currently not used, but it can easily added to the main window during initialization/ There is nothing in the menu bar which cannot be found in the toolbar
Definition at line 25 of file mainFrameMenuBar.py.
| def objects.gui.mainFrameMenuBar.mainFrameMenuBar.__init__ | ( | self, | ||
| mainFrm | ||||
| ) |
Definition at line 26 of file mainFrameMenuBar.py.
00026 : 00027 self.mainFrame = mainFrm 00028 self.createMenuBar() 00029 00030 00031 """ Menubar related
| def objects.gui.mainFrameMenuBar.mainFrameMenuBar.createMenu | ( | self, | ||
| menuData | ||||
| ) |
Creates the menu item, given a dictionary containing the menu's properties.
| menuData | Dictionary containing all menu items which are part of a menu |
Definition at line 48 of file mainFrameMenuBar.py.
00048 : 00049 menu = wx.Menu() 00050 for eachItem in menuData: 00051 if len(eachItem) == 2: 00052 label = eachItem[0] 00053 subMenu = self.createMenu(eachItem[1]) 00054 menu.AppendMenu(wx.NewId(), label, subMenu) 00055 else: 00056 self.createMenuItem(menu, *eachItem) 00057 return menu 00058 00059 ## Creates a single menu item. This is basically a helper function used by "createMenu".
| def objects.gui.mainFrameMenuBar.mainFrameMenuBar.createMenuBar | ( | self | ) |
Creates the menubar, and attached it to the parent.
Definition at line 36 of file mainFrameMenuBar.py.
00036 : 00037 menuBar = wx.MenuBar() 00038 for eachMenuData in self.menuData(): 00039 menuLabel = eachMenuData[0] 00040 menuItems = eachMenuData[1] 00041 menuBar.Append(self.createMenu(menuItems), menuLabel) 00042 self.mainFrame.SetMenuBar(menuBar) 00043 00044 ## Creates the menu item, given a dictionary containing the menu's properties
| def objects.gui.mainFrameMenuBar.mainFrameMenuBar.createMenuItem | ( | self, | ||
| menu, | ||||
| label, | ||||
| status, | ||||
| handler, | ||||
kind = wx.ITEM_NORMAL | ||||
| ) |
Creates a single menu item.
This is basically a helper function used by "createMenu".
| menu | The wx.Menu object to which append this item. | |
| label | String label of the menu item | |
| status | I believe this indicates whether the item is enabled or not | |
| handler | Handler function which is invoked when this item is triggered | |
| kind | Additional Menu items descriptor. I forget what this does exactly. |
Definition at line 66 of file mainFrameMenuBar.py.
00066 : 00067 if not label: 00068 menu.AppendSeparator() 00069 return 00070 menuItem = menu.Append(-1, label, status, kind) 00071 self.mainFrame.Bind(wx.EVT_MENU, handler, menuItem) 00072 00073 ## Menu data hash.
| def objects.gui.mainFrameMenuBar.mainFrameMenuBar.menuData | ( | self | ) |
Menu data hash.
Definition at line 75 of file mainFrameMenuBar.py.
00075 : 00076 return [("&File", ( 00077 ("", "", ""), 00078 ("&Exit", "Exit", self.mainFrame.handleExit) 00079 00080 ))] ))]
Definition at line 27 of file mainFrameMenuBar.py.
1.5.8