- Timestamp:
- May 23, 2008 2:59:03 PM (16 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:
- 7cb0353
- Parents:
- 1a5c946
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
rfa452e4 radfcab3 22 22 import config 23 23 from sans.guicomm.events import EVT_STATUS 24 25 import warnings 26 warnings.simplefilter("ignore") 27 24 28 25 29 class ViewerFrame(wx.Frame): … … 262 266 filemenu.Append(101,'&Quit', 'Exit') 263 267 268 # Add sub menus 269 menubar.Append(filemenu, '&File') 270 264 271 # Plot menu 265 272 # Attach a menu item for each panel in our … … 267 274 # TODO: clean this up. We should just identify 268 275 # plug-in panels and add them all. 269 viewmenu = wx.Menu() 270 276 277 # Only add the panel menu if there is more than one panel 278 n_panels = 0 271 279 for plug in self.plugins: 272 plugmenu = wx.Menu()273 280 pers = plug.get_perspective() 274 281 if len(pers)>0: 275 for item in self.panels: 276 if item == 'default': 277 continue 278 panel = self.panels[item] 279 if panel.window_name in pers: 280 plugmenu.Append(int(item), panel.window_caption, "Show %s window" % panel.window_caption) 281 wx.EVT_MENU(self, int(item), self._on_view) 282 283 viewmenu.AppendMenu(wx.NewId(), plug.sub_menu, plugmenu, plug.sub_menu) 284 282 n_panels += 1 283 284 if n_panels>1: 285 viewmenu = wx.Menu() 286 for plug in self.plugins: 287 plugmenu = wx.Menu() 288 pers = plug.get_perspective() 289 if len(pers)>0: 290 for item in self.panels: 291 if item == 'default': 292 continue 293 panel = self.panels[item] 294 if panel.window_name in pers: 295 plugmenu.Append(int(item), panel.window_caption, "Show %s window" % panel.window_caption) 296 wx.EVT_MENU(self, int(item), self._on_view) 297 298 viewmenu.AppendMenu(wx.NewId(), plug.sub_menu, plugmenu, plug.sub_menu) 299 300 menubar.Append(viewmenu, '&Panel') 301 285 302 # Perspective 286 303 # Attach a menu item for each defined perspective. 287 p_menu = wx.Menu()288 304 # Only add the perspective menu if there are more than one perspectves 305 n_perspectives = 0 289 306 for plug in self.plugins: 290 307 if len(plug.get_perspective()) > 0: 291 id = wx.NewId() 292 p_menu.Append(id, plug.sub_menu, "Switch to %s perspective" % plug.sub_menu) 293 wx.EVT_MENU(self, id, plug.on_perspective) 308 n_perspectives += 1 309 310 if n_perspectives>1: 311 p_menu = wx.Menu() 312 for plug in self.plugins: 313 if len(plug.get_perspective()) > 0: 314 id = wx.NewId() 315 p_menu.Append(id, plug.sub_menu, "Switch to %s perspective" % plug.sub_menu) 316 wx.EVT_MENU(self, id, plug.on_perspective) 317 menubar.Append(p_menu, '&Perspective') 294 318 295 319 # Help menu … … 312 336 313 337 314 # Add sub menus 315 menubar.Append(filemenu, '&File') 338 316 339 317 340 # Look for plug-in menus … … 323 346 324 347 325 menubar.Append(viewmenu, '&Panel')326 menubar.Append(p_menu, '&Perspective')327 348 menubar.Append(helpmenu, '&Help') 328 349
Note: See TracChangeset
for help on using the changeset viewer.