- Timestamp:
- Jan 26, 2011 3:54:16 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:
- 3feed3e
- Parents:
- 0912feab
- Location:
- guiframe
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
r52b8b74 r7a67e075 56 56 def __init__(self, parent, id, title, 57 57 window_height=300, window_width=300, 58 gui_style=GUIFRAME. SINGLE_APPLICATION):58 gui_style=GUIFRAME.DEFAULT_STYLE): 59 59 """ 60 60 Initialize the Frame object … … 161 161 default_flag = wx.aui.AUI_MGR_DEFAULT| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE 162 162 self._mgr = wx.aui.AuiManager(self, flags=default_flag) 163 """ 164 if self.__gui_style in [GUIFRAME.MULTIPLE_APPLICATIONS]: 165 from data_panel import DataPanel 166 self._data_panel = DataPanel(self) 167 """ 163 168 164 # Load panels 169 165 self._load_panels() 170 166 self._mgr.Update() 171 167 172 def _layout(self, style):173 """174 Layout the frame according to a style175 """176 if self.__gui_style == GUIFRAME.SINGLE_APPLICATION:177 #Divide the frame into178 print "GUIFRAME.SINGLE_APPLICATION"179 elif self.__gui_style == GUIFRAME.MULTIPLE_APPLICATIONS:180 print 'GUIFRAME.MULTIPLE_APPLICATION'181 elif self.__gui_style == GUIFRAME.FLOATING_PANEL:182 print "GUIFRAME.FLOATING_PANEL"183 184 168 def SetStatusText(self, *args, **kwds): 185 169 """ … … 220 204 plugins = [] 221 205 #import guiframe local plugins 222 if self.__gui_style == GUIFRAME.DATALOADER_ON: 206 #check if the style contain guiframe.dataloader 207 style1 = self.__gui_style & GUIFRAME.DATALOADER_ON 208 style2 = self.__gui_style & GUIFRAME.PLOTTIN_ON 209 style3 = self.__gui_style & (GUIFRAME.DATALOADER_ON|GUIFRAME.PLOTTIN_ON) 210 211 if style1 == GUIFRAME.DATALOADER_ON: 223 212 try: 224 213 from sans.guiframe.local_perspectives.data_loader import data_loader … … 229 218 msg += "cannot import dataloader plugin.\n %s" % sys.exc_value 230 219 logging.error(msg) 231 elif s elf.__gui_style== GUIFRAME.PLOTTIN_ON:220 elif style2 == GUIFRAME.PLOTTIN_ON: 232 221 try: 233 222 from sans.guiframe.local_perspectives.plotting import plotting … … 237 226 msg = "ViewerFrame._find_plugins:" 238 227 msg += "cannot import plotting plugin.\n %s" % sys.exc_value 239 elif s elf.__gui_style in [6, 7, 8]:228 elif style3 in (GUIFRAME.DATALOADER_ON|GUIFRAME.PLOTTIN_ON): 240 229 try: 241 230 from sans.guiframe.local_perspectives.data_loader import data_loader … … 362 351 CenterPane(). 363 352 #BestSize(wx.Size(550,600)). 364 #MinSize(wx.Size(500,500)).353 MinSize(wx.Size(self._window_width*3/5,-1)). 365 354 Hide()) 366 355 else: … … 402 391 ID = wx.NewId() 403 392 self.panels[str(ID)] = p 404 405 393 count = 0 406 394 for item in self.panels: … … 415 403 p.window_caption = caption 416 404 417 self._mgr.AddPane(p, wx.aui.AuiPaneInfo(). 418 Name(windowname).Caption(caption). 419 Floatable(). 420 #Float(). 421 Right(). 422 Dock(). 423 TopDockable(). 424 BottomDockable(). 425 LeftDockable(). 426 RightDockable(). 427 MinimizeButton(). 428 #Hide(). 429 #Show(). 430 Resizable(True). 431 # Use a large best size to make sure the AUI manager 432 # takes all the available space 433 BestSize(wx.Size(400,400))) 405 style1 = self.__gui_style & GUIFRAME.FIXED_PANEL 406 style2 = self.__gui_style & GUIFRAME.FLOATING_PANEL 407 if style1 == GUIFRAME.FIXED_PANEL: 408 self._mgr.AddPane(p, wx.aui.AuiPaneInfo(). 409 Name(windowname).Caption(caption). 410 Floatable(). 411 Right(). 412 Dock(). 413 TopDockable(). 414 BottomDockable(). 415 LeftDockable(). 416 RightDockable(). 417 MinimizeButton(). 418 #Hide(). 419 #Show(). 420 Resizable(True). 421 # Use a large best size to make sure the AUI manager 422 # takes all the available space 423 BestSize(wx.Size(400,400))) 424 elif style2 in GUIFRAME.FLOATING_PANEL: 425 self._mgr.AddPane(p, wx.aui.AuiPaneInfo(). 426 Name(windowname).Caption(caption). 427 Floatable(). 428 Float(). 429 430 #FloatingPosition(wx.Size(self._window_width/5,self._window_height/3)). 431 Right(). 432 Dock(). 433 TopDockable(). 434 BottomDockable(). 435 LeftDockable(). 436 RightDockable(). 437 MinimizeButton(). 438 #Hide(). 439 #Show(). 440 Resizable(True). 441 # Use a large best size to make sure the AUI manager 442 # takes all the available space 443 BestSize(wx.Size(400,400))) 444 434 445 pane = self._mgr.GetPane(windowname) 435 446 self._mgr.MaximizePane(pane) … … 464 475 self._add_menu_application() 465 476 self._add_menu_window() 466 467 468 469 470 477 # Tools menu 471 478 # Go through plug-ins and find tools to populate the tools menu … … 547 554 548 555 wx.EVT_MENU(self, id, self.show_welcome_panel) 549 if self.__gui_style in [GUIFRAME.MANAGER_ON,550 GUIFRAME.MULTIPLE_APPLICATIONS]:556 style = self.__gui_style & GUIFRAME.MANAGER_ON 557 if style == GUIFRAME.MANAGER_ON: 551 558 id = wx.NewId() 552 559 self._window_menu.Append(id,'&Data Manager', '') 553 554 560 wx.EVT_MENU(self, id, self.show_data_panel) 555 561 562 id = wx.NewId() 563 preferences_menu = wx.Menu() 564 hint = "Plot panels will floating" 565 preferences_menu.Append(id, '&Floating Plot Panel', hint) 566 wx.EVT_MENU(self, id, self.set_plotpanel_floating) 567 id = wx.NewId() 568 hint = "Plot panels will displayed within the frame" 569 preferences_menu.Append(id, '&Fixed Plot Panel', hint) 570 wx.EVT_MENU(self, id, self.set_plotpanel_fixed) 571 id = wx.NewId() 572 self._window_menu.AppendSubMenu(preferences_menu,'&Preferences') 573 #wx.EVT_MENU(self, id, self.show_preferences_panel) 556 574 """ 557 575 if len(self.plugins) == 2: … … 580 598 add menu application 581 599 """ 582 if self.__gui_style in [GUIFRAME.MULTIPLE_APPLICATIONS]: 600 style = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 601 if style == GUIFRAME.MULTIPLE_APPLICATIONS: 583 602 p_menu = wx.Menu() 584 603 for plug in self.plugins: … … 625 644 '&Load Data File(s)', data_file_hint) 626 645 wx.EVT_MENU(self, data_file_id, self._load_data) 627 if self.__gui_style == GUIFRAME.SINGLE_APPLICATION: 646 style = self.__gui_style & GUIFRAME.SINGLE_APPLICATION 647 if style == GUIFRAME.SINGLE_APPLICATION: 628 648 self._menubar.Append(self._data_menu, '&Data') 629 649 return … … 1021 1041 """ 1022 1042 self._current_perspective = perspective 1043 1044 def set_plotpanel_floating(self, event): 1045 """ 1046 make the plot panel floatable 1047 """ 1048 def set_plotpanel_fixed(self, event): 1049 """ 1050 make the plot panel fixed 1051 """ 1023 1052 1024 1053 class DefaultPanel(wx.Panel): -
guiframe/gui_style.py
r52b8b74 r7a67e075 7 7 MANAGER_ON = 1 8 8 FLOATING_PANEL = 2 9 FIXED_PANEL = 310 PLOTTIN_ON = 411 DATALOADER_ON = 512 SINGLE_APPLICATION = 613 MULTIPLE_APPLICATIONS = 714 15 DEFAULT_STYLE = 89 FIXED_PANEL = 4 10 PLOTTIN_ON = 8 11 DATALOADER_ON = 16 12 TOOL_ON = 32 13 SINGLE_APPLICATION = 64 14 DEFAULT_STYLE = SINGLE_APPLICATION|DATALOADER_ON|PLOTTIN_ON|FIXED_PANEL 15 MULTIPLE_APPLICATIONS = DEFAULT_STYLE|MANAGER_ON 16 16 17 17 if __name__ == "__main__": … … 19 19 print GUIFRAME.DEFAULT_STYLE 20 20 print GUIFRAME.FLOATING_PANEL 21 print GUIFRAME.SINGLE_APPLICATION 22 style = GUIFRAME.MULTIPLE_APPLICATIONS 23 style &= GUIFRAME.PLOTTIN_ON 24 print style == GUIFRAME.PLOTTIN_ON 25 style1 = GUIFRAME.MULTIPLE_APPLICATIONS 26 style1 &= (~GUIFRAME.MANAGER_ON) 27 print style1 == GUIFRAME.DEFAULT_STYLE 28 print style1 29 21 30 22 value = GUIFRAME.MANAGER_ON|GUIFRAME.DATALOADER_ON 23 print value 24 print value in [1,2] 25 print value in [5,2] 26 print value in [GUIFRAME.MANAGER_ON,GUIFRAME.DATALOADER_ON] 31 -
guiframe/local_perspectives/plotting/Plotter1D.py
r52b8b74 r7a67e075 87 87 self.graph.render(self) 88 88 #bind with event to contrst context menu 89 self.parent.Bind(EVT_NEW_LOADED_DATA, self._add_new_plot)89 #self.parent.Bind(EVT_NEW_LOADED_DATA, self._add_new_plot) 90 90 91 91 def on_add_new_plot(self, event): … … 253 253 self._slicerpop.Append(id, '&Print Preview', 'image preview for print') 254 254 wx.EVT_MENU(self, id, self.onPrinterPreview) 255 """ 255 256 #add plot 256 257 self._menu_add_plot = wx.Menu() … … 262 263 self._slicerpop.AppendSubMenu(self._menu_add_plot, '&Add New Plot') 263 264 self._fill_menu_add_plot() 265 """ 264 266 self._slicerpop.AppendSeparator() 265 267 #add menu of other plugins
Note: See TracChangeset
for help on using the changeset viewer.