- Timestamp:
- Apr 15, 2009 6:02:09 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:
- d7e391e
- Parents:
- 875f1a2
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r60132ef r298b762 1029 1029 param_max= None 1030 1030 if item[5]!= None: 1031 if format_number(item[5].GetValue())!="NaN":1031 if item[5].GetValue().lstrip().rstrip()!="": 1032 1032 param_min = float(item[5].GetValue()) 1033 1033 1034 1034 ## check maximum value 1035 1035 if item[6]!= None: 1036 if format_number(item[6].GetValue())!="NaN":1036 if item[6].GetValue().lstrip().rstrip()!="": 1037 1037 param_max = float(item[6].GetValue()) 1038 1038 -
sansview/perspectives/fitting/fitpage.py
r875f1a2 r298b762 461 461 wx.PostEvent(self.event_owner, evt) 462 462 463 463 464 def _onparamRangeEnter(self, event): 465 """ 466 Check validity of value enter in the parameters range field 467 """ 468 tcrtl= event.GetEventObject() 469 if tcrtl.GetValue().lstrip().rstrip()!="": 470 try: 471 value = float(tcrtl.GetValue()) 472 tcrtl.SetBackgroundColour(wx.WHITE) 473 tcrtl.Refresh() 474 except: 475 tcrtl.SetBackgroundColour("pink") 476 tcrtl.Refresh() 477 else: 478 tcrtl.SetBackgroundColour(wx.WHITE) 479 tcrtl.Refresh() 480 self._onparamEnter_helper() 481 464 482 def _onparamEnter(self,event): 465 483 """ … … 858 876 ix += 1 859 877 ctl3 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 860 ctl3.SetValue(str(param_min)) 878 if param_min ==None: 879 ctl3.SetValue("") 880 else: 881 ctl3.SetValue(str(param_min)) 861 882 ctl3.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 862 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparam Enter)863 ctl3.Bind(wx.EVT_TEXT_ENTER,self._onparam Enter)883 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparamRangeEnter) 884 ctl3.Bind(wx.EVT_TEXT_ENTER,self._onparamRangeEnter) 864 885 sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 865 886 ctl3.Hide() … … 868 889 ctl4 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 869 890 ctl4.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 870 ctl4.Bind(wx.EVT_KILL_FOCUS, self._onparam Enter)871 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparam Enter)891 ctl4.Bind(wx.EVT_KILL_FOCUS, self._onparamRangeEnter) 892 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparamRangeEnter) 872 893 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 873 ctl4.SetValue(str(param_max)) 894 if param_max==None: 895 ctl4.SetValue("") 896 else: 897 ctl4.SetValue(str(param_max)) 874 898 ctl4.Hide() 875 899 … … 939 963 ix += 1 940 964 ctl3 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 941 ctl3.SetValue(str(param_min)) 965 if param_min ==None: 966 ctl3.SetValue("") 967 else: 968 ctl3.SetValue(str(param_min)) 942 969 ctl3.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 943 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparam Enter)944 ctl3.Bind(wx.EVT_TEXT_ENTER,self._onparam Enter)970 ctl3.Bind(wx.EVT_KILL_FOCUS, self._onparamRangeEnter) 971 ctl3.Bind(wx.EVT_TEXT_ENTER,self._onparamRangeEnter) 945 972 sizer.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 946 973 ctl3.Hide() … … 949 976 else: 950 977 ctl3.Disable() 951 952 978 ix += 1 953 979 ctl4 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER) 954 980 ctl4.Bind(wx.EVT_SET_FOCUS, self.onSetFocus) 955 ctl4.Bind(wx.EVT_KILL_FOCUS, self._onparam Enter)956 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparam Enter)981 ctl4.Bind(wx.EVT_KILL_FOCUS, self._onparamRangeEnter) 982 ctl4.Bind(wx.EVT_TEXT_ENTER,self._onparamRangeEnter) 957 983 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0) 958 984 ctl4.SetValue(str(param_max))
Note: See TracChangeset
for help on using the changeset viewer.