Changeset f2d9e76 in sasview
- Timestamp:
- May 21, 2011 6:05:48 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:
- 03da8ed
- Parents:
- 121c224
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
r0286321 rf2d9e76 93 93 GUIFRAME_HEIGHT = custom_config.GUIFRAME_HEIGHT 94 94 DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE 95 CLEANUP_PLOT = custom_config.CLEANUP_PLOT 95 96 except: 96 97 DATALOADER_SHOW = True … … 103 104 GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT 104 105 DEFAULT_PERSPECTIVE = None 106 CLEANUP_PLOT = False 105 107 106 108 DEFAULT_STYLE = config.DEFAULT_STYLE 107 108 109 109 110 … … 190 191 #tool bar 191 192 self._toolbar = None 193 # number of plugins 194 self._num_perspectives = 0 195 # plot duck cleanup option 196 self.cleanup_plots = CLEANUP_PLOT 192 197 # (un)-focus color 193 198 #self.color = '#b3b3b3' … … 371 376 # Set up the layout 372 377 self._setup_layout() 378 # Set up extra custom tool menu 379 self._setup_extra_custom() 373 380 # Set up the menu 374 381 self._setup_menus() … … 386 393 # Set Custom default 387 394 self.set_custom_default_perspective() 388 395 396 #self.Show(True) 397 #self._check_update(None) 398 399 def _setup_extra_custom(self): 400 """ 401 Set up toolbar and welcome view if needed 402 """ 389 403 style = self.__gui_style & GUIFRAME.TOOLBAR_ON 390 404 if (style == GUIFRAME.TOOLBAR_ON) & (not self._toolbar.IsShown()): … … 395 409 if welcome_style == GUIFRAME.WELCOME_PANEL_ON: 396 410 self.show_welcome_panel(None) 397 398 #self.Show(True) 399 #self._check_update(None) 400 411 401 412 def _setup_layout(self): 402 413 """ … … 444 455 exist. 445 456 """ 457 self._num_perspectives += 1 446 458 is_loaded = False 447 459 for item in self.plugins: … … 543 555 # Should raise and catch at a higher level and 544 556 # display error on status bar 545 pass 557 pass 558 546 559 return plugins 547 560 … … 1014 1027 preferences_menu = wx.Menu() 1015 1028 hint = "All plot panels will floating" 1016 preferences_menu.Append (id, '&Float', hint)1029 preferences_menu.AppendRadioItem(id, '&Float All', hint) 1017 1030 wx.EVT_MENU(self, id, self.set_plotpanel_floating) 1031 style = self.__gui_style & GUIFRAME.FLOATING_PANEL 1032 f_menu = preferences_menu.FindItemById(id) 1033 if style == GUIFRAME.FLOATING_PANEL: 1034 f_checked = True 1035 else: 1036 f_checked = False 1037 f_menu.Check(f_checked) 1038 1018 1039 id = wx.NewId() 1019 1040 hint = "All plot panels will displayed within the frame" 1020 preferences_menu.Append(id, '&Dock', hint) 1021 wx.EVT_MENU(self, id, self.set_plotpanel_fixed) 1022 1041 preferences_menu.AppendRadioItem(id, '&Dock All', hint) 1042 wx.EVT_MENU(self, id, self.set_plotpanel_fixed) 1043 if not f_checked: 1044 d_menu = preferences_menu.FindItemById(id) 1045 d_menu.Check(True) 1046 preferences_menu.AppendSeparator() 1047 id = wx.NewId() 1048 hint = "Clean up the dock area for plots on new-plot" 1049 preferences_menu.AppendCheckItem(id, '&CleanUp Dock on NewPlot', hint) 1050 wx.EVT_MENU(self, id, self.on_cleanup_dock) 1051 flag = self.cleanup_plots 1052 if self.cleanup_plots: 1053 c_menu = preferences_menu.FindItemById(id) 1054 c_menu.Check(True) 1023 1055 self._window_menu.AppendSubMenu(preferences_menu,'&Preferences') 1024 1056 if self._window_menu.GetMenuItemCount() == 0: … … 1044 1076 self._menubar.Append(self._window_menu, '&Window') 1045 1077 """ 1078 1046 1079 1047 1080 def _add_menu_application(self): … … 1052 1085 add menu application 1053 1086 """ 1054 style = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 1055 if style == GUIFRAME.MULTIPLE_APPLICATIONS: 1087 #style = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 1088 #if style == GUIFRAME.MULTIPLE_APPLICATIONS: 1089 if self._num_perspectives > 1: 1056 1090 plug_data_count = False 1057 1091 plug_no_data_count = False … … 1105 1139 1106 1140 id = wx.NewId() 1107 hint_load_file = "read all analysis states save previously"1141 hint_load_file = "read all analysis states saved previously" 1108 1142 self._save_appl_menu = self._file_menu.Append(id, 1109 1143 '&Open Project', hint_load_file) … … 1285 1319 def hide_panel(self, uid): 1286 1320 """ 1287 hide panel 1321 hide panel except default panel 1288 1322 """ 1289 1323 ID = str(uid) … … 1296 1330 ID in self.plot_panels.keys(): 1297 1331 self._data_panel.cb_plotpanel.Append(str(caption), p) 1298 # Hide default panel1299 self._mgr.GetPane(self.panels["default"].window_name).Hide()1332 # Do not Hide default panel here... 1333 #self._mgr.GetPane(self.panels["default"].window_name).Hide() 1300 1334 self._mgr.Update() 1301 1335 … … 1811 1845 list_data, _ = self._data_manager.get_by_id(data_id) 1812 1846 if self._current_perspective is not None: 1813 for uid, panel in self.plot_panels.iteritems() : 1814 #panel = self.plot_panels[uid] 1815 window = self._mgr.GetPane(panel.window_name) 1816 # To hide all docked plot panels when set the data 1817 #if not window.IsFloating(): 1818 # self.hide_panel(uid) 1847 if self.cleanup_plots: 1848 for uid, panel in self.plot_panels.iteritems(): 1849 #panel = self.plot_panels[uid] 1850 window = self._mgr.GetPane(panel.window_name) 1851 # To hide all docked plot panels when set the data 1852 if not window.IsFloating(): 1853 self.hide_panel(uid) 1819 1854 self._current_perspective.set_data(list_data.values()) 1820 1855 self.on_close_welcome_panel() … … 1870 1905 info='warning')) 1871 1906 else: 1907 if self.cleanup_plots: 1908 for id, panel in self.plot_panels.iteritems(): 1909 window = self._mgr.GetPane(panel.window_name) 1910 # To hide all docked plot panels when set the data 1911 if not window.IsFloating(): 1912 self.hide_panel(id) 1872 1913 #if not append then new plot 1873 1914 from sans.guiframe.dataFitting import Data2D … … 1975 2016 self.__gui_style |= GUIFRAME.FLOATING_PANEL 1976 2017 plot_panel = [] 2018 id = event.GetId() 2019 menu = self._window_menu.FindItemById(id) 1977 2020 if self._plotting_plugin is not None: 1978 2021 plot_panel = self._plotting_plugin.plot_panels.values() 1979 2022 for p in plot_panel: 1980 2023 self._popup_floating_panel(p) 1981 2024 menu.Check(True) 2025 1982 2026 def set_plotpanel_fixed(self, event=None): 1983 2027 """ … … 1987 2031 self.__gui_style |= GUIFRAME.FIXED_PANEL 1988 2032 plot_panel = [] 2033 id = event.GetId() 2034 menu = self._window_menu.FindItemById(id) 1989 2035 if self._plotting_plugin is not None: 1990 2036 plot_panel = self._plotting_plugin.plot_panels.values() 1991 2037 for p in plot_panel: 1992 2038 self._popup_fixed_panel(p) 1993 2039 menu.Check(True) 2040 2041 def on_cleanup_dock(self, event=None): 2042 """ 2043 Set Cleanup Dock option 2044 """ 2045 if event == None: 2046 return 2047 id = event.GetId() 2048 menu = self._window_menu.FindItemById(id) 2049 Flag = self.cleanup_plots 2050 if not Flag: 2051 menu.Check(True) 2052 self.cleanup_plots = True 2053 msg = "Cleanup-Dock option set to 'ON'." 2054 else: 2055 menu.Check(False) 2056 self.cleanup_plots = False 2057 msg = "Cleanup-Dock option set to 'OFF'." 2058 2059 wx.PostEvent(self, StatusEvent(status= msg)) 2060 1994 2061 def _popup_fixed_panel(self, p): 1995 2062 """ -
guiframe/startup_configuration.py
r9d8f193 rf2d9e76 25 25 'FIXED_PANEL':True, 26 26 'WELCOME_PANEL_SHOW':False, 27 'CLEANUP_PLOT':False, 27 28 'DEFAULT_PERSPECTIVE':'Fitting'} 28 29 … … 65 66 current_bt.SetValue(False) 66 67 current_bt.Bind(wx.EVT_RADIOBUTTON, self.OnCurrent) 67 msg = "\nThis new configuration will take effect after\n"68 msg += "restarting th isapplication..."68 msg = "\nThis new selection will take effect after\n" 69 msg += "restarting the SansView application..." 69 70 note_txt = wx.StaticText(panel, -1, msg, (15, 75)) 70 71 note_txt.SetForegroundColour("red") 71 72 hbox = wx.BoxSizer(wx.HORIZONTAL) 72 73 cancelButton = wx.Button(self, -1, 'Cancel', size=(70, 25)) … … 104 105 p_size = None 105 106 for panel in self.parent.plot_panels.values(): 106 if p_size == None or panel.size > p_size: 107 p_size = panel.size 107 p_panel = self.parent._mgr.GetPane(panel.window_name) 108 if p_panel.IsShown(): 109 if p_size == None or panel.size > p_size: 110 p_size = panel.size 108 111 if p_size == None: 109 112 p_size = DEFAULT_STRINGS['PLOPANEL_WIDTH'] … … 136 139 else: 137 140 self.current_string['WELCOME_PANEL_SHOW'] = False 138 141 self.current_string['CLEANUP_PLOT'] = \ 142 self.parent.cleanup_plots 139 143 perspective = self.parent.get_current_perspective() 140 144 self.current_string['DEFAULT_PERSPECTIVE'] = str(perspective.sub_menu) -
sansview/custom_config.py
radf44c2 rf2d9e76 6 6 GUIFRAME_HEIGHT = 840 7 7 GUIFRAME_WIDTH = 1150 8 CLEANUP_PLOT = False 8 9 WELCOME_PANEL_SHOW = False 9 10 TOOLBAR_SHOW = True -
sansview/local_config.py
radf44c2 rf2d9e76 7 7 # Version of the application 8 8 __appname__ = "SansView" 9 __version__ = '1.9_RC_ 2'9 __version__ = '1.9_RC_3' 10 10 __download_page__ = 'http://danse.chem.utk.edu' 11 11 __update_URL__ = 'http://danse.chem.utk.edu/sansview_version.php' … … 67 67 SS_MAX_DISPLAY_TIME = 5000 #5 sec 68 68 WELCOME_PANEL_SHOW = False 69 CLEANUP_PLOT = False 69 70 SetupIconFile_win = os.path.join("images", "ball.ico") 70 71 SetupIconFile_mac = os.path.join("images", "ball.icns")
Note: See TracChangeset
for help on using the changeset viewer.