Changeset d828481 in sasview


Ignore:
Timestamp:
Feb 3, 2011 5:32:29 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
f036c692
Parents:
9694eab
Message:

remove welcome panel menu depending on a new config

Location:
guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_panel.py

    r52725d6 rd828481  
    191191        wx.EVT_BUTTON(self, self.bt_plot.GetId(), self.on_plot) 
    192192         
    193         self.bt_remove = wx.Button(self, wx.NewId(), "Delete Data") 
    194         self.bt_remove.SetToolTipString("Delete data from the application") 
     193        self.bt_remove = wx.Button(self, wx.NewId(), "Remove Data") 
     194        self.bt_remove.SetToolTipString("Remove data from the application") 
    195195        wx.EVT_BUTTON(self, self.bt_remove.GetId(), self.on_remove) 
    196196         
  • guiframe/gui_manager.py

    r95f9cc4 rd828481  
    4444from sans.guiframe.events import NewLoadedDataEvent 
    4545from sans.guiframe.data_panel import DataPanel 
     46from sans.guiframe.panel_base import PanelBase 
    4647 
    4748STATE_FILE_EXT = ['.inv', '.fitv', '.prv'] 
     
    106107        self._applications_menu_pos = -1 
    107108        self._applications_menu = None 
     109        self._edit_menu = None 
    108110        ## Find plug-ins 
    109111        # Modify this so that we can specify the directory to look into 
     
    356358                              MinimizeButton(). 
    357359                              MinSize(wx.Size(w, h)). 
    358                               Show()) 
     360                              Hide()) 
    359361        style = self.__gui_style & GUIFRAME.MANAGER_ON 
    360362        if style != GUIFRAME.MANAGER_ON: 
    361363            self._mgr.GetPane(self.panels["data_panel"].window_name).Hide() 
     364            print "manager_on" 
     365        else: 
     366            self._mgr.GetPane(self.panels["data_panel"].window_name).Show() 
    362367             
    363368        # Add the panels to the AUI manager 
     
    538543        # Help menu 
    539544        self._help_menu = wx.Menu() 
    540         # add the welcome panel menu item 
    541         if self.defaultPanel is not None: 
    542             id = wx.NewId() 
    543             self._help_menu.Append(id, '&Welcome', '') 
    544             self._help_menu.AppendSeparator() 
    545             wx.EVT_MENU(self, id, self.show_welcome_panel) 
     545        style = self.__gui_style & GUIFRAME.WELCOME_PANEL_ON 
     546        if style == GUIFRAME.WELCOME_PANEL_ON: 
     547            # add the welcome panel menu item 
     548            if self.defaultPanel is not None: 
     549                id = wx.NewId() 
     550                self._help_menu.Append(id, '&Welcome', '') 
     551                self._help_menu.AppendSeparator() 
     552                wx.EVT_MENU(self, id, self.show_welcome_panel) 
    546553        # Look for help item in plug-ins  
    547554        for item in self.plugins: 
     
    604611            id = wx.NewId() 
    605612            self._window_menu.AppendSubMenu(preferences_menu,'&Preferences') 
     613        if self._window_menu.GetMenuItemCount() == 0: 
     614            pos = self._menubar.FindMenu('Window') 
     615            self._menubar.Remove(pos) 
    606616        #wx.EVT_MENU(self, id, self.show_preferences_panel)    
    607617        """ 
     
    658668        add menu file 
    659669        """ 
     670         
    660671         # File menu 
    661672        self._file_menu = wx.Menu() 
    662         # some menu of plugin to be seen under file menu 
    663         self._populate_file_menu() 
    664         id = wx.NewId() 
    665         self._file_menu.Append(id, '&Save Application', 
    666                              'Save state of the current active application') 
    667         wx.EVT_MENU(self, id, self._on_save_application) 
    668         id = wx.NewId() 
    669         self._file_menu.Append(id, '&Save Project', 
    670                              'Save the state of the whole application') 
    671         wx.EVT_MENU(self, id, self._on_save_project) 
    672         self._file_menu.AppendSeparator() 
     673        style = self.__gui_style & GUIFRAME.DATALOADER_ON 
     674        if style == GUIFRAME.DATALOADER_ON: 
     675            # some menu of plugin to be seen under file menu 
     676            self._populate_file_menu() 
     677            id = wx.NewId() 
     678            self._file_menu.Append(id, '&Save Application', 
     679                                 'Save state of the current active application') 
     680            wx.EVT_MENU(self, id, self._on_save_application) 
     681            id = wx.NewId() 
     682            self._file_menu.Append(id, '&Save Project', 
     683                                 'Save the state of the whole application') 
     684            wx.EVT_MENU(self, id, self._on_save_project) 
     685            self._file_menu.AppendSeparator() 
    673686         
    674687        id = wx.NewId() 
     
    677690        # Add sub menus 
    678691        self._menubar.Append(self._file_menu, '&File') 
     692         
     693    def _add_menu_edit(self): 
     694        """ 
     695        add menu edit 
     696        """ 
     697        # Edit Menu 
     698        self._edit_menu = wx.Menu() 
     699         
     700        id = wx.NewId() 
     701        self._edit_menu.Append(id, '&Undo', 'Undo the previous action') 
     702        wx.EVT_MENU(self, id, self.on_undo_panel) 
     703         
     704        id = wx.NewId() 
     705        self._edit_menu.Append(id, '&Redo', 'Redo the previous action') 
     706        wx.EVT_MENU(self, id, self.on_redo_panel) 
     707        self._edit_menu.AppendSeparator() 
     708        id = wx.NewId() 
     709        self._edit_menu.Append(id, '&Bookmark', 'bookmark current panel') 
     710        wx.EVT_MENU(self, id, self.on_bookmark_panel) 
     711         
     712        id = wx.NewId() 
     713        self._edit_menu.Append(id, '&Save As', 'Save current panel into file') 
     714        wx.EVT_MENU(self, id, self.on_save_panel) 
     715        self._edit_menu.AppendSeparator() 
     716        id = wx.NewId() 
     717        self._edit_menu.Append(id, '&Print Preview', 'Preview current panel') 
     718        wx.EVT_MENU(self, id, self.on_preview_panel) 
     719         
     720        id = wx.NewId() 
     721        self._edit_menu.Append(id, '&Print', 'Print current panel') 
     722        wx.EVT_MENU(self, id, self.on_print_panel) 
     723        self._edit_menu.AppendSeparator() 
     724        id = wx.NewId() 
     725        self._edit_menu.Append(id, '&Zoom', 'Zoom current panel') 
     726        wx.EVT_MENU(self, id, self.on_zoom_panel) 
     727         
     728        id = wx.NewId() 
     729        self._edit_menu.Append(id, '&Zoom In', 'Zoom in current panel') 
     730        wx.EVT_MENU(self, id, self.on_zoom_in_panel) 
     731        
     732        id = wx.NewId() 
     733        self._edit_menu.Append(id, '&Zoom Out', 'Zoom out current panel') 
     734        wx.EVT_MENU(self, id, self.on_zoom_out_panel) 
     735         
     736        id = wx.NewId() 
     737        self._edit_menu.Append(id, '&Drag', 'Drag current panel') 
     738        wx.EVT_MENU(self, id, self.on_drag_panel) 
     739         
     740        id = wx.NewId() 
     741        self._edit_menu.Append(id, '&Reset', 'Reset current panel') 
     742        wx.EVT_MENU(self, id, self.on_reset_panel) 
     743         
     744        self.menubar.Append(self._edit_menu,  '&Edit') 
    679745         
    680746    def _add_menu_data(self): 
     
    11191185                    return  
    11201186                else: 
    1121                     if self.enable_add_data(new_plot): 
     1187                    if self.enable_add_data(new_plot) and \ 
     1188                    hasattr(self.panel_on_focus, 'group_id'): 
    11221189                        new_plot.group_id = self.panel_on_focus.group_id 
    11231190            wx.PostEvent(self, NewPlotEvent(plot=new_plot, 
     
    12471314     
    12481315        return is_data1d and not is_data2d and not is_theory and not is_state_data 
    1249          
    1250 class DefaultPanel(wx.Panel): 
     1316     
     1317    def on_undo_panel(self, event=None): 
     1318        """ 
     1319        undo previous action of the last panel on focus if possible 
     1320        """ 
     1321    def on_redo_panel(self, event=None): 
     1322        """ 
     1323        redo the last cancel action done on the last panel on focus 
     1324        """ 
     1325    def on_bookmark_panel(self, event=None): 
     1326        """ 
     1327        Bookmark available information of the panel on focus 
     1328        """ 
     1329    def on_save_panel(self, event=None): 
     1330        """ 
     1331        save possible information on the current panel 
     1332        """ 
     1333    def on_preview_panel(self, event=None): 
     1334        """ 
     1335        preview information on the panel on focus 
     1336        """ 
     1337    def on_print_panel(self, event=None): 
     1338        """ 
     1339        print available information on the last panel on focus 
     1340        """ 
     1341    def on_zoom_panel(self, event=None): 
     1342        """ 
     1343        zoom on the current panel if possible 
     1344        """ 
     1345    def on_zoom_in_panel(self, event=None): 
     1346        """ 
     1347        zoom in of the panel on focus 
     1348        """ 
     1349    def on_zoom_out_panel(self, event=None): 
     1350        """ 
     1351        zoom out on the panel on focus 
     1352        """ 
     1353    def on_drag_panel(self, event=None): 
     1354        """ 
     1355        drag apply to the panel on focus 
     1356        """ 
     1357    def on_reset_panel(self, event=None): 
     1358        """ 
     1359        reset the current panel 
     1360        """ 
     1361         
     1362         
     1363class DefaultPanel(wx.Panel, PanelBase): 
    12511364    """ 
    12521365    Defines the API for a panels to work with 
     
    12591372    ## Flag to tell the AUI manager to put this panel in the center pane 
    12601373    CENTER_PANE = True 
     1374     
    12611375 
    12621376 
     
    12681382    TITLE = config.__appname__ 
    12691383    PROG_SPLASH_PATH = PROG_SPLASH_SCREEN 
    1270     STYLE = GUIFRAME.DEFAULT_STYLE 
     1384    STYLE = GUIFRAME.SINGLE_APPLICATION 
    12711385    def OnInit(self): 
    12721386        """ 
  • guiframe/gui_style.py

    r3feed3e rd828481  
    1212    TOOL_ON = 32 
    1313    SINGLE_APPLICATION = 64 
     14    WELCOME_PANEL_ON = 128 
    1415    DEFAULT_STYLE = SINGLE_APPLICATION|DATALOADER_ON|PLOTTING_ON|FIXED_PANEL 
    15     MULTIPLE_APPLICATIONS = DEFAULT_STYLE|MANAGER_ON 
     16    MULTIPLE_APPLICATIONS = DEFAULT_STYLE|MANAGER_ON|WELCOME_PANEL_ON 
    1617 
    1718if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.