Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision f5dadd5d9bcbc646beab2d8faa9d20be416e89c5)
+++ sansview/perspectives/fitting/basepage.py	(revision 920a6e51caebdf22df568f0a31e8349f61b4b8d6)
@@ -294,5 +294,4 @@
             name = str(key)
             self.disp_box.Append(name,value)
-        
         self.disp_box.SetStringSelection("gaussian") 
         wx.EVT_COMBOBOX(self.disp_box,-1, self._on_select_Disp) 
@@ -1417,5 +1416,9 @@
       
             return
-            
+        #remove previous added details for dispersion parameters.
+        for item in self.model.details.keys():
+            if item in self.model.fixed:
+                del self.model.details [item]                           
+    
         if self.enable_disp.GetValue():
             self.model_disp.Show(True)
@@ -1563,5 +1566,7 @@
                 if item in self.param_toFit:
                     self.param_toFit.remove(item)
-                  
+        for item in self.model.details.keys():
+            if item in self.model.fixed:
+                del self.model.details [item]                           
 
         self.fittable_param=[]
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision c5cd3b971d2fac7542c1800bb369bb086bef2af7)
+++ sansview/perspectives/fitting/fitpage.py	(revision 920a6e51caebdf22df568f0a31e8349f61b4b8d6)
@@ -82,6 +82,7 @@
         if event.type =="park":
             self.btFit.SetLabel("Fit")
+            
         for item in self.parameters:
-            if event.type =="scipy":
+            if event.type =="scipy" :
                 item[5].SetValue("")
                 item[5].Hide()
@@ -95,4 +96,23 @@
                 self.text2_min.Show(True)
                 self.text2_max.Show(True)
+        for item in self.fittable_param:
+            if item[5]!=None and item[6]!=None and not item in self.orientation_params_disp:
+                if event.type =="scipy" and not item in self.orientation_params:
+                    item[5].SetValue("")
+                    item[5].Hide()
+                    item[6].SetValue("")
+                    item[6].Hide()
+                    self.text2_min.Hide()
+                    self.text2_max.Hide()
+                    self.text_disp_min.Hide()
+                    self.text_disp_max.Hide()
+                else:
+                    item[5].Show(True)
+                    item[6].Show(True)
+                    self.text2_min.Show(True)
+                    self.text2_max.Show(True)
+                    self.text_disp_min.Show(True)
+                    self.text_disp_max.Show(True)
+            
         for item in self.orientation_params:
             if item[5]!=None and item[6]!=None:
@@ -102,29 +122,19 @@
                     item[6].SetValue("")
                     item[6].Hide()
-                    self.text2_min.Hide()
-                    self.text2_max.Hide()
                 else:
                     item[5].Show(True)
                     item[6].Show(True)
-                    self.text2_min.Show(True)
-                    self.text2_max.Show(True)
-            
-        for item in self.orientation_params_disp:           
+                    
+        for item in self.orientation_params_disp:         
             if item[5]!=None and item[6]!=None:
                 if event.type =="scipy" or self.data.__class__.__name__ !="Data2D":
-                    print "here21"
                     item[5].SetValue("")
                     item[5].Hide()
                     item[6].SetValue("")
                     item[6].Hide()
-                    self.text2_min.Hide()
-                    self.text2_max.Hide()
                 else:
-                    print "here22"
                     item[5].Show(True)
                     item[6].Show(True)
-                    self.text2_min.Show(True)
-                    self.text2_max.Show(True)
-            
+     
         self.sizer3.Layout()
         self.SetScrollbars(20,20,25,65)
@@ -257,5 +267,5 @@
         self.fixed_param=[]
         self.orientation_params_disp=[]
-       
+
         self.sizer4_4.Clear(True)
         if self.model==None:
