Changeset a0ac888 in sasview for calculatorview/perspectives/calculator
- Timestamp:
- Jan 10, 2011 12:40:16 PM (14 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- d65a00a
- Parents:
- b5ca223
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/perspectives/calculator/calculator.py
r5cc393b8 ra0ac888 12 12 ################################################################################ 13 13 14 #import wx 14 15 from sans.guiframe.plugin_base import PluginBase 15 16 import logging 16 17 17 class Plugin :18 class Plugin(PluginBase): 18 19 """ 19 20 This class defines the interface for a Plugin class … … 21 22 """ 22 23 def __init__(self, standalone=True): 23 """ 24 Abstract class for gui_manager Plugins. 25 """ 26 ## Plug-in name. It will appear on the application menu. 27 self.sub_menu = "Calculator" 28 #standalone flag 29 self.standalone = standalone 30 ## Reference to the parent window. Filled by get_panels() below. 31 self.parent = None 32 33 ## List of panels that you would like to open in AUI windows 34 # for your plug-in. This defines your plug-in "perspective" 35 self.perspective = [] 24 PluginBase.__init__(self, name="Calculator", standalone=standalone) 36 25 # Log startup 37 26 logging.info("Calculator plug-in started") 38 39 def populate_menu(self, id, owner): 40 """ 41 Create and return the list of application menu 42 items for the plug-in. 43 44 :param id: deprecated. Un-used. 45 :param parent: parent window 46 47 :return: plug-in menu 48 49 """ 50 return [] 51 52 def get_panels(self, parent): 53 """ 54 Create and return the list of wx.Panels for your plug-in. 55 Define the plug-in perspective. 56 57 Panels should inherit from DefaultPanel defined below, 58 or should present the same interface. They must define 59 "window_caption" and "window_name". 60 61 :param parent: parent window 62 63 :return: list of panels 64 65 """ 66 ## Save a reference to the parent 67 self.parent = parent 68 69 return [] 70 71 27 72 28 def help(self, evt): 73 29 """ … … 80 36 frame = HelpWindow(None, -1) 81 37 frame.Show(True) 82 #evt.Skip() 83 84 def get_context_menu(self, graph=None): 85 """ 86 This method is optional. 87 88 When the context menu of a plot is rendered, the 89 get_context_menu method will be called to give you a 90 chance to add a menu item to the context menu. 91 92 A ref to a Graph object is passed so that you can 93 investigate the plot content and decide whether you 94 need to add items to the context menu. 95 96 This method returns a list of menu items. 97 Each item is itself a list defining the text to 98 appear in the menu, a tool-tip help text, and a 99 call-back method. 100 101 @param graph: the Graph object to which we attach the context menu 102 @return: a list of menu items with call-back function 103 """ 104 return [] 105 106 def get_perspective(self): 107 """ 108 Get the list of panel names for this perspective 109 """ 110 return self.perspective 111 112 38 113 39 def get_tools(self): 114 40 """ … … 186 112 self.parent.set_perspective(self.perspective) 187 113 event.Skip() 188 189 def post_init(self): 190 """ 191 Post initialization call back to close the loose ends 192 """ 193 pass 114 194 115 195 116
Note: See TracChangeset
for help on using the changeset viewer.