Changeset 34e3ab3 in sasview
- Timestamp:
- Apr 20, 2011 10:36:11 AM (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:
- 39e5025f
- Parents:
- 38aadd9
- Location:
- guiframe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
r38aadd9 r34e3ab3 122 122 self._file_menu = None 123 123 self._data_menu = None 124 self._view_menu = None 124 125 self._window_menu = None 125 126 self._data_panel_menu = None … … 644 645 self._add_menu_file() 645 646 self._add_menu_edit() 646 self._add_menu_data() 647 self._add_menu_view() 648 #self._add_menu_data() 647 649 self._add_menu_application() 648 649 650 self._add_menu_tool() 650 651 self._add_current_plugin_menu() … … 768 769 self._menubar.Append(self._help_menu, '&Help') 769 770 771 def _add_menu_view(self): 772 """ 773 add menu items under view menu 774 """ 775 self._view_menu = wx.Menu() 776 style = self.__gui_style & GUIFRAME.MANAGER_ON 777 id = wx.NewId() 778 self._data_panel_menu = self._view_menu.Append(id, 779 '&Data Explorer ON', '') 780 wx.EVT_MENU(self, id, self.show_data_panel) 781 if style == GUIFRAME.MANAGER_ON: 782 self._data_panel_menu.SetText('Data Explorer OFF') 783 else: 784 self._data_panel_menu.SetText('Data Explorer ON') 785 self._view_menu.AppendSeparator() 786 style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 787 if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 788 id = wx.NewId() 789 self._toolbar_menu = self._view_menu.Append(id,'&Show Toolbar', '') 790 wx.EVT_MENU(self, id, self._on_hide_toolbar) 791 self._menubar.Append(self._view_menu, '&View') 792 770 793 def _add_menu_window(self): 771 794 """ … … 858 881 self._check_applications_menu() 859 882 883 def _populate_file_menu(self): 884 """ 885 Insert menu item under file menu 886 """ 887 for plugin in self.plugins: 888 if len(plugin.populate_file_menu()) > 0: 889 for item in plugin.populate_file_menu(): 890 m_name, m_hint, m_handler = item 891 id = wx.NewId() 892 self._file_menu.Append(id, m_name, m_hint) 893 wx.EVT_MENU(self, id, m_handler) 894 self._file_menu.AppendSeparator() 895 860 896 def _add_menu_file(self): 861 897 """ … … 865 901 # File menu 866 902 self._file_menu = wx.Menu() 903 #append item from plugin under menu file if necessary 904 self._populate_file_menu() 867 905 style = self.__gui_style & GUIFRAME.DATALOADER_ON 868 906 style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS … … 927 965 'Reset current panel') 928 966 wx.EVT_MENU(self, GUIFRAME_ID.RESET_ID, self.on_reset_panel) 929 930 self._edit_menu.AppendSeparator() 931 style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 932 if style1 == GUIFRAME.MULTIPLE_APPLICATIONS: 933 id = wx.NewId() 934 self._toolbar_menu = self._edit_menu.Append(id,'&Show Toolbar', '') 935 wx.EVT_MENU(self, id, self._on_hide_toolbar) 936 967 937 968 self._menubar.Append(self._edit_menu, '&Edit') 938 969 self.enable_edit_menu() … … 952 983 for (menu, name) in menu_list: 953 984 self._menubar.Append(menu, name) 954 955 style = self.__gui_style & GUIFRAME.MANAGER_ON 956 if self._data_plugin != None: 957 _data_menu = self._data_plugin._data_menu 958 _data_menu.AppendSeparator() 959 id = wx.NewId() 960 self._data_panel_menu = _data_menu.Append(id, 961 '&Data Explorer ON', '') 962 wx.EVT_MENU(self, id, self.show_data_panel) 963 if style == GUIFRAME.MANAGER_ON: 964 self._data_panel_menu.SetText('Data Explorer OFF') 965 else: 966 self._data_panel_menu.SetText('Data Explorer ON') 985 967 986 968 987 def _on_hide_toolbar(self, event=None): -
guiframe/plugin_base.py
r957723f r34e3ab3 105 105 """ 106 106 return self._always_active 107 107 108 def populate_file_menu(self): 109 """ 110 Append menu item under file menu item of the frame 111 """ 112 return [] 113 108 114 def populate_menu(self, parent): 109 115 """
Note: See TracChangeset
for help on using the changeset viewer.