Inherits objects::gui::mainFrameContainer::mainFrameContainer.
Public Member Functions | |
| def | __init__ |
| def | buildToolbar |
| Creates the ToolBar object. | |
| def | makeToobarButton |
| Creates the ToolBar button, and binds it to the ToolBar. | |
| def | toolbarData |
Public Attributes | |
| toolbar | |
| lastTool | |
Definition at line 25 of file mainFrameToolbar.py.
| def objects.gui.mainFrameToolbar.mainFrameToolbar.__init__ | ( | self, | ||
| mainFrm | ||||
| ) |
Reimplemented from objects.gui.mainFrameContainer.mainFrameContainer.
Definition at line 26 of file mainFrameToolbar.py.
00026 : 00027 mainFrameContainer.__init__(self, mainFrm) 00028 self.buildToolbar() 00029 00030 00031
| def objects.gui.mainFrameToolbar.mainFrameToolbar.buildToolbar | ( | self | ) |
Creates the ToolBar object.
Definition at line 33 of file mainFrameToolbar.py.
00033 : 00034 self.toolbar = self.mainFrame.CreateToolBar() 00035 00036 00037 self.toolbar.SetToolBitmapSize((32,32)) 00038 00039 for each in self.toolbarData(): 00040 self.makeToobarButton(self.toolbar, *each) 00041 00042 #mark the last ToolBar button as pressed. 00043 self.lastTool.Toggle() 00044 00045 try: 00046 self.toolbar.Realize() 00047 except wx._core.PyAssertionError: 00048 raise exception("The application could not start. Could not create toolbar.", False) 00049 00050 ## Creates the ToolBar button, and binds it to the ToolBar.
| def objects.gui.mainFrameToolbar.mainFrameToolbar.makeToobarButton | ( | self, | ||
| toolbar, | ||||
| isRadio, | ||||
| label, | ||||
| filename, | ||||
| help, | ||||
| handler | ||||
| ) |
Creates the ToolBar button, and binds it to the ToolBar.
| toolbar | wx.ToolBar | |
| isRadio | True if this button behaves like a radio button | |
| label | Button Label | |
| filename | Name of the bitmap file used used to by the actually button | |
| help | Tooltip help string to be displayed when the mouse hovers over the ToolBar button | |
| handler | Hanlder method for this button |
Definition at line 58 of file mainFrameToolbar.py.
00058 : 00059 if not label: 00060 self.toolbar.AddSeparator() 00061 return 00062 try: 00063 bmp = wx.Bitmap(filename) 00064 00065 except wx._core.PyAssertionError: 00066 raise exception("The application could not start. Could not find appropriate images for toolbar.", True) 00067 00068 if isRadio == "N": 00069 tool = self.toolbar.AddSimpleTool(-1, bmp, label, help) 00070 else: 00071 tool = self.toolbar.AddRadioTool(-1, bmp, shortHelp=help) 00072 self.lastTool = tool 00073 00074 self.mainFrame.Bind(wx.EVT_MENU, handler, tool) 00075 00076 00077 # returns a Dictionary representing the Toolbar structure. This dictionary is the only thing that needs to be 00078 # edited when modifying the Toolbar.
| def objects.gui.mainFrameToolbar.mainFrameToolbar.toolbarData | ( | self | ) |
Definition at line 79 of file mainFrameToolbar.py.
00079 : 00080 return (("N", "Start Monitoring", globalStrings.toolbar_file_start_monitoring, "Start monitoring network", self.mainFrame.handleStartMonitoring), 00081 ("N", "Stop Monitoring", globalStrings.toolbar_stop_monitoring, "Stop monitoring network", self.mainFrame.handleStopMonitoring), 00082 ("N", "", "", "", ""), 00083 ("N", "Go Home", globalStrings.toolbar_go_home, "Zoom all the way out", self.mainFrame.handleGoHome), 00084 ("Y", "Set Home Location", globalStrings.toolbar_identify_self, "Set Home Location", self.mainFrame.handleSetHomeLocation), 00085 ("Y", "Pan", globalStrings.toolbar_view_pan, "Pan around", self.mainFrame.handlePan), 00086 ("Y", "Free Zoom", globalStrings.toolbar_view_free_zoom, "Free Zoom", self.mainFrame.handleFreeZoom), 00087 ("N", "Zoom in", globalStrings.toolbar_view_zoom_in, "Zoom in", self.mainFrame.handleZoomIn), 00088 ("N", "Zoom out", globalStrings.toolbar_view_zoom_out, "Zoom out", self.mainFrame.handleZoomOut), 00089 ("N", "", "", "", ""), 00090 ("N", "Configure Network", globalStrings.toolbar_configure_network, "Configure network settings", self.mainFrame.handleConfigureNetwork), 00091 ("N", "Display Settings", globalStrings.toolbar_display_settings, "Display Settings", self.mainFrame.handleDisplaySettings), 00092 ("N", "Options", globalStrings.toolbar_options, "Options", self.mainFrame.handleOptions), 00093 ("N", "Capture Screenshot", globalStrings.toolbar_capture_screenshot, "Capture and save screenshot", self.mainFrame.handleCaptureScreenshot), 00094 ("N", "", "", "", ""), 00095 ("N", "About", globalStrings.toolbar_about, "About Eyespy", self.mainFrame.handleShowAbout)) 00096 00097 00098
Definition at line 72 of file mainFrameToolbar.py.
Definition at line 34 of file mainFrameToolbar.py.
1.5.8