Changeset 6e75ed0 in sasview for sansguiframe/src/sans/guiframe/local_perspectives/plotting
- 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
- Location:
- sansguiframe/src/sans/guiframe/local_perspectives/plotting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.