Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision c69b6d52664add01a9b00ef1d28762b0d370cee8)
+++ sansview/perspectives/fitting/fitpage.py	(revision c13b8cc92f5698baf2564c879c9dad33fa3e81f5)
@@ -367,5 +367,5 @@
 
                         ix = 3
-                        ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                        ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0)
                   
                         self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -377,5 +377,4 @@
                                                        kill_focus_callback = self._onparamRangeEnter,
                                                        text_enter_callback = self._onparamRangeEnter,
-                                                       #mouse_up_callback = self._onparamRangeEnter,
                                                        set_focus_callback  = self._onparamRangeEnter)
 
@@ -387,5 +386,4 @@
                                                        kill_focus_callback = self._onparamRangeEnter,
                                                        text_enter_callback = self._onparamRangeEnter,
-                                                       #mouse_up_callback = self._onparamRangeEnter,
                                                        set_focus_callback  = self._onparamRangeEnter)
                         self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -470,5 +468,5 @@
 
                         ix = 3
-                        ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                        ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0)
                     
                         self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -479,5 +477,4 @@
                                                        kill_focus_callback = self._onparamRangeEnter,
                                                        text_enter_callback = self._onparamRangeEnter,
-                                                       #mouse_up_callback = self._onparamRangeEnter,
                                                        set_focus_callback  = self._onparamRangeEnter)
 
@@ -490,5 +487,4 @@
                                                        kill_focus_callback = self._onparamRangeEnter,
                                                        text_enter_callback = self._onparamRangeEnter,
-                                                       #mouse_up_callback = self._onparamRangeEnter,
                                                        set_focus_callback  = self._onparamRangeEnter)
                         self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -567,5 +563,5 @@
         wx.PostEvent(self.parent, StatusEvent(status=\
                         " Selected Distribution: Gaussian"))   
-        ix =0
+        ix =0 
         iy +=1 
         #self.sizer4_4.Layout()
@@ -582,5 +578,6 @@
         from sans.guiframe.utils import check_value
         self.select_param(event =None)
-        flag = check_value( self.qmin, self.qmax) 
+        #make sure all parameter values are updated.
+        flag = self._update_paramv_on_fit() #check_value( self.qmin, self.qmax) 
                 
         if not flag:
@@ -597,8 +594,7 @@
         self._clear_Err_on_Fit() 
 
-        # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0].
-        #ToDo: Fix this.                
+        # Remove or do not allow fitting on the Q=0 point, especially when y(q=0)=None at x[0].         
         self.qmin_x = float(self.qmin.GetValue())
-        self.qmax_x =float( self.qmax.GetValue())
+        self.qmax_x = float( self.qmax.GetValue())
         self.manager._reset_schedule_problem( value=0)
         self.manager.schedule_for_fit( value=1,page=self,fitproblem =None) 
@@ -707,5 +703,5 @@
             Check validity of value enter in the parameters range field
         """
-        is_modified = False   
+        is_modified = True   
         tcrtl= event.GetEventObject()
         if tcrtl.GetValue().lstrip().rstrip()!="":
@@ -713,15 +709,17 @@
                 value = float(tcrtl.GetValue())
                 tcrtl.SetBackgroundColour(wx.WHITE)
+                tcrtl.Refresh()
             except:
                 tcrtl.SetBackgroundColour("pink")
+                tcrtl.Refresh()
                 return
         else:
            tcrtl.SetBackgroundColour(wx.WHITE)
            self.save_current_state()
-           #is_modified = True
+           is_modified = False
            
-        if not is_modified:
+        if is_modified:
             self._onparamEnter_helper()
-        ## new state posted
+        ## new state posted    
         if self.state_change:
             #self._undo.Enable(True)
@@ -798,11 +796,14 @@
        
         """
+        if out == None:
+            return
         #format chi2
         chi2 = format_number(chisqr)
         
         self.tcChi.SetLabel(chi2)
-        params = {}
+        
         is_modified = False
         has_error = False
+        
         try:
             n = self.disp_box.GetCurrentSelection()
@@ -817,5 +818,4 @@
         #set the panel when fit result are float not list
         if out.__class__== numpy.float64:
-            #print "float64"
             self.param_toFit[0][2].SetValue(format_number(out))
             self.param_toFit[0][2].Refresh()
@@ -851,5 +851,5 @@
             i = 0
             #Set the panel when fit result are list
-            for item in self.param_toFit:               
+            for item in self.param_toFit:           
                 ## reset error value to initial state
                 if item[3].IsShown():
@@ -857,13 +857,13 @@
                 if item[4].IsShown():
                     item[4].Hide()
-       
-                if( out != None ) and len(out)<=len(self.param_toFit) and i < len(out):
+                    
+                if len(out)<=len(self.param_toFit) and i < len(out):
                     item[2].SetValue(format_number(self.model.getParam(item[1])))
-                    item[2].Refresh()
-                    
+                    item[2].Refresh()                        
                 for ind in range(len(out)):
                     
                     if item[1] == p_name[ind]:
                         break        
+
 
                 if(cov !=None)  and len(cov)<=len(self.param_toFit) and i < len(cov):
@@ -1226,5 +1226,5 @@
                 text2.Hide() 
                 ix += 1
-                ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0)
                 sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                 ctl2.Hide()
@@ -1234,5 +1234,4 @@
                                                kill_focus_callback = self._onparamRangeEnter,
                                                text_enter_callback = self._onparamRangeEnter,
-                                               #mouse_up_callback = self._onparamRangeEnter,
                                                set_focus_callback  = self._onparamRangeEnter)
      
@@ -1244,5 +1243,4 @@
                                                kill_focus_callback = self._onparamRangeEnter,
                                                text_enter_callback = self._onparamRangeEnter,
-                                               #mouse_up_callback = self._onparamRangeEnter,
                                                set_focus_callback  = self._onparamRangeEnter)
                 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -1291,5 +1289,8 @@
             for item in self.model.orientation_params:
                 if not item in self.disp_list:
-                         
+                    ##prepare a spot to store min max
+                    if not self.model.details.has_key(item):
+                        self.model.details [item] = ["",None,None] 
+                          
                     iy += 1
                     ix = 0
@@ -1324,5 +1325,5 @@
                     text2.Hide() 
                     ix += 1
-                    ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                    ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=0)
                     
                     sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
@@ -1334,5 +1335,4 @@
                                                    kill_focus_callback = self._onparamRangeEnter,
                                                    text_enter_callback = self._onparamRangeEnter,
-                                                   #mouse_up_callback = self._onparamRangeEnter,
                                                    set_focus_callback  = self._onparamRangeEnter)
                
@@ -1349,5 +1349,4 @@
                                                    kill_focus_callback = self._onparamRangeEnter,
                                                    text_enter_callback = self._onparamRangeEnter,
-                                                   #mouse_up_callback = self._onparamRangeEnter,
                                                    set_focus_callback  = self._onparamRangeEnter)
                     sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
