Changeset 6fc9a2a in sasview for guiframe


Ignore:
Timestamp:
Aug 7, 2008 10:49:45 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
c594365
Parents:
a9dec92
Message:

Added menu item to remove a plottable from a graph

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guiframe/local_perspectives/plotting/plotting.py

    r43723aa r6fc9a2a  
    125125            wx.PostEvent(self.parent, StatusEvent(status=position)) 
    126126 
     127    def _onRemove(self, event): 
     128        """ 
     129        """ 
     130        if not self.graph.selected_plottable == None: 
     131            print self.graph.selected_plottable 
     132             
     133             
     134            self.graph.delete(self.plots[self.graph.selected_plottable]) 
     135            del self.plots[self.graph.selected_plottable] 
     136            self.graph.render(self) 
     137            self.subplot.figure.canvas.draw_idle()     
     138             
     139             
    127140 
    128141    def onContextMenu(self, event): 
     
    146159            self.action_ids[str(id)] = plot 
    147160            wx.EVT_MENU(self, id, self._onSave) 
     161                 
     162            # Option to delete plottable 
     163            id = wx.NewId() 
     164            slicerpop.Append(id, "Remove %s curve" % name) 
     165            self.action_ids[str(id)] = plot 
     166            wx.EVT_MENU(self, id, self._onRemove) 
     167             
     168            # Option to hide 
     169            #TODO: implement functionality to hide a plottable (legend click) 
     170            slicerpop.AppendSeparator() 
    148171                 
    149172        # Various plot options 
Note: See TracChangeset for help on using the changeset viewer.