Ignore:
Timestamp:
Jan 21, 2009 6:43:48 PM (16 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:
fe060f7
Parents:
32673ac
Message:

working on boxsum

File:
1 edited

Legend:

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

    raa1b747 r54cc36a  
    2020    CENTER_PANE = False 
    2121     
    22     def __init__(self, parent, *args, **kwargs): 
    23         wx.Panel.__init__(self, parent, *args, **kwargs) 
    24         self.params = {} 
     22    def __init__(self, parent,id=-1,type=None, params={}, *args, **kwargs): 
     23        wx.Panel.__init__(self, parent,id, *args, **kwargs) 
     24        print "panel created" 
     25        self.params = params 
    2526        self.parent = parent 
    26         self.type = None 
     27        self.type = type 
    2728        self.listeners = [] 
    2829        self.parameters = [] 
    2930        self.bck = wx.GridBagSizer(5,5) 
    3031        self.SetSizer(self.bck) 
    31                 
    32         title = wx.StaticText(self, -1, "Right-click on 2D plot for slicer options", style=wx.ALIGN_LEFT) 
    33         self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
    34          
     32        if type==None and params==None:       
     33            title = wx.StaticText(self, -1, "Right-click on 2D plot for slicer options", style=wx.ALIGN_LEFT) 
     34            self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
     35        else: 
     36            self.set_slicer( type, params) 
    3537        # Bindings 
     38        #self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 
    3639        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 
    3740        self.parent.Bind(EVT_SLICER_PARS, self.onParamChange) 
     
    4447            @param event: EVT_SLICER event 
    4548        """ 
     49        print "went here panel" 
    4650        event.Skip() 
    4751        if event.obj_class==None: 
     
    5862        self.bck.Clear(True)   
    5963        self.type = type   
    60          
     64        print "in set slicer", type, params 
    6165        if type==None: 
    62             #title = wx.StaticText(self, -1, "Right-click on 2D plot for slicer options", style=wx.ALIGN_LEFT) 
    63             #self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
     66            title = wx.StaticText(self, -1, "Right-click on 2D plot for slicer options", style=wx.ALIGN_LEFT) 
     67            self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
    6468 
    65         #else: 
     69        else: 
    6670            title = wx.StaticText(self, -1, "Slicer Parameters", style=wx.ALIGN_LEFT) 
    6771            self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 
     
    9195        self.bck.Fit(self) 
    9296        self.parent.GetSizer().Layout() 
     97    def onParamChange(self, evt): 
     98        print "parameters changed" 
     99        evt.Skip() 
     100        #if evt.type == "UPDATE": 
     101        for item in self.parameters:               
     102            if item[0] in evt.params: 
     103                item[1].SetValue("%-5.3g" %evt.params[item[0]]) 
     104                item[1].Refresh() 
     105         
    93106 
    94     def onParamChange(self, evt): 
     107    def old_onParamChange(self, evt): 
    95108        evt.Skip() 
    96109        if evt.type == "UPDATE": 
Note: See TracChangeset for help on using the changeset viewer.