Changeset 31482fc in sasview for guiframe


Ignore:
Timestamp:
Apr 20, 2009 9:50:58 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
bf5bfc0
Parents:
6fb01b6
Message:

hide and show error bar previous status remembered

Location:
guiframe/local_perspectives/plotting
Files:
2 edited

Legend:

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

    r6063b16 r31482fc  
    1212import wx 
    1313import sys, os 
    14 import pylab, time 
     14import pylab, time,numpy 
    1515 
    1616import danse.common.plottools 
     
    6060        ## flag to determine if the hide or show context menu item should 
    6161        ## be displayed 
    62         self.errors_hide=0 
     62        self.errors_hide=False 
    6363        ## Unique ID (from gui_manager) 
    6464        self.uid = None 
     
    125125            if hasattr(event.plot, 'dx') and hasattr(self.plots[event.plot.name], 'dx'): 
    126126                self.plots[event.plot.name].dx = event.plot.dx     
    127   
     127           
    128128        #TODO: Should re-factor this 
    129129        ## for all added plot the option to hide error show be displayed first 
    130         self.errors_hide = 0 
     130        #self.errors_hide = 0 
    131131        ## Set axis labels 
    132132        self.graph.xaxis(event.plot._xaxis, event.plot._xunit) 
     
    137137        self.graph.render(self) 
    138138        self.subplot.figure.canvas.draw_idle() 
    139          
    140          
     139        if self.errors_hide: 
     140            self._on_remove_errors(evt=None) 
     141        else: 
     142            self._on_add_errors( evt=None) 
     143        return 
     144     
    141145    def onLeftDown(self,event):  
    142146        """  
     
    209213            self.action_ids[str(id)] = plot 
    210214            wx.EVT_MENU(self, id, self._onSave) 
    211             #wx.EVT_MENU(self, id, self._onSaveXML) 
    212             
     215           
    213216            id = wx.NewId() 
    214217            slicerpop.Append(id, "Remove %s curve" % name) 
     
    221224        if self.graph.selected_plottable in self.plots: 
    222225            if self.plots[self.graph.selected_plottable].name in self.err_dy.iterkeys()\ 
    223                 and self.errors_hide==1: 
     226                and self.errors_hide: 
    224227                 
    225228                id = wx.NewId() 
     
    228231                 
    229232            elif self.plots[self.graph.selected_plottable].__class__.__name__=="Data1D"\ 
    230                 and self.errors_hide==0: 
    231                     
     233                and not self.errors_hide: 
    232234                    id = wx.NewId() 
    233235                    slicerpop.Append(id, '&Hide Error bars') 
     
    274276                              dy=dy) 
    275277            new_plot.interactive = True 
    276             self.errors_hide = 1 
     278            self.errors_hide = True 
    277279            new_plot.name = self.plots[self.graph.selected_plottable].name  
    278280            if hasattr(self.plots[self.graph.selected_plottable], "group_id"): 
     
    317319        if not self.graph.selected_plottable == None: 
    318320            ##Reset the flag to display the hide option on the context menu 
    319             self.errors_hide = 0 
     321            self.errors_hide = False 
    320322            ## restore dy  
    321323            length = len(self.plots[self.graph.selected_plottable].x) 
  • guiframe/local_perspectives/plotting/plotting.py

    r7fff5cd r31482fc  
    114114                    # Check that the plot panel has no group ID 
    115115                    ## Use a panel with group_id ==None to plot 
     116                     
    116117                    if panel.group_id==None: 
    117118                        is_available = True 
Note: See TracChangeset for help on using the changeset viewer.