@@ -284,8 +294,26 @@
         self.sizer4_4.Add(values,( iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         ix +=2 
-        self.text_disp_1 = wx.StaticText(self, -1, 'Errors')
+        self.text_disp_1 = wx.StaticText(self, -1, '')
         self.sizer4_4.Add( self.text_disp_1,(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
         self.text_disp_1.Hide()
+        
+        
+        ix +=1 
+        self.text_disp_min = wx.StaticText(self, -1, 'Min')
+        self.sizer4_4.Add(self.text_disp_min,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        self.text_disp_min.Hide()
+        ix +=1 
+        self.text_disp_max = wx.StaticText(self, -1, 'Max')
+        self.sizer4_4.Add(self.text_disp_max,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        self.text_disp_max.Hide()
+                        
+        
+        
+        
+        
+        
         ix += 1 
         npts = wx.StaticText(self, -1, 'Npts')
@@ -294,4 +322,8 @@
         nsigmas = wx.StaticText(self, -1, 'Nsigmas')
         self.sizer4_4.Add(nsigmas,( iy, ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+        
+        if self.engine_type=="park":
+            self.text_disp_max.Show(True)
+            self.text_disp_min.Show(True)
 
         for item in self.model.dispersion.keys():
@@ -327,8 +359,43 @@
                         self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                         ctl2.Hide()
+                        
+                        #Prepare add min and max in model.details.(Maybe Not correct way)
+                        if not self.model.details.has_key(name1):
+                            self.model.details [name1] = ["",None, None]                            
+                        param_min, param_max= self.model.details[name1][1:]
+                        ix = 4
+                        ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
+                                                       kill_focus_callback = self._on_paramRangeEnter,
+                                                       set_focus_callback  = self._on_paramRangeEnter)
+                        if param_min ==None:
+                            ctl3.SetValue("")
+                        else:
+                            ctl3.SetValue(str(param_min))
+                        self.sizer4_4.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                        ctl3.Hide()
+                
+                        ix = 5
+                        ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
+                                                       kill_focus_callback = self._on_paramRangeEnter,
+                                                       set_focus_callback  = self._on_paramRangeEnter)
+                        self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                        if param_max==None:
+                            ctl4.SetValue("")
+                        else:
+                            ctl4.SetValue(str(param_max))
+                        ctl4.Hide()
+                        
+                        if self.engine_type=="park":
+                            ctl3.Show(True)
+                            ctl4.Show(True)
+                                          
                         self.fittable_param.append([cb,name1,ctl1,text2,
-                                                    ctl2, None, None,None])
+                                                    ctl2, ctl3, ctl4,None])
+                        #self.parameters.append([cb,name1, ctl1,text2,ctl2, ctl3, ctl4,None])
+                        #self.orientation_params.append([cb,name1, ctl1,text2,ctl2, ctl3, ctl4,None])
+                    
+                    
                     elif p=="npts":
-                            ix = 4
+                            ix = 6
                             value= self.model.getParam(name2)
                             Tctl = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20),
@@ -341,5 +408,5 @@
                                                       None, None,None])
                     elif p=="nsigmas":
-                            ix = 5
+                            ix = 7
                             value= self.model.getParam(name3)
                             Tctl = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20),
@@ -353,5 +420,6 @@
                             
                             self.fixed_param.append([None,name3, Tctl
-                                                     ,None,None, None, None,None])
+                                                     ,None,None,None, None,None])
+                            
         ix =0
         iy +=1 
@@ -401,10 +469,55 @@
                         else:
                             ctl2.Disable()
+                            
+                            
+                        if not self.model.details.has_key(name1):
+                            self.model.details [name1] = ["",None, None]                            
+                
+                        param_min, param_max= self.model.details[name1][1:]
+                        ix = 4
+                        ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
+                                                       kill_focus_callback = self._onparamRangeEnter,
+                                                       set_focus_callback  = self._onparamRangeEnter)
+                        if param_min ==None:
+                            ctl3.SetValue("")
+                        else:
+                            ctl3.SetValue(str(param_min))
+                        self.sizer4_4.Add(ctl3, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                        ctl3.Hide()
+                        if self.data.__class__.__name__ =="Data2D":
+                            ctl3.Enable()
+                        else:
+                            ctl3.Disable()
+                
+                        ix = 5
+                        ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
+                                                       kill_focus_callback = self._onparamRangeEnter,
+                                                       set_focus_callback  = self._onparamRangeEnter)
+                        self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+                        if param_max==None:
+                            ctl4.SetValue("")
+                        else:
+                            ctl4.SetValue(str(param_max))
+                        ctl4.Hide()
+                        if self.data.__class__.__name__ =="Data2D":
+                            ctl4.Enable()
+                        else:
+                            ctl4.Disable()
+                        
+                        if self.engine_type=="park" and self.data.__class__.__name__ =="Data2D":
+                            ctl3.Show(True)
+                            ctl4.Show(True)                            
+                            
+                            
+                            
+                            
                         self.fittable_param.append([cb,name1,ctl1,text2,
-                                                    ctl2, None, None,None])
+                                                    ctl2, ctl3, ctl4,None])
+                        #self.parameters.append([cb,name1, ctl1,text2,ctl2, ctl3, ctl4,None])
+                        #self.orientation_params.append([cb,name1,ctl1,text2, ctl2, ctl3, ctl4,None])
                         self.orientation_params_disp.append([cb,name1,ctl1,text2,
-                                                    ctl2, None, None,None])
+                                                    ctl2, ctl3, ctl4,None])
                     elif p=="npts":
