Changeset 54cc36a in sasview for guiframe/local_perspectives/plotting/slicerpanel.py
- Timestamp:
- Jan 21, 2009 6:43:48 PM (16 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:
- fe060f7
- Parents:
- 32673ac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/slicerpanel.py
raa1b747 r54cc36a 20 20 CENTER_PANE = False 21 21 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 25 26 self.parent = parent 26 self.type = None27 self.type = type 27 28 self.listeners = [] 28 29 self.parameters = [] 29 30 self.bck = wx.GridBagSizer(5,5) 30 31 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) 35 37 # Bindings 38 #self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 36 39 self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 37 40 self.parent.Bind(EVT_SLICER_PARS, self.onParamChange) … … 44 47 @param event: EVT_SLICER event 45 48 """ 49 print "went here panel" 46 50 event.Skip() 47 51 if event.obj_class==None: … … 58 62 self.bck.Clear(True) 59 63 self.type = type 60 64 print "in set slicer", type, params 61 65 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) 64 68 65 #else:69 else: 66 70 title = wx.StaticText(self, -1, "Slicer Parameters", style=wx.ALIGN_LEFT) 67 71 self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) … … 91 95 self.bck.Fit(self) 92 96 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 93 106 94 def o nParamChange(self, evt):107 def old_onParamChange(self, evt): 95 108 evt.Skip() 96 109 if evt.type == "UPDATE":
Note: See TracChangeset
for help on using the changeset viewer.