Changeset fadf925 in sasview for guiframe/gui_toolbar.py
- Timestamp:
- May 9, 2011 5:01:01 PM (13 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.