Changeset 12aa9b5 in sasview for guiframe/local_perspectives/plotting/slicerpanel.py
- Timestamp:
- Mar 5, 2009 11:46:57 AM (15 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:
- 07a93a1
- Parents:
- 6c0568b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/slicerpanel.py
rd468daa r12aa9b5 24 24 def __init__(self, parent,id=-1,type=None,base=None, params={}, *args, **kwargs): 25 25 wx.Panel.__init__(self, parent,id, *args, **kwargs) 26 # print "panel created", base26 ## Initialization of the class 27 27 self.base= base 28 28 self.params = params … … 39 39 else: 40 40 self.set_slicer( type, params) 41 # Bindings 42 #self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 41 ## Bindings 43 42 self.parent.Bind(EVT_SLICER, self.onEVT_SLICER) 44 43 self.parent.Bind(EVT_SLICER_PARS, self.onParamChange) 44 45 45 46 46 def onEVT_SLICER(self, event): … … 48 48 Process EVT_SLICER events 49 49 When the slicer changes, update the panel 50 51 50 @param event: EVT_SLICER event 52 51 """ 53 #print "went here panel"54 52 event.Skip() 55 53 if event.obj_class==None: 56 self.set_slicer(None, None) 57 54 self.set_slicer(None, None) 58 55 else: 59 #print "when here not empty event",event.type, event.params60 56 self.set_slicer(event.type, event.params) 57 61 58 62 59 def set_slicer(self, type, params): … … 66 63 self.bck.Clear(True) 67 64 self.type = type 68 #print "in set slicer", type, params69 65 if type==None: 70 66 title = wx.StaticText(self, -1, "Right-click on 2D plot for slicer options", style=wx.ALIGN_LEFT) 71 67 self.bck.Add(title, (0,0), (1,2), flag=wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border=15) 72 73 68 else: 74 69 title = wx.StaticText(self, -1, "Slicer Parameters", style=wx.ALIGN_LEFT) … … 77 72 n = 1 78 73 self.parameters = [] 79 #params = slicer.get_params()80 74 keys = params.keys() 81 75 keys.sort() … … 89 83 ctl.SetToolTipString("Modify the value of %s to change the 2D slicer" % item) 90 84 ctl.SetValue(str(format_number(params[item]))) 91 #ctl.Disable() 85 92 86 self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter) 93 87 ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter) … … 96 90 for item in keys: 97 91 if item.lower() in ["errors", "count"]: 98 #print "went here"99 92 n += 1 100 93 text = wx.StaticText(self, -1, item+": ", style=wx.ALIGN_LEFT) … … 104 97 self.bck.Add(ctl, (n-1,1), flag=wx.TOP|wx.BOTTOM, border = 0) 105 98 106 107 99 self.bck.Layout() 108 100 self.bck.Fit(self) 109 101 self.parent.GetSizer().Layout() 102 103 110 104 def onParamChange(self, evt): 111 #print "parameters changed" 105 """ 106 Receive and event and reset the text field contained in self.parameters 107 108 """ 112 109 evt.Skip() 113 #if evt.type == "UPDATE":114 110 for item in self.parameters: 115 111 if item[0] in evt.params: … … 137 133 if has_error==False: 138 134 # Post parameter event 139 # print "post new param"135 ## base is guiframe is this case 140 136 event = SlicerParameterEvent(type=self.type, params=params) 141 137 wx.PostEvent(self.base, event) 142 #print "panel slicer: self base ", self.base138 143 139
Note: See TracChangeset
for help on using the changeset viewer.