Changeset 12aa9b5 in sasview for guiframe/local_perspectives
- Timestamp:
- Mar 5, 2009 1:46:57 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:
- 07a93a1
- Parents:
- 6c0568b
- Location:
- guiframe/local_perspectives/plotting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/SlicerParameters.py
rd468daa r12aa9b5 19 19 def __init__(self, parent, *args, **kwargs): 20 20 wx.Dialog.__init__(self, parent, *args, **kwargs) 21 """ 22 Dialog window that allow to edit parameters slicer 23 by entering new values 24 """ 21 25 self.params = {} 22 26 self.parent = parent … … 41 45 @param event: EVT_SLICER event 42 46 """ 43 #print "went here"44 47 event.Skip() 45 48 if event.obj_class==None: … … 65 68 iy = 0 66 69 self.parameters = [] 67 #params = slicer.get_params()68 70 keys = params.keys() 69 71 keys.sort() … … 75 77 76 78 text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT) 77 #self.bck.Add(text, (iy,ix), flag = wx.LEFT|wx.ALIGN_CENTER_VERTICAL, border = 15)78 79 self.bck.Add(text, (iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 79 80 ctl = wx.TextCtrl(self, -1, size=(80,20), style=wx.TE_PROCESS_ENTER) … … 86 87 ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter) 87 88 self.parameters.append([item, ctl]) 88 #self.bck.Add(ctl, (iy,ix), flag=wx.TOP|wx.BOTTOM, border = 0)89 89 self.bck.Add(ctl, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 90 90 … … 105 105 106 106 def onParamChange(self, evt): 107 """ 108 receive an event end reset value text fields 109 inside self.parameters 110 """ 107 111 evt.Skip() 108 112 if evt.type == "UPDATE": … … 131 135 if has_error==False: 132 136 # Post parameter event 137 ##parent hier is plotter2D 133 138 event = SlicerParameterEvent(type=self.type, params=params) 134 139 wx.PostEvent(self.parent, event) -
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.