- Timestamp:
- Oct 21, 2009 5:46:36 PM (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:
- 40d4b09
- Parents:
- 81bece4
- Location:
- sansview/perspectives/fitting
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/basepage.py
r156a0b2 racd0bda3 944 944 is_modified =self._check_value_enter( self.fittable_param ,is_modified) 945 945 is_modified =self._check_value_enter( self.fixed_param ,is_modified) 946 is_modified =self._check_value_enter( self.parameters ,is_modified) 947 948 self.sizer3.Layout() 949 self.Layout() 950 self.Refresh() 946 is_modified =self._check_value_enter( self.parameters ,is_modified) 947 948 if is_modified: 949 self.sizer3.Layout() 950 self.Layout() 951 self.Refresh() 951 952 # Here we should check whether the boundaries have been modified. 952 953 # If qmin and qmax have been modified, update qmin and qmax and … … 979 980 self.save_current_state() 980 981 981 982 self._is_modified(is_modified = is_modified) 983 984 def _is_modified(self, is_modified = False): 985 """ 986 return to self._is_modified 987 """ 988 self.is_modified = is_modified 989 return self.is_modified 990 982 991 def _reset_parameters_state(self, listtorestore,statelist): 983 992 """ … … 1218 1227 ##For MAC, this should defined here. 1219 1228 if box_sizer == None: 1220 1221 1229 box_description= wx.StaticBox(self, -1,str(title)) 1230 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 1222 1231 else: 1223 1232 boxsizer1 = box_sizer … … 1766 1775 #-------------------------------------------------------------- 1767 1776 if box_sizer == None: 1768 1769 1777 box_description= wx.StaticBox(self, -1,str(title)) 1778 boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 1770 1779 else: 1771 1780 #for MAC 1772 1781 boxsizer1 = box_sizer 1773 1782 1774 self.qmin = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20) )1783 self.qmin = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20),style=wx.TE_PROCESS_ENTER) 1775 1784 self.qmin.SetValue(str(self.qmin_x)) 1776 1785 self.qmin.SetToolTipString("Minimun value of Q in linear scale.") … … 1779 1788 #self.qmin.Bind(wx.EVT_TEXT_ENTER, self._onparamEnter) 1780 1789 1781 self.qmax = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20) )1790 self.qmax = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20),style=wx.TE_PROCESS_ENTER) 1782 1791 self.qmax.SetValue(str(self.qmax_x)) 1783 1792 self.qmax.SetToolTipString("Maximum value of Q in linear scale.") -
sansview/perspectives/fitting/fitpage.py
re3a76c8 racd0bda3 595 595 from sans.guiframe.utils import check_value 596 596 flag = check_value( self.qmin, self.qmax) 597 597 598 598 if not flag: 599 599 msg= "Fitting range invalid" … … 605 605 wx.PostEvent(self.parent.parent, StatusEvent(status= msg )) 606 606 return 607 608 607 609 608 610 # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0]. … … 692 694 tcrtl= event.GetEventObject() 693 695 if tcrtl.GetValue().lstrip().rstrip()!="": 696 694 697 try: 695 698 value = float(tcrtl.GetValue()) … … 705 708 self._onparamEnter_helper() 706 709 707 ##compute chisqr for range change 708 temp_smearer = None 709 if self.enable_smearer.GetValue(): 710 msg="" 711 temp_smearer= self.smearer 712 ##Calculate chi2 713 714 self.compute_chisqr(smearer= temp_smearer) 715 ## new state posted 716 if self.state_change: 717 #self._undo.Enable(True) 718 event = PageInfoEvent(page = self) 719 wx.PostEvent(self.parent, event) 720 self.state_change= False 721 722 723 def _onparamEnter(self,event): 724 """ 725 when enter value on panel redraw model according to changed 726 """ 727 tcrtl= event.GetEventObject() 728 729 if check_float(tcrtl): 730 self._onparamEnter_helper() 710 self._is_modified() 711 if self._is_modified == True: 712 ##compute chisqr for range change 731 713 temp_smearer = None 732 714 if self.enable_smearer.GetValue(): 733 temp_smearer= self.smearer 734 735 self.compute_chisqr(smearer= temp_smearer) 715 msg="" 716 temp_smearer= self.smearer 717 ##Calculate chi2 718 719 self.compute_chisqr(smearer= temp_smearer) 736 720 ## new state posted 737 721 if self.state_change: … … 740 724 wx.PostEvent(self.parent, event) 741 725 self.state_change= False 726 727 728 def _onparamEnter(self,event): 729 """ 730 when enter value on panel redraw model according to changed 731 """ 732 tcrtl= event.GetEventObject() 733 734 if check_float(tcrtl): 735 self._onparamEnter_helper() 736 737 if self._is_modified == True: 738 temp_smearer = None 739 if self.enable_smearer.GetValue(): 740 temp_smearer= self.smearer 741 742 self.compute_chisqr(smearer= temp_smearer) 743 ## new state posted 744 if self.state_change: 745 #self._undo.Enable(True) 746 event = PageInfoEvent(page = self) 747 wx.PostEvent(self.parent, event) 748 self.state_change= False 742 749 else: 743 750 msg= "Cannot Plot :Must enter a number!!! " … … 765 772 tcrtl.Refresh() 766 773 self._onparamEnter_helper() 767 768 ## new state posted 769 if self.state_change: 770 #self._undo.Enable(True) 771 event = PageInfoEvent(page = self) 772 wx.PostEvent(self.parent, event) 773 self.state_change= False 774 775 if self._is_modified == True: 776 ## new state posted 777 if self.state_change: 778 #self._undo.Enable(True) 779 event = PageInfoEvent(page = self) 780 wx.PostEvent(self.parent, event) 781 self.state_change= False 774 782 775 783 -
sansview/perspectives/fitting/modelpage.py
re3a76c8 racd0bda3 89 89 90 90 sizer_npts= wx.GridSizer(1, 1,5, 5) 91 self.npts = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20) )91 self.npts = BasicPage.ModelTextCtrl(self, -1,size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER) 92 92 self.npts.SetValue(format_number(self.num_points)) 93 93 self.npts.SetToolTipString("Number of point to plot.")
Note: See TracChangeset
for help on using the changeset viewer.