-                            ix = 4
+                            ix = 6
                             value= self.model.getParam(name2)
                             Tctl = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20),
@@ -423,5 +536,5 @@
                                                       None, None,None])
                     elif p=="nsigmas":
-                            ix = 5
+                            ix = 7
                             value= self.model.getParam(name3)
                             Tctl = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20),
@@ -439,4 +552,5 @@
                             self.fixed_param.append([None,name3, Tctl
                                                      ,None,None, None, None,None])    
+                                                       
                             self.orientation_params_disp.append([None,name3, Tctl
                                                      ,None,None, None, None,None])
@@ -445,8 +559,11 @@
         self.state.model = self.model.clone()  
          ## save state into
+        
+        self._copy_parameters_state(self.parameters, self.state.parameters)
         self._copy_parameters_state(self.orientation_params_disp,
                                      self.state.orientation_params_disp)
         self._copy_parameters_state(self.fittable_param, self.state.fittable_param)
         self._copy_parameters_state(self.fixed_param, self.state.fixed_param)
+  
                          
         wx.PostEvent(self.parent, StatusEvent(status=\
@@ -611,4 +728,33 @@
             return 
         
+    ### Same as _onparamRangeEnter but smear and chi^2 calculations are removed
+    ### and _onparamEnter_helper is not used, which causing mess sizer display
+    def _on_paramRangeEnter(self, event):
+        """
+            Check validity of value enter in the parameters range field
+        """
+        tcrtl= event.GetEventObject()
+        if tcrtl.GetValue().lstrip().rstrip()!="":
+            try:
+                value = float(tcrtl.GetValue())
+                tcrtl.SetBackgroundColour(wx.WHITE)
+                tcrtl.Refresh()
+            except:
+                tcrtl.SetBackgroundColour("pink")
+                tcrtl.Refresh()
+                return
+        else:
+           tcrtl.SetBackgroundColour(wx.WHITE)
+           tcrtl.Refresh()  
+        #self._onparamEnter_helper() 
+        
+        ## new state posted
+        if self.state_change:
+            self._undo.Enable(True)
+            event = PageInfoEvent(page = self)
+            wx.PostEvent(self.parent, event)
+            self.state_change= False
+        
+                
         
     def set_data(self, data ):
@@ -1093,6 +1239,6 @@
                 ix += 1
                 ctl3 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
-                                               kill_focus_callback = self._onparamRangeEnter,
-                                               set_focus_callback  = self._onparamRangeEnter)
+                                               kill_focus_callback = self._on_paramRangeEnter,
+                                               set_focus_callback  = self._on_paramRangeEnter)
                 if param_min ==None:
                     ctl3.SetValue("")
@@ -1104,6 +1250,6 @@
                 ix += 1
                 ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
-                                               kill_focus_callback = self._onparamRangeEnter,
-                                               set_focus_callback  = self._onparamRangeEnter)
+                                               kill_focus_callback = self._on_paramRangeEnter,
+                                               set_focus_callback  = self._on_paramRangeEnter)
                 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                 if param_max==None:
@@ -1233,5 +1379,5 @@
                         ctl4.Hide()
                         #ctl4.Disable()
-                    if self.engine_type !="park":
+                    if self.engine_type !="park" or self.data.__class__.__name__ !="Data2D":                      
                         ctl3.Hide()
                         ctl4.Hide()
