Changeset dc51a7f in sasview for sansguiframe/src


Ignore:
Timestamp:
Sep 2, 2011 2:54:20 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
37c36d9
Parents:
49ad00b
Message:

added an access to the plotpanel contextmenu from toobar

Location:
sansguiframe/src/sans/guiframe/local_perspectives/plotting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py

    r7022fdc rdc51a7f  
    460460        self._slicerpop.Append(id, '&Reset Graph') 
    461461        wx.EVT_MENU(self, id, self.onResetGraph)   
    462         pos = event.GetPosition() 
    463         pos = self.ScreenToClient(pos) 
     462        try: 
     463            pos_evt = event.GetPosition() 
     464            pos = self.ScreenToClient(pos_evt) 
     465        except: 
     466            pos_x, pos_y = self.toolbar.GetPositionTuple() 
     467            pos = (pos_x, pos_y + 5) 
     468 
    464469        self.PopupMenu(self._slicerpop, pos) 
    465       
     470         
    466471    def onFreeze(self, event): 
    467472        """ 
     
    658663        self.toolbar.Realize() 
    659664        wx.EVT_TOOL(self, id_delete,  self._on_delete) 
    660         """ 
    661         #New toolbar option - adding text to the plot 
    662         self.toolbar.AddSeparator() 
    663         id_text = wx.NewId() 
    664         text =  wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR) 
    665         self.toolbar.AddSimpleTool(id_text, text, 
    666                            'Add Text to Plot', 'Adds text to plot') 
    667  
    668         self.toolbar.Realize() 
    669         wx.EVT_TOOL(self, id_text,  self._on_addtext) 
    670          
     665         
     666        """ 
    671667        self.toolbar.AddSeparator() 
    672668        id_text = wx.NewId() 
  • sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py

    r7022fdc rdc51a7f  
    6262        add item to the toolbar 
    6363        """ 
     64        #add button 
     65        id_context = wx.NewId() 
     66        context_tip = 'Graph Menu' 
     67        context =  wx.ArtProvider.GetBitmap(wx.ART_LIST_VIEW, wx.ART_TOOLBAR) 
     68        self.InsertSimpleTool(0, id_context, context,  
     69                                   context_tip, context_tip) 
     70        wx.EVT_TOOL(self, id_context,  self.parent.onToolContextMenu) 
     71        self.InsertSeparator(1) 
    6472        #add print button 
    6573        id_print = wx.NewId() 
     
    355363             
    356364        id = wx.NewId() 
    357         slicerpop.Append(id, '&Edit Label', 'Edit Label') 
     365        slicerpop.Append(id, '&Edit Graph Label', 'Edit Graph Label') 
    358366        wx.EVT_MENU(self, id, self.onEditLabels) 
    359367        slicerpop.AppendSeparator() 
     
    375383        slicerpop.Append(id, '&Toggle Linear/Log Scale') 
    376384        wx.EVT_MENU(self, id, self._onToggleScale)  
    377         pos = event.GetPosition() 
    378         pos = self.ScreenToClient(pos) 
     385        try: 
     386            pos_evt = event.GetPosition() 
     387            pos = self.ScreenToClient(pos_evt) 
     388        except: 
     389            pos_x, pos_y = self.toolbar.GetPositionTuple() 
     390            pos = (pos_x, pos_y + 5) 
    379391        self.PopupMenu(slicerpop, pos) 
    380392             
Note: See TracChangeset for help on using the changeset viewer.