Changeset f036c692 in sasview
- Timestamp:
- Feb 3, 2011 4:36:09 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:
- 27f3831
- Parents:
- d828481
- Location:
- guiframe
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/gui_manager.py
rd828481 rf036c692 41 41 from sans.guiframe.events import StatusEvent 42 42 from sans.guiframe.events import NewPlotEvent 43 from sans.guiframe.gui_style import * 43 from sans.guiframe.gui_style import GUIFRAME 44 from sans.guiframe.gui_style import GUIFRAME_ID 44 45 from sans.guiframe.events import NewLoadedDataEvent 45 46 from sans.guiframe.data_panel import DataPanel 46 47 from sans.guiframe.panel_base import PanelBase 48 from sans.guiframe.gui_toolbar import GUIToolBar 47 49 48 50 STATE_FILE_EXT = ['.inv', '.fitv', '.prv'] … … 108 110 self._applications_menu = None 109 111 self._edit_menu = None 112 #tool bar 113 self._toolbar = None 110 114 ## Find plug-ins 111 115 # Modify this so that we can specify the directory to look into … … 142 146 """ 143 147 Store reference to the last panel on focus 148 update the toolbar if available 149 update edit menu if available 144 150 """ 145 151 self.panel_on_focus = event.panel 146 152 if self.panel_on_focus is not None and self._data_panel is not None: 147 self._data_panel.set_panel_on_focus(self.panel_on_focus.window_name) 153 name = self.panel_on_focus.window_name 154 self._data_panel.set_panel_on_focus() 155 if self._toolbar is not None: 156 self.update_button(self.panel_on_focus) 157 #update edit menu 158 self.enable_edit_menu() 148 159 149 160 def build_gui(self): … … 152 163 # Set up the layout 153 164 self._setup_layout() 154 155 165 # Set up the menu 156 166 self._setup_menus() 167 # set tool bar 168 self._setup_tool_bar() 157 169 #self.Fit() 158 170 #self._check_update(None) … … 482 494 self._add_menu_data() 483 495 self._add_menu_application() 496 self._add_menu_edit() 484 497 self._add_menu_tool() 485 498 self._add_current_plugin_menu() … … 488 501 self.SetMenuBar(self._menubar) 489 502 503 def _setup_tool_bar(self): 504 """ 505 add toolbar to the frame 506 """ 507 #set toolbar 508 self._toolbar = GUIToolBar(self, -1) 509 self.SetToolBar(self._toolbar) 510 self._toolbar.update_button() 511 if self._current_perspective is not None: 512 name = self._current_perspective.sub_menu 513 self._toolbar.set_active_perspective(name) 514 490 515 def _add_menu_tool(self): 491 516 """ … … 697 722 # Edit Menu 698 723 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) 724 self._edit_menu.Append(GUIFRAME_ID.UNDO_ID, '&Undo', 725 'Undo the previous action') 726 wx.EVT_MENU(self, GUIFRAME_ID.UNDO_ID, self.on_undo_panel) 727 self._edit_menu.Append(GUIFRAME_ID.REDO_ID, '&Redo', 728 'Redo the previous action') 729 wx.EVT_MENU(self, GUIFRAME_ID.REDO_ID, self.on_redo_panel) 707 730 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) 731 self._edit_menu.Append(GUIFRAME_ID.BOOKMARK_ID, '&Bookmark', 732 'bookmark current panel') 733 wx.EVT_MENU(self, GUIFRAME_ID.BOOKMARK_ID, self.on_bookmark_panel) 734 self._edit_menu.Append(GUIFRAME_ID.SAVE_ID, '&Save As', 735 'Save current panel into file') 736 wx.EVT_MENU(self, GUIFRAME_ID.SAVE_ID, self.on_save_panel) 715 737 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) 738 self._edit_menu.Append(GUIFRAME_ID.PREVIEW_ID, '&Print Preview', 739 'Preview current panel') 740 wx.EVT_MENU(self, GUIFRAME_ID.PREVIEW_ID, self.on_preview_panel) 741 self._edit_menu.Append(GUIFRAME_ID.PRINT_ID, '&Print', 742 'Print current panel') 743 wx.EVT_MENU(self, GUIFRAME_ID.PRINT_ID, self.on_print_panel) 723 744 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') 745 self._edit_menu.Append(GUIFRAME_ID.ZOOM_ID, '&Zoom', 746 'Zoom current panel') 747 wx.EVT_MENU(self, GUIFRAME_ID.ZOOM_ID, self.on_zoom_panel) 748 self._edit_menu.Append(GUIFRAME_ID.ZOOM_IN_ID, '&Zoom In', 749 'Zoom in current panel') 750 wx.EVT_MENU(self, GUIFRAME_ID.ZOOM_IN_ID, self.on_zoom_in_panel) 751 self._edit_menu.Append(GUIFRAME_ID.ZOOM_OUT_ID, '&Zoom Out', 752 'Zoom out current panel') 753 wx.EVT_MENU(self, GUIFRAME_ID.ZOOM_OUT_ID, self.on_zoom_out_panel) 754 self._edit_menu.Append(GUIFRAME_ID.DRAG_ID, '&Drag', 755 'Drag current panel') 756 wx.EVT_MENU(self, GUIFRAME_ID.DRAG_ID, self.on_drag_panel) 757 self._edit_menu.Append(GUIFRAME_ID.RESET_ID, '&Reset', 758 'Reset current panel') 759 wx.EVT_MENU(self, GUIFRAME_ID.RESET_ID, self.on_reset_panel) 760 self._menubar.Append(self._edit_menu, '&Edit') 761 self.enable_edit_menu() 745 762 746 763 def _add_menu_data(self): … … 1219 1236 set the current active perspective 1220 1237 """ 1238 1221 1239 self._current_perspective = perspective 1222 1240 name = "No current Application selected" 1223 1241 if self._current_perspective is not None: 1224 1242 self._add_current_plugin_menu() 1243 name = self._current_perspective.sub_menu 1225 1244 if self._data_panel is not None: 1226 name = self._current_perspective.sub_menu1227 1245 self._data_panel.set_active_perspective(name) 1228 1246 self._check_applications_menu() 1247 #update tool bar 1248 if self._toolbar is not None: 1249 self._toolbar.set_active_perspective(name) 1229 1250 1230 1251 def _check_applications_menu(self): … … 1315 1336 return is_data1d and not is_data2d and not is_theory and not is_state_data 1316 1337 1338 def enable_edit_menu(self): 1339 """ 1340 enable menu item under edit menu depending on the panel on focus 1341 """ 1342 if self.panel_on_focus is not None and self._edit_menu is not None: 1343 flag = panel_on_focus.get_undo_flag() 1344 self._edit_menu.Enable(GUIFRAME_ID.UNDO_ID, flag) 1345 flag = panel_on_focus.get_redo_flag() 1346 self._edit_menu.Enable(GUIFRAME_ID.REDO_ID, flag) 1347 flag = panel_on_focus.get_bookmark_flag() 1348 self._edit_menu.Enable(GUIFRAME_ID.BOOKMARK_ID, flag) 1349 flag = panel_on_focus.get_save_flag() 1350 self._edit_menu.Enable(GUIFRAME_ID.SAVE_ID, flag) 1351 flag = panel_on_focus.get_print_flag() 1352 self._edit_menu.Enable(GUIFRAME_ID.PRINT_ID, flag) 1353 flag = panel_on_focus.get_prieview_flag() 1354 self._edit_menu.Enable(GUIFRAME_ID.PREVIEW_ID, flag) 1355 flag = panel_on_focus.get_zoom_flag() 1356 self._edit_menu.Enable(GUIFRAME_ID.ZOOM_ID, flag) 1357 flag = panel_on_focus.get_zoom_in_flag() 1358 self._edit_menu.Enable(GUIFRAME_ID.ZOOM_IN_ID, flag) 1359 flag = panel_on_focus.get_zoom_out_flag() 1360 self._edit_menu.Enable(GUIFRAME_ID.ZOOM_OUT_ID, flag) 1361 flag = panel_on_focus.get_drag_flag() 1362 self._edit_menu.Enable(GUIFRAME_ID.DRAG_ID, flag) 1363 flag = panel_on_focus.get_reset_flag() 1364 self._edit_menu.Enable(GUIFRAME_ID.RESET_ID, flag) 1365 else: 1366 flag = False 1367 self._edit_menu.Enable(GUIFRAME_ID.UNDO_ID, flag) 1368 self._edit_menu.Enable(GUIFRAME_ID.REDO_ID, flag) 1369 self._edit_menu.Enable(GUIFRAME_ID.BOOKMARK_ID, flag) 1370 self._edit_menu.Enable(GUIFRAME_ID.SAVE_ID, flag) 1371 self._edit_menu.Enable(GUIFRAME_ID.PRINT_ID, flag) 1372 self._edit_menu.Enable(GUIFRAME_ID.PREVIEW_ID, flag) 1373 self._edit_menu.Enable(GUIFRAME_ID.ZOOM_ID, flag) 1374 self._edit_menu.Enable(GUIFRAME_ID.ZOOM_IN_ID, flag) 1375 self._edit_menu.Enable(GUIFRAME_ID.ZOOM_OUT_ID, flag) 1376 self._edit_menu.Enable(GUIFRAME_ID.DRAG_ID, flag) 1377 self._edit_menu.Enable(GUIFRAME_ID.RESET_ID, flag) 1378 1317 1379 def on_undo_panel(self, event=None): 1318 1380 """ 1319 1381 undo previous action of the last panel on focus if possible 1320 1382 """ 1383 if self.panel_on_focus is not None: 1384 self.panel_on_focus.on_undo(event) 1385 1321 1386 def on_redo_panel(self, event=None): 1322 1387 """ 1323 1388 redo the last cancel action done on the last panel on focus 1324 1389 """ 1390 if self.panel_on_focus is not None: 1391 self.panel_on_focus.on_redo(event) 1392 1325 1393 def on_bookmark_panel(self, event=None): 1326 1394 """ 1327 1395 Bookmark available information of the panel on focus 1328 1396 """ 1397 if self.panel_on_focus is not None: 1398 self.panel_on_focus.on_bookmark(event) 1399 1329 1400 def on_save_panel(self, event=None): 1330 1401 """ 1331 1402 save possible information on the current panel 1332 1403 """ 1404 if self.panel_on_focus is not None: 1405 self.panel_on_focus.on_save(event) 1406 1333 1407 def on_preview_panel(self, event=None): 1334 1408 """ 1335 1409 preview information on the panel on focus 1336 1410 """ 1411 if self.panel_on_focus is not None: 1412 self.panel_on_focus.on_preview(event) 1413 1337 1414 def on_print_panel(self, event=None): 1338 1415 """ 1339 1416 print available information on the last panel on focus 1340 1417 """ 1418 if self.panel_on_focus is not None: 1419 self.panel_on_focus.on_print(event) 1420 1341 1421 def on_zoom_panel(self, event=None): 1342 1422 """ 1343 1423 zoom on the current panel if possible 1344 1424 """ 1425 if self.panel_on_focus is not None: 1426 self.panel_on_focus.on_zoom(event) 1427 1345 1428 def on_zoom_in_panel(self, event=None): 1346 1429 """ 1347 1430 zoom in of the panel on focus 1348 1431 """ 1432 if self.panel_on_focus is not None: 1433 self.panel_on_focus.on_zoom_in(event) 1434 1349 1435 def on_zoom_out_panel(self, event=None): 1350 1436 """ 1351 1437 zoom out on the panel on focus 1352 1438 """ 1439 if self.panel_on_focus is not None: 1440 self.panel_on_focus.on_zoom_out(event) 1441 1353 1442 def on_drag_panel(self, event=None): 1354 1443 """ 1355 1444 drag apply to the panel on focus 1356 1445 """ 1446 if self.panel_on_focus is not None: 1447 self.panel_on_focus.on_drag(event) 1448 1357 1449 def on_reset_panel(self, event=None): 1358 1450 """ 1359 1451 reset the current panel 1360 1452 """ 1361 1453 if self.panel_on_focus is not None: 1454 self.panel_on_focus.on_reset(event) 1362 1455 1363 1456 class DefaultPanel(wx.Panel, PanelBase): -
guiframe/gui_style.py
rd828481 rf036c692 3 3 Provide the style for guiframe 4 4 """ 5 import wx 5 6 6 7 class GUIFRAME: … … 15 16 DEFAULT_STYLE = SINGLE_APPLICATION|DATALOADER_ON|PLOTTING_ON|FIXED_PANEL 16 17 MULTIPLE_APPLICATIONS = DEFAULT_STYLE|MANAGER_ON|WELCOME_PANEL_ON 18 19 class GUIFRAME_ID: 20 UNDO_ID = wx.NewId() 21 REDO_ID = wx.NewId() 22 BOOKMARK_ID = wx.NewId() 23 SAVE_ID = wx.NewId() 24 ZOOM_IN_ID = wx.NewId() 25 ZOOM_OUT_ID = wx.NewId() 26 ZOOM_ID = wx.NewId() 27 DRAG_ID = wx.NewId() 28 RESET_ID = wx.NewId() 29 PREVIEW_ID = wx.NewId() 30 PRINT_ID = wx.NewId() 31 CURRENT_APPLICATION = wx.NewId() 17 32 18 33 if __name__ == "__main__": -
guiframe/gui_toolbar.py
r010c251 rf036c692 2 2 import wx 3 3 from wx import ToolBar as Tbar 4 from sans.guiframe.gui_style import GUIFRAME_ID 4 5 5 UNDO_ID = wx.NewId()6 REDO_ID = wx.NewId()7 BOOKMARK_ID = wx.NewId()8 SAVE_ID = wx.NewId()9 ZOOM_IN_ID = wx.NewId()10 ZOOM_OUT_ID = wx.NewId()11 ZOOM_ID = wx.NewId()12 DRAG_ID = wx.NewId()13 RESET_ID = wx.NewId()14 PREVIEW_ID = wx.NewId()15 PRINT_ID = wx.NewId()16 CURRENT_APPLICATION = wx.NewId()17 6 18 class ToolBar(Tbar):7 class GUIToolBar(Tbar): 19 8 def __init__(self, parent, *args, **kwds): 20 9 Tbar.__init__(self, parent, *args, **kwds) … … 29 18 save_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, 30 19 size=tbar_size) 31 self.AddLabelTool( SAVE_ID, 'Save', save_bmp, shortHelp='Save')20 self.AddLabelTool(GUIFRAME_ID.SAVE_ID, 'Save', save_bmp, shortHelp='Save') 32 21 33 22 bookmark_bmp = wx.ArtProvider.GetBitmap(wx.ART_ADD_BOOKMARK, wx.ART_TOOLBAR, 34 23 size=tbar_size) 35 self.AddLabelTool( BOOKMARK_ID, 'Bookmark', bookmark_bmp,shortHelp='Bookmark')24 self.AddLabelTool(GUIFRAME_ID.BOOKMARK_ID, 'Bookmark', bookmark_bmp,shortHelp='Bookmark') 36 25 37 26 zoom_in_bmp = wx.ArtProvider.GetBitmap(wx.ART_GO_UP, wx.ART_TOOLBAR, 38 27 size=tbar_size) 39 self.AddLabelTool( ZOOM_IN_ID, 'Zoom in', zoom_in_bmp,shortHelp='Zoom in')28 self.AddLabelTool(GUIFRAME_ID.ZOOM_IN_ID, 'Zoom in', zoom_in_bmp,shortHelp='Zoom in') 40 29 41 30 zoom_out_bmp = wx.ArtProvider.GetBitmap(wx.ART_GO_DOWN, wx.ART_TOOLBAR, 42 31 size=tbar_size) 43 self.AddLabelTool( ZOOM_OUT_ID,'Zoom out',zoom_out_bmp,shortHelp='Zoom out')32 self.AddLabelTool(GUIFRAME_ID.ZOOM_OUT_ID,'Zoom out',zoom_out_bmp,shortHelp='Zoom out') 44 33 45 34 zoom_bmp = wx.ArtProvider.GetBitmap(wx.ART_GO_FORWARD, wx.ART_TOOLBAR, 46 35 size=tbar_size) 47 self.AddLabelTool( ZOOM_ID, 'Zoom', zoom_bmp,shortHelp='Zoom')36 self.AddLabelTool(GUIFRAME_ID.ZOOM_ID, 'Zoom', zoom_bmp,shortHelp='Zoom') 48 37 49 38 drag_bmp = wx.ArtProvider.GetBitmap(wx.ART_REMOVABLE, wx.ART_TOOLBAR, 50 39 size=tbar_size) 51 self.AddLabelTool( DRAG_ID, 'Drag', drag_bmp,shortHelp='Drag')40 self.AddLabelTool(GUIFRAME_ID.DRAG_ID, 'Drag', drag_bmp,shortHelp='Drag') 52 41 53 42 preview_bmp = wx.ArtProvider.GetBitmap(wx.ART_REPORT_VIEW, wx.ART_TOOLBAR, 54 43 size=tbar_size) 55 self.AddLabelTool( PREVIEW_ID, 'Preview', preview_bmp,shortHelp='Report')44 self.AddLabelTool(GUIFRAME_ID.PREVIEW_ID, 'Preview', preview_bmp,shortHelp='Report') 56 45 57 46 print_bmp = wx.ArtProvider.GetBitmap(wx.ART_PRINT, wx.ART_TOOLBAR, 58 47 size=tbar_size) 59 self.AddLabelTool( PRINT_ID, 'Print', print_bmp,shortHelp='Print')48 self.AddLabelTool(GUIFRAME_ID.PRINT_ID, 'Print', print_bmp,shortHelp='Print') 60 49 61 50 undo_bmp = wx.ArtProvider.GetBitmap(wx.ART_UNDO, wx.ART_TOOLBAR, 62 51 size=tbar_size) 63 self.AddLabelTool( UNDO_ID, 'Undo', undo_bmp,shortHelp='Undo')52 self.AddLabelTool(GUIFRAME_ID.UNDO_ID, 'Undo', undo_bmp,shortHelp='Undo') 64 53 65 54 66 55 redo_bmp = wx.ArtProvider.GetBitmap(wx.ART_REDO, wx.ART_TOOLBAR, 67 56 size=tbar_size) 68 self.AddLabelTool( REDO_ID, 'Redo', redo_bmp,shortHelp='Redo')57 self.AddLabelTool(GUIFRAME_ID.REDO_ID, 'Redo', redo_bmp,shortHelp='Redo') 69 58 self.button = wx.Button(self, -1, 'Welcome') 70 59 self.button.SetForegroundColour('black') … … 80 69 """ 81 70 if self.parent is not None: 82 self.parent.Bind(wx.EVT_TOOL, self.parent.on_redo_panel,id=REDO_ID) 83 self.parent.Bind(wx.EVT_TOOL, self.parent.on_undo_panel,id=UNDO_ID) 84 self.parent.Bind(wx.EVT_TOOL, self.parent.on_bookmark_panel,id=BOOKMARK_ID) 85 self.parent.Bind(wx.EVT_TOOL, self.parent.on_save_panel,id=SAVE_ID) 86 self.parent.Bind(wx.EVT_TOOL, self.parent.on_zoom_in_panel,id=ZOOM_IN_ID) 87 self.parent.Bind(wx.EVT_TOOL, self.parent.on_zoom_out_panel,id=ZOOM_OUT_ID) 88 self.parent.Bind(wx.EVT_TOOL, self.parent.on_zoom_panel,id=ZOOM_ID) 89 self.parent.Bind(wx.EVT_TOOL, self.parent.on_drag_panel,id=DRAG_ID) 90 self.parent.Bind(wx.EVT_TOOL, self.parent.on_reset_panel,id=RESET_ID) 91 self.parent.Bind(wx.EVT_TOOL, self.parent.on_preview_panel,id=PREVIEW_ID) 92 self.parent.Bind(wx.EVT_TOOL, self.parent.on_print_panel,id=PRINT_ID) 71 self.parent.Bind(wx.EVT_TOOL, self.parent.on_redo_panel, 72 id=GUIFRAME_ID.REDO_ID) 73 self.parent.Bind(wx.EVT_TOOL, self.parent.on_undo_panel, 74 id=GUIFRAME_ID.UNDO_ID) 75 self.parent.Bind(wx.EVT_TOOL, self.parent.on_bookmark_panel, 76 id=GUIFRAME_ID.BOOKMARK_ID) 77 self.parent.Bind(wx.EVT_TOOL, self.parent.on_save_panel, 78 id=GUIFRAME_ID.SAVE_ID) 79 self.parent.Bind(wx.EVT_TOOL, self.parent.on_zoom_in_panel, 80 id=GUIFRAME_ID.ZOOM_IN_ID) 81 self.parent.Bind(wx.EVT_TOOL, self.parent.on_zoom_out_panel, 82 id=GUIFRAME_ID.ZOOM_OUT_ID) 83 self.parent.Bind(wx.EVT_TOOL, self.parent.on_zoom_panel, 84 id=GUIFRAME_ID.ZOOM_ID) 85 self.parent.Bind(wx.EVT_TOOL, self.parent.on_drag_panel, 86 id=GUIFRAME_ID.DRAG_ID) 87 self.parent.Bind(wx.EVT_TOOL, self.parent.on_reset_panel, 88 id=GUIFRAME_ID.RESET_ID) 89 self.parent.Bind(wx.EVT_TOOL, self.parent.on_preview_panel, 90 id=GUIFRAME_ID.PREVIEW_ID) 91 self.parent.Bind(wx.EVT_TOOL, self.parent.on_print_panel, 92 id=GUIFRAME_ID.PRINT_ID) 93 93 94 95 def set_active_perspective(self, name='Welcome'): 94 def set_active_perspective(self, name=''): 96 95 """ 97 96 """ 98 print "set button"99 97 self.button.SetLabel(str(name)) 100 98 … … 104 102 if panel is None: 105 103 #self.Disable() 106 self.EnableTool( PRINT_ID, False)107 self.EnableTool( UNDO_ID,False)108 self.EnableTool( REDO_ID, False)109 self.EnableTool( ZOOM_ID, False)110 self.EnableTool( ZOOM_IN_ID, False)111 self.EnableTool( ZOOM_OUT_ID, False)112 self.EnableTool( BOOKMARK_ID, False)113 self.EnableTool( PREVIEW_ID, False)114 self.EnableTool( SAVE_ID, False)115 self.EnableTool( DRAG_ID, False)116 self.EnableTool( RESET_ID, False)104 self.EnableTool(GUIFRAME_ID.PRINT_ID, False) 105 self.EnableTool(GUIFRAME_ID.UNDO_ID,False) 106 self.EnableTool(GUIFRAME_ID.REDO_ID, False) 107 self.EnableTool(GUIFRAME_ID.ZOOM_ID, False) 108 self.EnableTool(GUIFRAME_ID.ZOOM_IN_ID, False) 109 self.EnableTool(GUIFRAME_ID.ZOOM_OUT_ID, False) 110 self.EnableTool(GUIFRAME_ID.BOOKMARK_ID, False) 111 self.EnableTool(GUIFRAME_ID.PREVIEW_ID, False) 112 self.EnableTool(GUIFRAME_ID.SAVE_ID, False) 113 self.EnableTool(GUIFRAME_ID.DRAG_ID, False) 114 self.EnableTool(GUIFRAME_ID.RESET_ID, False) 117 115 else: 118 116 self.Enable() 119 self.EnableTool( PRINT_ID, panel.is_print_enabled())120 self.EnableTool( UNDO_ID, panel.is_undo_enabled())121 self.EnableTool( REDO_ID, panel.is_redo_enabled())122 self.EnableTool( ZOOM_ID, panel.is_zoom_enabled())123 self.EnableTool( ZOOM_IN_ID, panel.is_zoom_in_enabled())124 self.EnableTool( ZOOM_OUT_ID, panel.is_zoom_out_enabled())125 self.EnableTool( BOOKMARK_ID, panel.is_bookmark_enabled())126 self.EnableTool( PREVIEW_ID, panel.is_preview_enabled())127 self.EnableTool( SAVE_ID, panel.is_save_enabled())128 self.EnableTool( DRAG_ID, panel.is_drag_enabled())129 self.EnableTool( RESET_ID, panel.is_reset_enabled())117 self.EnableTool(GUIFRAME_ID.PRINT_ID, panel.get_print_flag()) 118 self.EnableTool(GUIFRAME_ID.UNDO_ID, panel.get_undo_flag()) 119 self.EnableTool(GUIFRAME_ID.REDO_ID, panel.get_redo_flag()) 120 self.EnableTool(GUIFRAME_ID.ZOOM_ID, panel.get_zoom_flag()) 121 self.EnableTool(GUIFRAME_ID.ZOOM_IN_ID, panel.get_zoom_in_flag()) 122 self.EnableTool(GUIFRAME_ID.ZOOM_OUT_ID, panel.get_zoom_out_flag()) 123 self.EnableTool(GUIFRAME_ID.BOOKMARK_ID, panel.get_bookmark_flag()) 124 self.EnableTool(GUIFRAME_ID.PREVIEW_ID, panel.get_preview_flag()) 125 self.EnableTool(GUIFRAME_ID.SAVE_ID, panel.get_save_flag()) 126 self.EnableTool(GUIFRAME_ID.DRAG_ID, panel.get_drag_flag()) 127 self.EnableTool(GUIFRAME_ID.RESET_ID, panel.get_reset_flag()) 130 128 131 129 -
guiframe/panel_base.py
r52725d6 rf036c692 43 43 self._reset_flag = False 44 44 45 def set_print_flag(self, flag=True):45 def _set_print_flag(self, flag=True): 46 46 """ 47 47 The derivative class sets the print flag value to indicate that it can … … 56 56 return self._print_flag 57 57 58 def set_undo_flag(self, flag=True):58 def _set_undo_flag(self, flag=True): 59 59 """ 60 60 The derivative class sets the undo flag value to indicate that the … … 69 69 return self._undo_flag 70 70 71 def set_redo_flag(self, flag=True):71 def _set_redo_flag(self, flag=True): 72 72 """ 73 73 The derivative class sets the redo flag value to indicate that the … … 82 82 return self._redo_flag 83 83 84 def set_zoomed_in_flag(self, flag=True):84 def _set_zoomed_in_flag(self, flag=True): 85 85 """ 86 86 The derivative class sets the zoom in flag value to indicate that it … … 95 95 return self._zoom_in_flag 96 96 97 def set_zoomed_out_flag(self, flag=True):97 def _set_zoomed_out_flag(self, flag=True): 98 98 """ 99 99 The derivative class sets the zoom out flag value to indicate that it … … 108 108 return self._zoom_out_flag 109 109 110 def set_zoom_flag(self, flag=True):110 def _set_zoom_flag(self, flag=True): 111 111 """ 112 112 The derivative class sets the zoom flag value to indicate that it … … 121 121 return self._zoom_flag 122 122 123 def set_bookmark_flag(self, flag=True):123 def _set_bookmark_flag(self, flag=True): 124 124 """ 125 125 The derivative class sets the bookmark flag value to indicate that it … … 134 134 return self._bookmark_flag 135 135 136 def set_preview_flag(self, flag=True):136 def _set_preview_flag(self, flag=True): 137 137 """ 138 138 The derivative class sets the preview flag value to indicate that it … … 147 147 return self._preview_flag 148 148 149 def set_save_flag(self, flag=True):149 def _set_save_flag(self, flag=True): 150 150 """ 151 151 The derivative class sets the drag flag value to indicate that it … … 160 160 return self._save_flag 161 161 162 def set_drag_flag(self, flag=True):162 def _set_drag_flag(self, flag=True): 163 163 """ 164 164 The derivative class sets the drag flag value to indicate that … … 173 173 return self._drag_flag 174 174 175 def set_reset_flag(self, flag=True):175 def _set_reset_flag(self, flag=True): 176 176 """ 177 177 The derivative class sets the reset flag value to indicate that it
Note: See TracChangeset
for help on using the changeset viewer.