- Timestamp:
- Feb 3, 2011 4:03:10 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:
- 7f795490
- Parents:
- eb8474f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
rec489f5 r95f9cc4 104 104 self._help_menu = None 105 105 self._tool_menu = None 106 self._plugin_menu_pos = -1 106 self._applications_menu_pos = -1 107 self._applications_menu = None 107 108 ## Find plug-ins 108 109 # Modify this so that we can specify the directory to look into … … 526 527 if menu_list: 527 528 for (menu, _) in menu_list: 528 if self._ plugin_menu_pos == -1:529 if self._applications_menu_pos == -1: 529 530 self._menubar.Append(menu, name) 530 531 else: 531 self._menubar.Insert(self._ plugin_menu_pos, menu, name)532 self._menubar.Insert(self._applications_menu_pos, menu, name) 532 533 533 534 def _add_help_menu(self): … … 632 633 style = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 633 634 if style == GUIFRAME.MULTIPLE_APPLICATIONS: 634 p_menu = wx.Menu() 635 plug_data_count = False 636 plug_no_data_count = False 637 self._applications_menu = wx.Menu() 638 separator = self._applications_menu.AppendSeparator() 635 639 for plug in self.plugins: 636 640 if len(plug.get_perspective()) > 0: 637 641 id = wx.NewId() 638 p_menu.Append(id, plug.sub_menu, 639 "Switch to application: %s" % plug.sub_menu) 642 if plug.use_data(): 643 self._applications_menu.InsertCheckItem(0, id, plug.sub_menu, 644 "Switch to application: %s" % plug.sub_menu) 645 plug_data_count = True 646 else: 647 plug_no_data_count = True 648 self._applications_menu.AppendCheckItem(id, plug.sub_menu, 649 "Switch to application: %s" % plug.sub_menu) 640 650 wx.EVT_MENU(self, id, plug.on_perspective) 641 self._menubar.Append(p_menu, '&Applications') 651 if not (plug_data_count and plug_no_data_count): 652 self._applications_menu.RemoveItem(separator) 653 self._menubar.Append(self._applications_menu, '&Applications') 654 self._check_applications_menu() 642 655 643 656 def _add_menu_file(self): … … 1146 1159 name = self._current_perspective.sub_menu 1147 1160 self._data_panel.set_active_perspective(name) 1161 self._check_applications_menu() 1162 1163 def _check_applications_menu(self): 1164 """ 1165 check the menu of the current application 1166 """ 1167 if self._applications_menu is not None: 1168 for menu in self._applications_menu.GetMenuItems(): 1169 if self._current_perspective is not None: 1170 name = self._current_perspective.sub_menu 1171 if menu.IsCheckable(): 1172 if menu.GetLabel() == name: 1173 menu.Check(True) 1174 else: 1175 menu.Check(False) 1148 1176 1149 1177 def set_plotpanel_floating(self, event=None):
Note: See TracChangeset
for help on using the changeset viewer.