Changeset 3d6b00c in sasview for src/sans/guiframe
- Timestamp:
- Apr 7, 2014 3:49:02 PM (11 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:
- d11d1aa
- Parents:
- 443a487
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/guiframe/gui_manager.py
r4d7e5d5 r3d6b00c 298 298 # Welcome panel 299 299 self.defaultPanel = None 300 self.welcome_panel_class = None 300 301 #panel on focus 301 302 self.panel_on_focus = None … … 758 759 # set tool bar 759 760 self._setup_tool_bar() 761 762 # Create the menu bar. To be filled later. 763 # WX 3.0 needs us to create the menu bar first. 764 self._menubar = wx.MenuBar() 765 self.SetMenuBar(self._menubar) 760 766 # Set up the layout 761 767 self._setup_layout() … … 770 776 str(self._input_file)) 771 777 msg += str(sys.exc_value) + '\n' 772 print msg778 logging.error(msg) 773 779 if self._data_panel is not None and len(self.plugins) > 0: 774 780 self._data_panel.fill_cbox_analysis(self.plugins) … … 932 938 933 939 return plugins 934 935 def set_welcome_panel(self, panel_class): 936 """ 937 Sets the default panel as the given welcome panel 938 939 :param panel_class: class of the welcome panel to be instantiated 940 941 """ 942 win = MDIFrame(self, None, 'None', (100, 200)) 943 self.defaultPanel = panel_class(win, -1, style=wx.RAISED_BORDER) 944 win.set_panel(self.defaultPanel) 945 self.defaultPanel.set_frame(win) 946 win.Show(False) 947 940 948 941 def _get_panels_size(self, p): 949 942 """ … … 986 979 ps = item.get_panels(self) 987 980 panels.extend(ps) 988 989 # Show a default panel with some help information 990 # It also sets the size of the application windows 991 #TODO: Use this for splash screen 992 #if self.defaultPanel is None: 993 # self.defaultPanel = DefaultPanel(self, -1, style=wx.RAISED_BORDER) 994 # add a blank default panel always present 981 982 # Set up welcome panel 983 #TODO: this needs serious simplification 984 if self.welcome_panel_class is not None: 985 welcome_panel = MDIFrame(self, None, 'None', (100, 200)) 986 self.defaultPanel = self.welcome_panel_class(welcome_panel, -1, style=wx.RAISED_BORDER) 987 welcome_panel.set_panel(self.defaultPanel) 988 self.defaultPanel.set_frame(welcome_panel) 989 welcome_panel.Show(False) 990 995 991 self.panels["default"] = self.defaultPanel 996 w, h = self._get_panels_size(self.defaultPanel)997 frame = self.defaultPanel.get_frame()998 frame.SetSize((self._window_width, self._window_height))999 992 size_t_bar = 70 1000 if not IS_WIN: 1001 if IS_LINUX: 1002 size_t_bar = 115 1003 frame.SetPosition((0, mac_pos_y + size_t_bar)) 1004 frame.Show(True) 993 if IS_LINUX: 994 size_t_bar = 115 995 if self.defaultPanel is not None: 996 w, h = self._get_panels_size(self.defaultPanel) 997 frame = self.defaultPanel.get_frame() 998 frame.SetSize((self._window_width, self._window_height)) 999 if not IS_WIN: 1000 frame.SetPosition((0, mac_pos_y + size_t_bar)) 1001 frame.Show(True) 1005 1002 #add data panel 1006 1003 win = MDIFrame(self, None, 'None', (100, 200)) … … 1219 1216 """ 1220 1217 # Menu 1221 self._menubar = wx.MenuBar()1222 1218 self._add_menu_file() 1223 1219 self._add_menu_edit() … … 1229 1225 #self._add_menu_window() 1230 1226 self._add_help_menu() 1231 self.SetMenuBar(self._menubar)1232 1227 1233 1228 def _setup_tool_bar(self): … … 1238 1233 # The legacy code doesn't work well for wx 3.0 1239 1234 # but the old code produces better results with wx 2.8 1240 if wx.VERSION_STRING >= '3.0.0.0':1235 if not IS_WIN and wx.VERSION_STRING >= '3.0.0.0': 1241 1236 sizer = wx.BoxSizer(wx.VERTICAL) 1242 1237 sizer.Add(self._toolbar, 0, wx.EXPAND) … … 1679 1674 caption = self.panels[ID].window_caption 1680 1675 except: 1681 print "delete_panel: No such plot id as %s" % ID1676 logging.error("delete_panel: No such plot id as %s" % ID) 1682 1677 return 1683 1678 if ID in self.panels.keys(): … … 1717 1712 log_msg += "load: %s\n" % str(basename) 1718 1713 log_msg += "Try Data opening...." 1719 logging.info(log_msg) 1720 print log_msg 1721 #self.load_complete(output=output, error_message=error_message, 1722 # message=log_msg, path=path) 1714 logging.error(log_msg) 1723 1715 return 1724 1716 … … 1799 1791 log_msg += "load: %s\n" % str(path) 1800 1792 log_msg += "Try File opening ...." 1801 print log_msg1793 logging.error(log_msg) 1802 1794 return 1803 1795 log_msg = '' … … 1805 1797 error_message = "" 1806 1798 try: 1807 print "Loading Data...:\n" + str(path) + "\n"1799 logging.info("Loading Data...:\n" + str(path) + "\n") 1808 1800 temp = self.loader.load(path) 1809 1801 if temp.__class__.__name__ == "list": … … 1820 1812 error_message += " Data from cmd:\n %s\n" % str(path) 1821 1813 error_message += str(sys.exc_value) + "\n" 1822 print error_message1814 logging.error(error_message) 1823 1815 1824 1816 def load_folder(self, path): … … 1841 1833 error_message += " Data folder from cmd:\n %s\n" % str(path) 1842 1834 error_message += str(sys.exc_value) + "\n" 1843 print error_message1835 logging.error(error_message) 1844 1836 1845 1837 def _on_open_state_application(self, event): … … 2130 2122 dialog.Show(True) 2131 2123 except: 2132 print "Error in _onTutorial: %s" % sys.exc_value2124 logging.error("Error in _onTutorial: %s" % sys.exc_value) 2133 2125 try: 2134 2126 #in case when the pdf default set other than acrobat … … 3302 3294 3303 3295 """ 3304 self.frame. set_welcome_panel(panel_class)3296 self.frame.welcome_panel_class = panel_class 3305 3297 3306 3298 def add_perspective(self, perspective): … … 3418 3410 Frame for panels 3419 3411 """ 3420 def __init__(self, parent, panel, title="Untitled", 3421 size=(300,200), *args, **kwds): 3412 def __init__(self, parent, panel, title="Untitled", size=(300,200)): 3422 3413 """ 3423 3414 comment 3424 3415 :param parent: parent panel/container 3425 3416 """ 3426 kwds['size']= size3427 kwds['title']= title3428 kwds['style'] = MDI_STYLE3429 3417 # Initialize the Frame object 3430 CHILD_FRAME.__init__(self, parent , *args, **kwds)3418 CHILD_FRAME.__init__(self, parent=parent, id=wx.ID_ANY, title=title, size=size) 3431 3419 self.parent = parent 3432 3420 self.name = "Untitled"
Note: See TracChangeset
for help on using the changeset viewer.