Changeset 6034e16 in sasview for sansguiframe/src
- Timestamp:
- Sep 24, 2012 12:01:56 PM (12 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:
- 0f382d7
- Parents:
- 2facdb0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/CategoryManager.py
r2facdb0 r6034e16 22 22 from sans.guiframe.events import ChangeCategoryEvent 23 23 from sans.guiframe.CategoryInstaller import CategoryInstaller 24 IS_MAC = (sys.platform == 'darwin') 24 25 25 26 """ Notes … … 254 255 255 256 256 modify_dialog = ChangeCat(self, 'Change Category: ' + \ 257 selected_model, 257 modify_dialog = ChangeCat(self, selected_model, 258 258 self._get_cat_list(), 259 259 self.by_model_dict[selected_model]) 260 260 261 261 if modify_dialog.ShowModal() == wx.ID_OK: 262 self.by_model_dict[selected_model] = \ 263 modify_dialog.get_category() 264 self._regenerate_master_dict() 265 self._fill_lists() 266 self._set_enabled() 262 if not IS_MAC: 263 self.dial_ok(modify_dialog, selected_model) 264 265 def dial_ok(self, dialog=None, model=None): 266 """ 267 modify_dialog onclose 268 """ 269 self.by_model_dict[model] = dialog.get_category() 270 self._regenerate_master_dict() 271 self._fill_lists() 272 self._set_enabled() 273 267 274 268 275 def _on_ok(self, event): … … 362 369 :param current_cats: List of categories applied to current model 363 370 """ 364 wx.Dialog.__init__(self, parent, title = title, size=(485, 425))371 wx.Dialog.__init__(self, parent, title = 'Change Category: '+title, size=(485, 425)) 365 372 366 373 self.current_cats = current_cats 367 374 if str(self.current_cats[0]) == 'Uncategorized': 368 375 self.current_cats = [] 369 376 self.parent = parent 377 self.selcted_model = title 370 378 vbox = wx.BoxSizer(wx.VERTICAL) 371 379 self.add_sb = wx.StaticBox(self, label = "Add Category") … … 431 439 self.Centre() 432 440 self.Show(True) 441 if IS_MAC: 442 self.ok_button.Bind(wx.EVT_BUTTON, self.on_ok_mac) 443 444 def on_ok_mac(self, event): 445 """ 446 On OK pressed (MAC only) 447 """ 448 event.Skip() 449 self.parent.dial_ok(self, self.selcted_model) 450 self.Destroy() 433 451 434 452 def on_add(self, event):
Note: See TracChangeset
for help on using the changeset viewer.