Changeset d828481 in sasview
- Timestamp:
- Feb 3, 2011 5:32:29 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:
- f036c692
- Parents:
- 9694eab
- Location:
- guiframe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_panel.py
r52725d6 rd828481 191 191 wx.EVT_BUTTON(self, self.bt_plot.GetId(), self.on_plot) 192 192 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") 195 195 wx.EVT_BUTTON(self, self.bt_remove.GetId(), self.on_remove) 196 196 -
guiframe/gui_manager.py
r95f9cc4 rd828481 44 44 from sans.guiframe.events import NewLoadedDataEvent 45 45 from sans.guiframe.data_panel import DataPanel 46 from sans.guiframe.panel_base import PanelBase 46 47 47 48 STATE_FILE_EXT = ['.inv', '.fitv', '.prv'] … … 106 107 self._applications_menu_pos = -1 107 108 self._applications_menu = None 109 self._edit_menu = None 108 110 ## Find plug-ins 109 111 # Modify this so that we can specify the directory to look into … … 356 358 MinimizeButton(). 357 359 MinSize(wx.Size(w, h)). 358 Show())360 Hide()) 359 361 style = self.__gui_style & GUIFRAME.MANAGER_ON 360 362 if style != GUIFRAME.MANAGER_ON: 361 363 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() 362 367 363 368 # Add the panels to the AUI manager … … 538 543 # Help menu 539 544 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) 546 553 # Look for help item in plug-ins 547 554 for item in self.plugins: … … 604 611 id = wx.NewId() 605 612 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) 606 616 #wx.EVT_MENU(self, id, self.show_preferences_panel) 607 617 """ … … 658 668 add menu file 659 669 """ 670 660 671 # File menu 661 672 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() 673 686 674 687 id = wx.NewId() … … 677 690 # Add sub menus 678 691 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') 679 745 680 746 def _add_menu_data(self): … … 1119 1185 return 1120 1186 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'): 1122 1189 new_plot.group_id = self.panel_on_focus.group_id 1123 1190 wx.PostEvent(self, NewPlotEvent(plot=new_plot, … … 1247 1314 1248 1315 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 1363 class DefaultPanel(wx.Panel, PanelBase): 1251 1364 """ 1252 1365 Defines the API for a panels to work with … … 1259 1372 ## Flag to tell the AUI manager to put this panel in the center pane 1260 1373 CENTER_PANE = True 1374 1261 1375 1262 1376 … … 1268 1382 TITLE = config.__appname__ 1269 1383 PROG_SPLASH_PATH = PROG_SPLASH_SCREEN 1270 STYLE = GUIFRAME. DEFAULT_STYLE1384 STYLE = GUIFRAME.SINGLE_APPLICATION 1271 1385 def OnInit(self): 1272 1386 """ -
guiframe/gui_style.py
r3feed3e rd828481 12 12 TOOL_ON = 32 13 13 SINGLE_APPLICATION = 64 14 WELCOME_PANEL_ON = 128 14 15 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 16 17 17 18 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.