Changeset 6e75ed0 in sasview
- Timestamp:
- Apr 23, 2012 10:00:49 AM (13 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:
- 2ee5c61
- Parents:
- 3553ad2
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
plottools/src/danse/common/plottools/PlotPanel.py
rebbc421 r6e75ed0 595 595 ax.set_ylim((lo,hi)) 596 596 else: 597 597 # Check if zoom happens in the axes 598 598 xdata, ydata = None, None 599 599 x, y = event.x, event.y -
sansguiframe/src/sans/guiframe/gui_manager.py
r5cc6d20 r6e75ed0 427 427 if count >= 2: 428 428 column_names_line = line 429 first_data_index = index430 429 break 431 430 … … 460 459 fd.write(str(details)) 461 460 for col_name in data.keys(): 462 463 461 fd.write(str(col_name)) 462 fd.write(separator) 464 463 fd.write('\n') 465 464 max_list = [len(value) for value in data.values()] … … 904 903 # Show a default panel with some help information 905 904 # It also sets the size of the application windows 906 #TODO: Use this for s lpash screen905 #TODO: Use this for splash screen 907 906 if self.defaultPanel is None: 908 907 self.defaultPanel = DefaultPanel(self, -1, style=wx.RAISED_BORDER) … … 1028 1027 return menu_list 1029 1028 1029 1030 def on_panel_close(self, event): 1031 """ 1032 Gets called when the close event for a panel runs. 1033 This will check which panel has been closed and 1034 delete it. 1035 """ 1036 panel = event.GetPane() 1037 for ID in self.plot_panels.keys(): 1038 if self.plot_panels[ID].window_name == panel.name: 1039 self.delete_panel(ID) 1040 break 1041 1042 1030 1043 def popup_panel(self, p): 1031 1044 """ … … 1045 1058 windowcaption = 'Graph'#p.window_caption 1046 1059 windowname = p.window_name 1047 """ 1048 count = 0 1049 for item in self.panels: 1050 if self.panels[item].window_name.startswith(p.window_name)\ 1051 or self._mgr.GetPane(p.window_name).IsOk(): 1052 count += 1 1053 1054 if count > 0: 1055 windowname += str(count+1) 1056 """ 1060 1057 1061 # Append nummber 1058 1062 captions = self._get_plotpanel_captions() … … 1067 1071 if p.window_caption.split()[0] not in NOT_SO_GRAPH_LIST: 1068 1072 p.window_caption = caption 1069 #p.window_caption = windowcaption+ str(self.graph_num)1070 1073 p.window_name = windowname + str(self.graph_num) 1071 1074 … … 1100 1103 1101 1104 self._popup_floating_panel(p) 1102 1105 1106 # Register for closing of panels 1107 self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_panel_close) 1103 1108 # Register for showing/hiding the panel 1104 1109 wx.EVT_MENU(self, ID, self.on_view) … … 1475 1480 """ 1476 1481 1477 1482 # File menu 1478 1483 self._file_menu = wx.Menu() 1479 1484 #append item from plugin under menu file if necessary … … 1742 1747 if self._mgr.GetPane(self.panels[ID].window_name).IsShown(): 1743 1748 self._mgr.GetPane(self.panels[ID].window_name).Hide() 1749 item = self._plotting_plugin.menu.FindItemById(uid) 1750 item.Check(False) 1744 1751 if self._data_panel is not None and \ 1745 1752 ID in self.plot_panels.keys(): … … 1769 1776 panel.Close() 1770 1777 if panel in self.schedule_full_draw_list: 1771 self.schedule_full_draw_list.remove(panel)1778 self.schedule_full_draw_list.remove(panel) 1772 1779 1773 1780 #delete uid number not str(uid) … … 1839 1846 path = os.path.abspath(path) 1840 1847 if not os.path.isfile(path) and not os.path.isdir(path): 1841 return1848 return 1842 1849 1843 1850 if os.path.isdir(path): … … 2054 2061 logging.error(msg) 2055 2062 except: 2056 msg = "Error occurred while saving: "2057 msg += "To save, at leat one application panel "2058 msg += "should have a data set.."2059 wx.PostEvent(self, StatusEvent(status=msg))2063 msg = "Error occurred while saving: " 2064 msg += "To save, at leat one application panel " 2065 msg += "should have a data set.." 2066 wx.PostEvent(self, StatusEvent(status=msg)) 2060 2067 2061 2068 def on_save_helper(self, doc, reader, panel, path): … … 3497 3504 app = ViewApp(0) 3498 3505 app.MainLoop() 3499 3500 -
sansguiframe/src/sans/guiframe/gui_style.py
r07dd0b4 r6e75ed0 54 54 PREVIEW_ID_PATH = os.path.join(PATH, 'report.png') 55 55 PRINT_ID_PATH = os.path.join(PATH, 'printer.png') 56 HIDE_ID_PATH = os.path.join(PATH, 'hide.png') 56 57 57 58 … … 70 71 PREVIEW_ICON = wx.Image(os.path.join(PATH, 'preview.png')) 71 72 PRINT_ICON = wx.Image(os.path.join(PATH, 'printer.png')) 73 HIDE_ICON = wx.Image(os.path.join(PATH, 'hide.png')) 72 74 73 75 if __name__ == "__main__": … … 83 85 print style1 == GUIFRAME.DEFAULT_STYLE 84 86 print style1 85 86 87 -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
r7fb69f26 r6e75ed0 34 34 from sans.guiframe.dataFitting import Data1D 35 35 from sans.guiframe.panel_base import PanelBase 36 from sans.guiframe.gui_style import GUIFRAME_ICON 36 37 from binder import BindArtist 37 38 … … 93 94 self.Bind(wx.EVT_SIZE, self._OnReSize) 94 95 self._add_more_tool() 95 self.parent.SetFocus() 96 self.parent.SetFocus() 97 96 98 97 99 def get_symbol_label(self): … … 682 684 def _add_more_tool(self): 683 685 """ 684 Add refresh, add/ delete button in the tool bar686 Add refresh, add/hide button in the tool bar 685 687 """ 686 688 if self.parent.__class__.__name__ != 'ViewerFrame': … … 688 690 self.toolbar.AddSeparator() 689 691 id_delete = wx.NewId() 690 delete = wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_TOOLBAR) 691 self.toolbar.AddSimpleTool(id_delete, delete, 692 'Delete', 'permanently Delete') 693 692 delete = wx.Bitmap(GUIFRAME_ICON.HIDE_ID_PATH, wx.BITMAP_TYPE_PNG) 693 self.toolbar.AddSimpleTool(id_delete, delete, 'Hide', 'Hide') 694 694 self.toolbar.Realize() 695 wx.EVT_TOOL(self, id_delete, self._on_ delete)695 wx.EVT_TOOL(self, id_delete, self._on_hide) 696 696 697 697 """ … … 705 705 wx.EVT_TOOL(self, id_text, self._on_removetext) 706 706 """ 707 def _on_delete(self, event):708 """709 Refreshes the plotpanel on refresh tollbar button710 """711 707 708 def _on_hide(self, event): 709 """ 710 Hides the plot when button is pressed 711 """ 712 712 if self.parent is not None: 713 wx.PostEvent(self.parent, 714 NewPlotEvent(group_id=self.group_id, 715 action="delete")) 716 717 713 self.parent.hide_panel(self.uid) 714 715 -
sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py
rcdf515f r6e75ed0 144 144 """ 145 145 """ 146 146 ## Set group ID if available 147 147 ## Assign data properties to the new create panel 148 148 new_panel.set_manager(self) … … 174 174 self.menu.Check(event_id, IS_WIN) 175 175 wx.EVT_MENU(self.parent, event_id, self._on_check_menu) 176 177 wx.EVT_SHOW(new_panel, self._on_close_panel)178 176 179 177 … … 309 307 new_panel = self.create_2d_panel(data, group_id) 310 308 self.create_panel_helper(new_panel, data, group_id, title) 311 309 312 310 return 313 311 … … 340 338 pass 341 339 frame.Show(True) 342 343 def _on_close_panel(self, event):344 """345 Update check mark on panel's show and hide event346 """347 event.Skip()348 panel = event.GetEventObject()349 id = panel.uid350 if event.GetShow() and self.parent._mgr.GetPane(panel).IsShown():351 try:352 if self.menu.FindItemById(id) != None:353 if not self.menu.IsChecked(id):354 self.menu.Check(id, True)355 #self.menu.Enable(id, False)356 except:357 # when no such item; may happens after delete358 pass359 else:360 try:361 if self.menu.FindItemById(id) != None:362 if self.menu.IsChecked(id):363 self.menu.Check(id, False)364 #self.menu.Enable(id, True)365 except:366 pass
Note: See TracChangeset
for help on using the changeset viewer.