Changeset fadf925 in sasview
- Timestamp:
- May 9, 2011 5:01:01 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:
- 31f9c172
- Parents:
- 4e367f6
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
r08e1912 rfadf925 236 236 (self.panel_on_focus.window_caption)) 237 237 elif self.panel_on_focus != self._data_panel: 238 self.cpanel_on_focus = self.panel_on_focus 238 cpanel = self.panel_on_focus 239 if self.cpanel_on_focus != cpanel: 240 self.cpanel_on_focus = self.panel_on_focus 239 241 #update toolbar 240 242 self._update_toolbar_helper() … … 242 244 self.enable_edit_menu() 243 245 246 def reset_bookmark_menu(self, panel): 247 """ 248 Reset Bookmark menu list 249 250 : param panel: a control panel or tap where the bookmark is 251 """ 252 cpanel = panel 253 if self._toolbar != None and cpanel._bookmark_flag: 254 for item in self._toolbar.get_bookmark_items(): 255 self._toolbar.remove_bookmark_item(item) 256 self._toolbar.add_bookmark_default() 257 pos = 0 258 for bitem in cpanel.popUpMenu.GetMenuItems(): 259 pos += 1 260 if pos < 3: 261 continue 262 id = bitem.GetId() 263 label = bitem.GetLabel() 264 self._toolbar.append_bookmark_item(id, label) 265 wx.EVT_MENU(self, id, cpanel._back_to_bookmark) 266 self._toolbar.Realize() 267 244 268 245 269 def build_gui(self): … … 690 714 if self._toolbar is None: 691 715 return 716 if self.cpanel_on_focus is not None: 717 self.reset_bookmark_menu(self.cpanel_on_focus) 692 718 self._toolbar.update_toolbar(self.cpanel_on_focus) 693 719 if self._current_perspective is not None: … … 695 721 if self.cpanel_on_focus is not None: 696 722 panel_name = self.cpanel_on_focus.window_caption 723 697 724 self._toolbar.update_button(application_name=application_name, 698 725 panel_name=panel_name) 726 699 727 self._toolbar.Realize() 700 728 … … 1749 1777 if name == panel.window_name: 1750 1778 panel.on_set_focus(event=None) 1751 break 1752 1779 break 1753 1780 name = self._current_perspective.sub_menu 1754 1781 if self._data_panel is not None: -
guiframe/gui_toolbar.py
rf932c02 rfadf925 112 112 self._bookmark_bt.Disable() 113 113 self._bookmark_menu = wx.Menu() 114 id = wx.NewId() 115 self._bookmark_menu.Append(id, 'Add bookmark') 116 self._bookmark_menu.AppendSeparator() 117 wx.EVT_MENU(self, id, self.on_bookmark) 114 self.add_bookmark_default() 115 118 116 119 117 self._bookmark_bt.SetMenu(self._bookmark_menu) 120 118 self.AddControl(self._bookmark_bt) 121 119 122 120 self.SetToolBitmapSize(tbar_size) 123 121 self.AddSeparator() … … 136 134 137 135 self.Realize() 138 136 137 def add_bookmark_default(self): 138 """ 139 Add default items in bookmark menu 140 """ 141 id = wx.NewId() 142 self._bookmark_menu.Append(id, 'Add bookmark') 143 self._bookmark_menu.AppendSeparator() 144 wx.EVT_MENU(self, id, self.on_bookmark) 145 139 146 def on_bind_button(self): 140 147 """ … … 241 248 self._bookmark_menu.Append(id, str(title), str(hint)) 242 249 wx.EVT_MENU(self, id, handler) 243 250 251 def remove_bookmark_item(self, item): 252 """ 253 Remove a bookmark item 254 """ 255 self._bookmark_menu.DestroyItem(item) 256 257 def get_bookmark_items(self): 258 """ 259 Get bookmark menu items 260 """ 261 return self._bookmark_menu.GetMenuItems() 262 263 def append_bookmark_item(self, id, label): 264 """ 265 Append a item in bookmark 266 """ 267 self._bookmark_menu.Append(id, label) -
invariantview/perspectives/invariant/invariant_panel.py
reaab2ad rfadf925 121 121 #edit the panel 122 122 if self._data is not None: 123 self._delete_bookmark_items() 123 124 self.get_state_by_num(0) 124 125 data_name = self._data.name … … 139 140 return True 140 141 142 def _delete_bookmark_items(self): 143 """ 144 Delete bookmark menu items 145 """ 146 # delete toolbar menu 147 self.parent.reset_bookmark_menu(self) 148 self.parent._update_toolbar_helper() 149 # delete popUpMenu items 150 pos = 0 151 for item in self.popUpMenu.GetMenuItems(): 152 pos += 1 153 if pos < 3: 154 continue 155 self.popUpMenu.DestroyItem(item) 156 141 157 def set_message(self): 142 158 """ -
sansview/perspectives/fitting/basepage.py
r6d8053c rfadf925 145 145 146 146 id = wx.NewId() 147 self._keep = wx.MenuItem(self.popUpMenu,id," BookMark",147 self._keep = wx.MenuItem(self.popUpMenu,id,"Add bookmark", 148 148 " Keep the panel status to recall it later") 149 149 self.popUpMenu.AppendItem(self._keep) … … 497 497 ## reset state of checkbox,textcrtl and regular parameters value 498 498 self.reset_page(previous_state) 499 499 500 500 501 def on_preview(self, event): … … 1911 1912 self.disp_list =self.model.getDispParamList() 1912 1913 self.state.disp_list = self.disp_list 1914 self.on_set_focus(None) 1913 1915 self.Layout() 1914 1916
Note: See TracChangeset
for help on using the changeset viewer.