Changeset cbf22e5 in sasview for guiframe/gui_manager.py


Ignore:
Timestamp:
Jan 31, 2011 5:13:21 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:
2399b2a
Parents:
bf4402c3
Message:

working on guiframe menu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    rbf4402c3 rcbf22e5  
    5353 
    5454 
    55  
    5655class ViewerFrame(wx.Frame): 
    5756    """ 
     
    104103        self._help_menu = None 
    105104        self._tool_menu = None 
    106         self._plugin_menu_list = [] 
     105        self._plugin_menu = None 
    107106        ## Find plug-ins 
    108107        # Modify this so that we can specify the directory to look into 
     
    372371                    self._mgr.AddPane(p, wx.aui.AuiPaneInfo(). 
    373372                                          Name(p.window_name).Caption(p.window_caption). 
    374                                            Center(). 
    375                                            CloseButton(True). 
     373                                           CenterPane(). 
    376374                                           MinSize(wx.Size(w, h)). 
    377375                                           Hide()) 
     
    477475        self._add_menu_data() 
    478476        self._add_menu_application() 
    479         self._add_current_plugin_menu() 
    480477        self._add_menu_tool() 
    481478        self._add_menu_window() 
    482479        self._add_help_menu() 
     480        self._add_current_plugin_menu() 
    483481        self.SetMenuBar(self._menubar) 
    484482         
     
    506504        """ 
    507505        add current plugin menu 
    508         """ 
    509           # Look for plug-in menus 
    510         # Add available plug-in sub-menus.  
    511         for item in self.plugins: 
    512             if item != self._plotting_plugin: 
    513                 for (menu, name) in \ 
    514                     item.populate_menu(self): 
    515                     self._menubar.Append(menu, name) 
    516                     
     506        Look for plug-in menus 
     507        Add available plug-in sub-menus.  
     508        """ 
     509        if self._menubar is None: 
     510            return 
     511         
     512        pos = self._menubar.GetMenuCount() 
     513        if self._current_perspective is not None: 
     514            if self._current_perspective != self._plotting_plugin: 
     515                menu_list = self._current_perspective.populate_menu(self) 
     516                if menu_list: 
     517                    for (menu, name) in menu_list: 
     518                        self._plugin_menu = self._menubar.Append(menu, 'Others') 
     519                #else: 
     520                #    self._plugin_menu = self._menubar.Append(wx.Menu(), 'all')               
     521        #else: 
     522        #    self._plugin_menu = self._menubar.Insert(pos, wx.Menu(), 'all') 
     523                         
    517524    def _add_help_menu(self): 
    518525        """ 
     
    976983        :param panels: list of panels 
    977984        """ 
    978         
    979985        for item in self.panels: 
    980986            # Check whether this is a sticky panel 
     
    11301136        self._current_perspective = perspective 
    11311137        name = "No current Application selected" 
    1132         if self._current_perspective is not None and \ 
    1133             self._data_panel is not None: 
    1134             name = self._current_perspective.sub_menu 
    1135             self._data_panel.set_active_perspective(name) 
     1138        if self._current_perspective is not None: 
     1139            self._add_current_plugin_menu() 
     1140            if self._data_panel is not None: 
     1141                name = self._current_perspective.sub_menu 
     1142                self._data_panel.set_active_perspective(name) 
    11361143            
    11371144    def set_plotpanel_floating(self, event=None): 
Note: See TracChangeset for help on using the changeset viewer.