Changeset 4faed25 in sasview for src/sas/guiframe
- Timestamp:
- Jun 14, 2015 1:24:55 PM (9 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:
- 7116dffd
- Parents:
- 56e99f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/guiframe/CategoryManager.py
r79492222 r4faed25 80 80 def __init__(self, parent, win_id, title): 81 81 """ 82 Category Manager Dialog class 82 Category Manager Dialog class. This is the class that is used to 83 bring up a dialog box allowing the user to create new model categories 84 and to add and remove models from a given category allowing complete 85 user customization of categories for models. This and Category 86 Installer provide the mecahnisms for creating the category dictionary 87 which is saved as a json file so that categories remain persistent 88 from session to session 83 89 :param win_id: A new wx ID 84 90 :param title: Title for the window … … 88 94 self.performance_blocking = False 89 95 96 # get the current status of model categorization (from the dictionary) 90 97 self.master_category_dict = defaultdict(list) 91 98 self.by_model_dict = defaultdict(list) 92 99 self.model_enabled_dict = defaultdict(bool) 93 100 101 #----------Initialize panels, frames, and sizers ------------ 102 # the whole panel is panel of hbox (a horizontal sizer and contains 103 # the left_pane (vbox2 sizer) which houses all the buttons and 104 # the right_pane (vbox sizer) which houses the current model/category 105 #list) 106 # Comments added June 14, 2015 -PDB 94 107 wx.Frame.__init__(self, parent, win_id, title, size=(660, 400)) 95 108 … … 114 127 self._set_enabled() 115 128 129 #----------button and button layout ----------------------- 116 130 vbox2 = wx.BoxSizer(wx.VERTICAL) 117 131 132 #Create buttons 118 133 sel = wx.Button(left_panel, -1, 'Enable All', size=(100, -1)) 119 134 des = wx.Button(left_panel, -1, 'Disable All', size=(100, -1)) … … 121 136 size=(100, -1)) 122 137 ok_button = wx.Button(left_panel, -1, 'OK', size=(100, -1)) 138 help_button = wx.Button(left_panel, -1, 'HELP', size=(100, -1)) 123 139 cancel_button = wx.Button(left_panel, -1, 'Cancel', 124 140 size=(100, -1)) … … 126 142 127 143 144 #bind buttons to action method 128 145 self.Bind(wx.EVT_BUTTON, self._on_selectall, 129 146 id=sel.GetId()) … … 134 151 self.Bind(wx.EVT_BUTTON, self._on_ok, 135 152 id = ok_button.GetId()) 153 self.Bind(wx.EVT_BUTTON, self._on_help, 154 id = help_button.GetId()) 136 155 self.Bind(wx.EVT_BUTTON, self._on_cancel, 137 156 id = cancel_button.GetId()) 138 157 158 #add buttons to sizer (vbox2) and convert to panel so displays well 159 #on all platforms 139 160 vbox2.Add(modify_button, 0, wx.TOP, 10) 140 161 vbox2.Add((-1, 20)) … … 143 164 vbox2.Add((-1, 20)) 144 165 vbox2.Add(ok_button) 166 vbox2.Add(help_button) 145 167 vbox2.Add(cancel_button) 146 168 147 169 left_panel.SetSizer(vbox2) 148 170 171 #--------------------- layout of current cat/model list -------- 149 172 vbox.Add(self.cat_list, 1, wx.EXPAND | wx.TOP, 3) 150 173 vbox.Add((-1, 10)) … … 153 176 right_panel.SetSizer(vbox) 154 177 178 #-------------- put it all together ----------------- 155 179 hbox.Add(left_panel, 0, wx.EXPAND | wx.RIGHT, 5) 156 180 hbox.Add(right_panel, 1, wx.EXPAND) … … 294 318 self.Destroy() 295 319 320 def _on_help(self, event): 321 """ 322 Bring up the Category Manager Panel Documentation whenever 323 the HELP button is clicked. 324 325 Calls DocumentationWindow with the path of the location within the 326 documentation tree (after /doc/ ....". Note that when using old 327 versions of Wx (before 2.9) and thus not the release version of 328 installers, the help comes up at the top level of the file as 329 webbrowser does not pass anything past the # to the browser when it is 330 running "file:///...." 331 332 :param evt: Triggers on clicking the help button 333 """ 334 335 #import documentation window here to avoid circular imports 336 #if put at top of file with rest of imports. 337 from documentation_window import DocumentationWindow 338 339 _TreeLocation = "user/perspectives/fitting/fitting_help.html" 340 _PageAnchor = "#category-manager" 341 _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, _PageAnchor, 342 "Category Manager Help") 343 296 344 def _on_cancel(self, event): 297 345 """
Note: See TracChangeset
for help on using the changeset viewer.