Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision 77f6a8be00cc31487eb8e77cb3c033ad7e309fad)
+++ sansview/perspectives/fitting/basepage.py	(revision c99a6c514c56374f21266b358ae99f1145058839)
@@ -19,7 +19,7 @@
 #Control panel width 
 if sys.platform.count("win32")>0:
-    PANEL_WIDTH = 420
+    PANEL_WIDTH = 430
 else:
-    PANEL_WIDTH = 490
+    PANEL_WIDTH = 500
     
 class BasicPage(wx.ScrolledWindow):
@@ -113,11 +113,11 @@
         #wx.EVT_MENU(self, id, self.onRedo)       
         #self.popUpMenu.AppendSeparator()
-                
-        id = wx.NewId()
-        self._keep = wx.MenuItem(self.popUpMenu,id,"BookMark"," Keep the panel status to recall it later")
-        self.popUpMenu.AppendItem(self._keep)
-        self._keep.Enable(True)
-        wx.EVT_MENU(self, id, self.onSave)
-        self.popUpMenu.AppendSeparator()
+        if sys.platform.count("win32")>0:        
+            id = wx.NewId()
+            self._keep = wx.MenuItem(self.popUpMenu,id,"BookMark"," Keep the panel status to recall it later")
+            self.popUpMenu.AppendItem(self._keep)
+            self._keep.Enable(True)
+            wx.EVT_MENU(self, id, self.onSave)
+            self.popUpMenu.AppendSeparator()
         
         ## Default locations
@@ -491,5 +491,11 @@
         #self.model._persistency_dict = {}
         #self.state.model._persistency_dict= copy.deepcopy(self.model._persistency_dict)
-                        
+        
+        #Remember fit engine_type for fit panel
+        if self.engine_type == None and self.manager !=None:
+            self.engine_type = self.manager._return_engine_type()
+        
+        self.state.engine_type = self.engine_type
+       
         new_state = self.state.clone()
         new_state.model.name = self.state.model.name
@@ -516,34 +522,11 @@
         wx.EVT_MENU(self, id, self.onResetModel)
         
-        
     def onSetFocus(self, evt):
         """
             highlight the current textcrtl and hide the error text control shown 
             after fitting
-        """
-        if hasattr(self,"text2_3"):
-            self.text2_3.Hide()
-        if len(self.parameters)>0:
-            for item in self.parameters:
-                ## hide statictext +/-    
-                if item[3]!=None:
-                    item[3].Hide()
-                ## hide textcrtl  for error after fit
-                if item[4]!=None:
-                    item[4].Clear()
-                    item[4].Hide()
-        if len(self.fittable_param)>0:
-            for item in self.fittable_param:
-                ## hide statictext +/-    
-                if item[3]!=None:
-                    item[3].Hide()
-                ## hide textcrtl  for error after fit
-                if item[4]!=None:
-                    item[4].Clear()
-                    item[4].Hide()
-        ##Is this layout necessary? Had a problem w/MAC.
-        #self.Layout()
+            :Not implemented.
+        """
         return
-    
     
     def read_file(self, path):
@@ -594,5 +577,5 @@
             self.state.disp_list= copy.deepcopy(self.disp_list)
             self.state.model = self.model.clone()
-            
+
         self.state.enable2D = copy.deepcopy(self.enable2D)
         self.state.values= copy.deepcopy(self.values)
@@ -665,5 +648,5 @@
     def save_current_state_fit(self):
         """
-            Store current state
+            Store current state for fit_page
         """
         ## save model option
@@ -672,5 +655,6 @@
             self.state.disp_list= copy.deepcopy(self.disp_list)
             self.state.model = self.model.clone()
-            
+        #if hasattr(self,self.engine_type)> 0:
+            #self.state.engine_type = self.engine_type.clone() 
         self.state.enable2D = copy.deepcopy(self.enable2D)
         self.state.values= copy.deepcopy(self.values)
@@ -758,5 +742,5 @@
             self.smearer= smear_selection( self.data )
         self.enable2D= state.enable2D
-        
+        self.engine_type = state.engine_type
         #???
         self.disp_cb_dict = state.disp_cb_dict
@@ -866,5 +850,35 @@
         self._draw_model()
        
-        
+    def _clear_Err_on_Fit(self):
+        """
+            hide the error text control shown 
+            after fitting
+        """
+        
+        if hasattr(self,"text2_3"):
+            self.text2_3.Hide()
+
+        if len(self.parameters)>0:
+            for item in self.parameters:
+                ## hide statictext +/-    
+                if item[3]!=None and item[3].IsShown():
+                    item[3].Hide()
+                ## hide textcrtl  for error after fit
+                if item[4]!=None and item[4].IsShown():                   
+                    item[4].Clear()
+                    item[4].Hide()
+        if len(self.fittable_param)>0:
+            for item in self.fittable_param:
+                ## hide statictext +/-    
+                if item[3]!=None and item[3].IsShown():
+                    item[3].Hide()
+                ## hide textcrtl  for error after fit
+                if item[4]!=None and item[4].IsShown():
+                    item[4].Clear()
+                    item[4].Hide()
+        ##Is this layout necessary? Had a problem w/MAC.
+        #self.Layout()
+        
+        return        
     def _selectDlg(self):
         """
@@ -913,5 +927,5 @@
         self.state.structurebox= self.structurebox.GetCurrentSelection()
         self.state.formfactorbox = self.formfactorbox.GetCurrentSelection()
-        
+       
         #self._undo.Enable(True)
         ## post state to fit panel
@@ -945,9 +959,10 @@
             is_modified =self._check_value_enter( self.fixed_param ,is_modified)
             is_modified =self._check_value_enter( self.parameters ,is_modified) 
-                   
+     
             if is_modified:
                 self.sizer3.Layout()
                 self.Layout()
                 self.Refresh()
+
             # Here we should check whether the boundaries have been modified.
             # If qmin and qmax have been modified, update qmin and qmax and 
@@ -972,5 +987,5 @@
                     msg= "Cannot Plot :Must enter a number!!!  "
                     wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
-                    
+                
             
             ## if any value is modify draw model with new value
@@ -978,13 +993,11 @@
                 self.state_change= True
                 self._draw_model() 
-                self.save_current_state()
-                
-            self.is_modified = is_modified  
+                self.save_current_state() 
                
-    def _is_modified(self):
+    def _is_modified(self, is_modified):
         """
             return to self._is_modified
         """
-        return self.is_modified
+        return is_modified
                        
     def _reset_parameters_state(self, listtorestore,statelist):
@@ -996,4 +1009,5 @@
         if len(statelist)!=  len(listtorestore) :
             return
+
         for j in range(len(listtorestore)):
             item_page = listtorestore[j]
@@ -1245,5 +1259,5 @@
         self.Bind( wx.EVT_RADIOBUTTON, self._show_combox,
                             id= self.plugin_rbutton.GetId() )  
-		#MAC needs SetValue
+        #MAC needs SetValue
         self.shape_rbutton.SetValue(True)
       
@@ -1438,5 +1452,7 @@
             when enter value on panel redraw model according to changed
         """
+
         tcrtl= event.GetEventObject()
+        
         ## save current state
         self.save_current_state()
@@ -1445,8 +1461,9 @@
             event = PageInfoEvent(page = self)
             wx.PostEvent(self.parent, event)
-            
+              
         if check_float(tcrtl):
             
             self._onparamEnter_helper()
+            
         else:
             msg= "Cannot Plot :Must enter a number!!!  "
@@ -1461,12 +1478,13 @@
             item=[cb state, name, value, "+/-", error of fit, min, max , units]
         """  
-        self.is_modified =  modified
+        is_modified =  modified
         if len(list)==0:
-            return self.is_modified
+            return is_modified
         for item in list:
             try:
                 name = str(item[1])
-                if hasattr(self,"text2_3"):
-                    self.text2_3.Hide()
+                if hasattr(self,"text2_3") and self.text2_3.IsShown():
+                    if hasattr(self,"item[4]")and self.item[4] == None:
+                        self.text2_3.Hide()
                 ## check model parameters range
                 ## check minimun value
@@ -1476,5 +1494,4 @@
                     if item[5].GetValue().lstrip().rstrip()!="":
                         param_min = float(item[5].GetValue())
-                    
                 ## check maximum value
                 if item[6]!= None:
@@ -1489,28 +1506,26 @@
                         wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
                 if name in self.model.details.keys():   
-                    self.model.details[name][1:]= param_min,param_max
-                
+                    self.model.details[name][1:3]= param_min,param_max
+                                    
                 ## hide statictext +/-    
-                if item[3]!=None:
-                    item[3].Hide()
+                #if item[3]!=None and item[3].IsShown():
+                #    item[3].Hide()
                 ## hide textcrtl  for error after fit
-                if item[4]!=None:
-                    item[4].Clear()
-                    item[4].Hide()
-                    
+                #if item[4]!=None and item[4].IsShown():
+                #    item[4].Clear()
+                #    item[4].Hide()
+
                 value= float(item[2].GetValue())
-                
                 # If the value of the parameter has changed,
                 # +update the model and set the is_modified flag
                 if value != self.model.getParam(name):
                     self.model.setParam(name,value)
-                    self.is_modified = True   
-            
+                    is_modified = True   
+
             except:
                 msg= "Model Drawing  Error:wrong value entered : %s"% sys.exc_value
                 wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
                 return 
-        
-        return self.is_modified 
+        return is_modified 
         
  
@@ -1533,7 +1548,7 @@
             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]                           
+        #for item in self.model.dispersion.keys():#for item in self.model.details.keys():
+        #    if item in self.model.fixed and item in self.model.details.keys():
+        #        del self.model.details [item]                           
     
         if self.enable_disp.GetValue():
@@ -1822,6 +1837,6 @@
         self.sizer5.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10)
         self.sizer5.Layout()
-        self.Layout()
-        self.SetScrollbars(20,20,25,65)
+        #self.Layout()
+        #self.SetScrollbars(20,20,25,65)
     
     
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision 77f6a8be00cc31487eb8e77cb3c033ad7e309fad)
+++ sansview/perspectives/fitting/fitpage.py	(revision c99a6c514c56374f21266b358ae99f1145058839)
@@ -44,5 +44,4 @@
         ## default fitengine type
         self.engine_type = None
-        #self.smearer = None
         ## draw sizer
         self._fill_datainfo_sizer()
@@ -138,5 +137,4 @@
                     item[6].Show(True)
      
-
         self.SetScrollbars(20,20,25,65)
         
@@ -343,4 +341,7 @@
                 name2=item+".npts"
                 name3=item+".nsigmas"
+                if not self.model.details.has_key(name1):
+                    self.model.details [name1] = ["",None, None, None]                            
+
                 iy += 1
                 for p in self.model.dispersion[item].keys(): 
@@ -365,18 +366,23 @@
                         text2.Hide() 
                         ## txtcrtl to add error from fit
+                        fit_errs = self.model.details[item][3]
+                     
                         ix = 3
                         ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                        ctl2.SetValue(str(format_number(fit_errs)))
                         self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                        ctl2.Hide()
-                        
+                        if fit_errs==None or not numpy.isfinite(fit_errs):
+                            ctl2.Hide()
+                        else:
+                            if not text2.IsShown():
+                                text2.Show(True)
+                            ctl2.Show(True)
                         #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:]
+                        param_min, param_max= self.model.details[name1][1:3]
                         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:
+                        if param_min ==None or not numpy.isfinite(param_min):
                             ctl3.SetValue("")
                         else:
@@ -390,5 +396,5 @@
                                                        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:
+                        if param_max==None or not numpy.isfinite(param_max):
                             ctl4.SetValue("")
                         else:
@@ -401,8 +407,5 @@
                                           
                         self.fittable_param.append([cb,name1,ctl1,text2,
-                                                    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])
-                    
+                                                    ctl2, ctl3, ctl4,None])                    
                     
                     elif p=="npts":
@@ -441,4 +444,6 @@
                 name2=item+".npts"
                 name3=item+".nsigmas"
+                if not self.model.details.has_key(name1):
+                    self.model.details [name1] = ["",None, None, None]                  
                 iy += 1
                 for p in self.model.dispersion[item].keys(): 
@@ -452,5 +457,5 @@
                         if self.data.__class__.__name__ =="Data2D":
                             cb.Show(True)
-                        else:
+                        elif cb.IsShown():
                             cb.Hide()
                         ix = 1
@@ -461,5 +466,5 @@
                         if self.data.__class__.__name__ =="Data2D":
                             ctl1.Show(True)
-                        else:
+                        elif ctl1.IsShown():
                             ctl1.Hide()
                         self.sizer4_4.Add(ctl1, (iy,ix),(1,1),wx.EXPAND)
@@ -470,33 +475,33 @@
                                           wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                         text2.Hide() 
-                        ## txtcrtl to add error from fit
+                        ## txtcrtl to add error from fit                       
+                        fit_errs = self.model.details[item][3]                    
                         ix = 3
                         ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                        ctl2.SetValue(str(format_number(fit_errs)))
                         self.sizer4_4.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                        ctl2.Hide()
-                        if self.data.__class__.__name__ =="Data2D":
-                            ctl2.Enable()
+                        if fit_errs==None or not numpy.isfinite(fit_errs) or self.data.__class__.__name__ !="Data2D":
+                            ctl2.Hide()
                         else:
-                            ctl2.Disable()
+                            if not text2.IsShown():
+                                text2.Show(True)
+                            ctl2.Show(True)
+                        #if self.data.__class__.__name__ =="Data2D":
+                            #ctl2.Show(True)
+                        #elif ctl2.IsShown():
+                            #ctl2.Hide()
                             
-                            
-                        if not self.model.details.has_key(name1):
-                            self.model.details [name1] = ["",None, None]                            
-                
-                        param_min, param_max= self.model.details[name1][1:]
+                        param_min, param_max= self.model.details[name1][1:3]
                         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:
+                        if param_min ==None or not numpy.isfinite(param_min):
                             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
@@ -505,17 +510,19 @@
                                                        set_focus_callback  = self._onparamRangeEnter)
                         self.sizer4_4.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                        if param_max==None:
+                        if param_max==None or not numpy.isfinite(param_max):
                             ctl4.SetValue("")
                         else:
                             ctl4.SetValue(str(param_max))
                         ctl4.Hide()
-                        if self.data.__class__.__name__ =="Data2D":
-                            ctl4.Enable()
-                        else:
-                            ctl4.Disable()
+                        #if self.data.__class__.__name__ =="Data2D":
+                            #ctl4.Enable(True)
+                        #elif ctl4.Shown():
+                            #ctl4.Hide()
                         
                         if self.engine_type=="park" and self.data.__class__.__name__ =="Data2D":
                             ctl3.Show(True)
-                            ctl4.Show(True)                            
+                            ctl3.Enable(True)
+                            ctl4.Show(True) 
+                            ctl4.Enable(True)                           
                             
                             
@@ -524,6 +531,4 @@
                         self.fittable_param.append([cb,name1,ctl1,text2,
                                                     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, ctl3, ctl4,None])
@@ -565,4 +570,12 @@
                             self.orientation_params_disp.append([None,name3, Tctl
                                                      ,None,None, None, None,None])
+        #Display units text on panel
+        for item in self.model.dispersion.keys():   
+            if self.model.details[item][3]!= None and numpy.isfinite(self.model.details[item][3]):
+                if not self.text2_3.IsShown():
+                    self.text2_3.Show()
+                break
+            else:
+                self.text2_3.Hide()
    
         self.state.disp_cb_dict = copy.deepcopy(self.disp_cb_dict)      
@@ -581,5 +594,4 @@
         ix =0
         iy +=1 
-        #self.sizer4_4.Add((20,20),(iy,ix),(1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)        
         self.sizer4_4.Layout()
         self.sizer4.Layout()
@@ -594,4 +606,5 @@
         """
         from sans.guiframe.utils import check_value
+        self.select_param(event =None)
         flag = check_value( self.qmin, self.qmax) 
                 
@@ -606,5 +619,6 @@
             return 
         
-            
+        #Clear errors if exist from previous fitting
+        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].
@@ -640,6 +654,6 @@
        
             
-        self.btFit.SetFocus()    
-        self.sizer5.Layout()
+        #self.btFit.SetFocus()    
+        #self.sizer5.Layout()
         #self.SetScrollbars(20,20,55,40)    
             
@@ -670,5 +684,5 @@
                                      qmax= float(self.qmax_x)) 
             evt = ModelEventbox(model=self.model)
-            wx.PostEvent(self.event_owner, evt)   
+            wx.PostEvent(self.event_owner, evt)  
             
         self.btFit.SetFocus() 
@@ -728,5 +742,5 @@
         """
         tcrtl= event.GetEventObject()
-       
+
         if check_float(tcrtl):
             self._onparamEnter_helper()
@@ -735,6 +749,6 @@
             if self.enable_smearer.GetValue():
                 temp_smearer= self.smearer
-            
             self.compute_chisqr(smearer= temp_smearer)
+
             ## new state posted
             if self.state_change:
@@ -794,11 +808,12 @@
             reset the state
         """
-        #if first:
-        #    self._undo.Enable(False)
-           
+        import sans.guiframe.gui_manager
+        
         self.reset_page_helper(state)
         evt = ModelEventbox(model=state.model)
-        wx.PostEvent(self.event_owner, evt)   
-            
+        wx.PostEvent(self.event_owner, evt)
+        self.manager._on_change_engine(engine=self.engine_type)
+        #Not improving anything yet.
+        #self.set_model_param_sizer(model=state.model)
             
     def get_range(self):
@@ -832,5 +847,4 @@
         is_modified = False
         has_error = False
-        self.text2_3.Hide()
         try:
             n = self.disp_box.GetCurrentSelection()
@@ -844,5 +858,5 @@
             pass
         #set the panel when fit result are float not list
-        if out.__class__==numpy.float64:
+        if out.__class__== numpy.float64:
             self.param_toFit[0][2].SetValue(format_number(out))
             self.param_toFit[0][2].Refresh()
@@ -860,8 +874,9 @@
                 except:
                     pass
+
                 if cov[0]==None or  not numpy.isfinite(cov[0]): 
                     self.param_toFit[0][3].Hide()
                     self.param_toFit[0][4].Clear()
-                    self.param_toFit[0][4].Hide()
+                    #self.param_toFit[0][4].Hide()
                     self.param_toFit[0][4].Refresh()
                 else:
@@ -874,15 +889,22 @@
             i=0
             j=0
+            k=0
+            
+            if self.text2_3.IsShown():
+                self.text2_3.Hide()
+                
             #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
-                item[4].Clear()
-                item[4].Hide()
-                item[4].Refresh()
+                if item[3].IsShown():
+                    item[3].Hide()
+                if item[4].IsShown():
+                    item[4].Hide()
+       
                 if( out != None ) and len(out)<=len(self.param_toFit)and i < len(out):
                     item[2].SetValue(format_number(self.model.getParam(item[1])))
                     item[2].Refresh()
-                if(cov !=None)and len(cov)<=len(self.param_toFit)and i < len(cov):
-                    self.text2_3.Show(True) 
+
+                if(cov !=None)  and len(cov)<=len(self.param_toFit)and i < len(cov):
                     try:
                         name= dispersity.__name__
@@ -892,27 +914,40 @@
                                     self.text_disp_1.Show(True)
                     except:
-                        pass
-                    item[3].Show(True)
-                    item[4].Clear()
+                        pass                   
                     for j in range(len(out)):
                         if out[j]==self.model.getParam(item[1]):
+                            
                             break
-                    ## unable to compare cov[j]==numpy.nan so switch to None
-                    if cov[j]==None or not numpy.isfinite(cov[j]):
-                        item[3].Hide()
+                        ## unable to compare cov[j]==numpy.nan so switch to None
+                    #Save errors to model.details[item][3]
+                    self.model.details[item[1]][3] = cov[i]
+                                       
+                    
+                    if cov[i]==None or not numpy.isfinite(cov[i]):
+
+                        if item[3].IsShown:
+                            item[3].Hide()
+                        if item[4].IsShown:
+                            item[4].Hide()           
+                        #k += 1
+    
+
+                    else:
+                        k += 1
+                        item[3].Show(True)
+                        item[3].Refresh()
+                        item[4].Show(True)
+                        item[4].SetValue(format_number(cov[i]))
                         item[4].Refresh()
-                        item[4].Clear()
-                        item[4].Hide()
-                    else:
-                        item[4].SetValue(format_number(cov[j]))
-                        item[4].Refresh()
-                        item[4].Show(True)   
-                i+=1
-        
-        self.sizer3.Layout()
-        self.sizer4.Layout()
+                    
+ 
+                i+=1  
+        #Show error title when any errors displayed
+        if k != 0: # len(self.param_toFit):
+            if not self.text2_3.IsShown():
+                self.text2_3.Show(True)                            
+
+        self.text2_3.Refresh()             
         self.Layout()
-        self.Refresh()
-        self.SetScrollbars(20,20,25,65)
         
         
@@ -960,7 +995,4 @@
            
             self.sizer5.Layout()
-            self.Layout()
-            self.Refresh
-            ## post state to fit panel
             self.state.tcChi =output
           
@@ -1093,12 +1125,4 @@
                     item[0].SetValue(False)
                 self.param_toFit=[]
-                
-        #self._copy_parameters_state(self.orientation_params,
-        #                             self.state.orientation_params)
-        #self._copy_parameters_state(self.orientation_params_disp,
-        #                            self.state.orientation_params_disp)
-        #self._copy_parameters_state(self.parameters, self.state.parameters)
-        #self._copy_parameters_state(self.fittable_param, self.state.fittable_param)
-        #self._copy_parameters_state(self.fixed_param, self.state.fixed_param)
            
         self.save_current_state_fit()  
@@ -1140,14 +1164,4 @@
         else:
             self.cb1.SetValue(False)
-        ## save current state of the page
-        #self.state.cb1 = self.cb1.GetValue()
-        #self._copy_parameters_state(self.orientation_params,
-        #                             self.state.orientation_params)
-        #self._copy_parameters_state(self.orientation_params_disp,
-        #                             self.state.orientation_params_disp)
-        #self._copy_parameters_state(self.parameters, self.state.parameters)
-        #self._copy_parameters_state(self.fittable_param, self.state.fittable_param)
-        #self._copy_parameters_state(self.fixed_param, self.state.fixed_param)
-        
         self.save_current_state_fit()
         if event !=None:
@@ -1179,4 +1193,5 @@
         if self.engine_type==None and self.manager !=None:
             self.engine_type= self.manager._return_engine_type()
+
             
         box_description= wx.StaticBox(self, -1,str("Model Parameters"))
@@ -1230,5 +1245,7 @@
         for item in keys:
             if not item in self.disp_list and not item in self.model.orientation_params:
-               
+                ##prepare a spot for error
+                if len(self.model.details[item])<4:
+                    self.model.details[item].append(numpy.nan)                
                 iy += 1
                 ix = 0
@@ -1255,15 +1272,27 @@
                 text2.Hide() 
                 ## txtcrtl to add error from fit
+                fit_errs = self.model.details[item][3]
+
                 ix += 1
                 ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+
+                
+                ctl2.SetValue(str(format_number(fit_errs)))
                 sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                ctl2.Hide()
+                if fit_errs==None or not numpy.isfinite(fit_errs):                   
+                    ctl2.Hide()
+                else:
+                    if not self.text2_3.IsShown():
+                        self.text2_3.Show(True)
+                    if not text2.IsShown():
+                        text2.Show(True) 
+                    ctl2.Show(True)
                 
-                param_min, param_max= self.model.details[item][1:]
+                param_min, param_max= self.model.details[item][1:3]
                 ix += 1
                 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:
+                if param_min ==None or not numpy.isfinite(param_min):
                     ctl3.SetValue("")
                 else:
@@ -1277,5 +1306,5 @@
                                                set_focus_callback  = self._on_paramRangeEnter)
                 sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                if param_max==None:
+                if param_max==None or not numpy.isfinite(param_max):
                     ctl4.SetValue("")
                 else:
@@ -1324,4 +1353,6 @@
             for item in self.model.orientation_params:
                 if not item in self.disp_list:
+                    if len(self.model.details[item])<4:
+                        self.model.details[item].append(numpy.nan)    
                     iy += 1
                     ix = 0
@@ -1332,8 +1363,6 @@
                     if self.data.__class__.__name__ =="Data2D":
                         cb.Show(True)
-                        #cb.Enable()
                     else:
                         cb.Hide()
-                        #cb.Disable()
                     sizer.Add( cb,( iy, ix),(1,1),
                                  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5)
@@ -1348,8 +1377,6 @@
                     if self.data.__class__.__name__ =="Data2D":
                         ctl1.Show(True)
-                        #ctl1.Enable()
                     else:
                         ctl1.Hide()
-                        #ctl1.Disable()
                     sizer.Add(ctl1, (iy,ix),(1,1), wx.EXPAND)
                     ## text to show error sign
@@ -1360,20 +1387,24 @@
                     text2.Hide() 
                     ## txtcrtl to add error from fit
+                    fit_errs = self.model.details[item][3]
                     ix += 1
                     ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                    ctl2.SetValue(str(format_number(fit_errs)))
                     sizer.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                     ctl2.Hide()
-                    if self.data.__class__.__name__ =="Data2D":
-                        ctl1.Show(True)
-                        #ctl1.Enable()
+                    if self.data.__class__.__name__ !="Data2D":
+                            ctl2.Hide()
                     else:
-                        ctl1.Hide()
-                        #ctl1.Disable()
-                    param_min, param_max= self.model.details[item][1:]
+                        if fit_errs!=None and numpy.isfinite(fit_errs):
+                            if not text2.IsShown():
+                                text2.Show(True)
+                            ctl2.Show(True)
+                    
+                    param_min, param_max= self.model.details[item][1:3]
                     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)
-                    if param_min ==None:
+                    if param_min ==None or not numpy.isfinite(param_min):
                         ctl3.SetValue("")
                     else:
@@ -1383,8 +1414,8 @@
                     if self.data.__class__.__name__ =="Data2D":
                         ctl3.Show(True)
-                        #ctl3.Enable()
+                     
                     else:
                         ctl3.Hide()
-                        #ctl3.Disable()
+                
                     ix += 1
                     ctl4 = BasicPage.ModelTextCtrl(self, -1, size=(_BOX_WIDTH/2,20), style=wx.TE_PROCESS_ENTER,
@@ -1392,5 +1423,5 @@
                                                    set_focus_callback  = self._onparamRangeEnter)
                     sizer.Add(ctl4, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-                    if param_max ==None:
+                    if param_max ==None or not numpy.isfinite(param_max):
                         ctl4.SetValue("")
                     else:
@@ -1399,8 +1430,8 @@
                     if self.data.__class__.__name__ =="Data2D":
                         ctl4.Show(True)
-                        #ctl4.Enable()
+                  
                     else:
                         ctl4.Hide()
-                        #ctl4.Disable()
+                   
                     if self.engine_type !="park" or self.data.__class__.__name__ !="Data2D":                      
                         ctl3.Hide()
@@ -1418,8 +1449,8 @@
                     if self.data.__class__.__name__ =="Data2D":
                         units.Show(True)
-                        #units.Enable()
+                    
                     else:
                         units.Hide()
-                        #units.Disable()
+                    
                     sizer.Add(units, (iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                         
Index: sansview/perspectives/fitting/modelpage.py
===================================================================
--- sansview/perspectives/fitting/modelpage.py	(revision acd0bda38d73ae4190cda320280dbe7a63a85976)
+++ sansview/perspectives/fitting/modelpage.py	(revision c99a6c514c56374f21266b358ae99f1145058839)
@@ -31,5 +31,6 @@
         """
         self._fill_model_sizer( self.sizer1)  
-        self._fill_range_sizer() 
+        self._fill_range_sizer()
+        self.engine_type = None 
          
         description=""
Index: sansview/perspectives/fitting/pagestate.py
===================================================================
--- sansview/perspectives/fitting/pagestate.py	(revision 3b9e0231871991c172eecf17561c194a02ec66db)
+++ sansview/perspectives/fitting/pagestate.py	(revision c99a6c514c56374f21266b358ae99f1145058839)
@@ -19,4 +19,6 @@
         #Data used for fitting 
         self.data = data
+        #engine type
+        self.engine_type = None
         # flag to allow data2D plot
         self.enable2D = False
@@ -101,4 +103,5 @@
         obj.data = copy.deepcopy(self.data)
         obj.model_list_box = copy.deepcopy(self.model_list_box)
+        obj.engine_type = copy.deepcopy(self.engine_type)
         
         obj.formfactorcombobox= self.formfactorcombobox
Index: sansview/perspectives/fitting/simfitpage.py
===================================================================
--- sansview/perspectives/fitting/simfitpage.py	(revision 17c5868bb73e659b0c6821ff470beb2cb2c2e051)
+++ sansview/perspectives/fitting/simfitpage.py	(revision c99a6c514c56374f21266b358ae99f1145058839)
@@ -2,5 +2,11 @@
 import sys,re,string, wx  
 import wx.lib.newevent 
-from sans.guicomm.events import StatusEvent    
+from sans.guicomm.events import StatusEvent 
+   
+#Control panel width 
+if sys.platform.count("win32")>0:
+    PANEL_WID = 420
+else:
+    PANEL_WID = 490
 
             
@@ -67,7 +73,8 @@
         self.sizer2 = wx.BoxSizer(wx.VERTICAL)
         self.sizer3 = wx.BoxSizer(wx.VERTICAL)
-        self.sizer1.SetMinSize((375,-1))
-        self.sizer2.SetMinSize((375,-1))
-        self.sizer3.SetMinSize((375,-1))
+
+        self.sizer1.SetMinSize((PANEL_WID,-1))
+        self.sizer2.SetMinSize((PANEL_WID,-1))
+        self.sizer3.SetMinSize((PANEL_WID,-1))
         self.vbox.Add(self.sizer1)
         self.vbox.Add(self.sizer2)
@@ -75,5 +82,5 @@
         
     def set_scroll(self):
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         self.Layout()  
          
@@ -107,5 +114,5 @@
               
                 self.sizer2.Layout()
-                self.SetScrollbars(20,20,200,100)
+                self.SetScrollbars(20,20,25,65)
                 self.constraints_list.remove(item)
                 self.nb_constraint -= 1
@@ -226,5 +233,5 @@
         #------------------------------------------------------
         if len(self.page_finder)==0:
-            sizer_title.Add(wx.StaticText(self,-1," No fit combination available !"))
+            sizer_title.Add(wx.StaticText(self,-1," No fit combinations are found!"))
         else:
             ## store model  
@@ -253,5 +260,5 @@
         self.sizer1.Add(boxsizer1,1, wx.EXPAND | wx.ALL, 10)
         self.sizer1.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         self.AdjustScrollbars()
         
@@ -302,5 +309,5 @@
                 self.sizer_constraints.Layout()
                 self.sizer2.Layout()
-                self.SetScrollbars(20,20,200,100)
+                self.SetScrollbars(20,20,25,65)
                 return
             
@@ -310,5 +317,5 @@
             self.sizer_constraints.Layout()
             self.sizer2.Layout()
-            self.SetScrollbars(20,20,200,100)
+            self.SetScrollbars(20,20,25,65)
             return
             
@@ -357,5 +364,5 @@
         self.sizer_constraints.Layout()
         self.sizer2.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         
     def _hide_constraint(self): 
@@ -376,5 +383,5 @@
         self.sizer_constraints.Layout()    
         self.sizer2.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         self.AdjustScrollbars()    
                 
@@ -404,5 +411,5 @@
        
         self.sizer2.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         
         
@@ -427,5 +434,5 @@
         
         self.sizer2.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         
         
@@ -486,5 +493,5 @@
         self.sizer3.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10)
         self.sizer3.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         
     def _fill_sizer_constraint(self):
@@ -539,5 +546,5 @@
         self.sizer2.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10)
         self.sizer2.Layout()
-        self.SetScrollbars(20,20,200,100)
+        self.SetScrollbars(20,20,25,65)
         
         
Index: sansview/perspectives/fitting/sldPanel.py
===================================================================
--- sansview/perspectives/fitting/sldPanel.py	(revision 6c5239c5a17df3882490924782e95ac4b192b7fc)
+++ sansview/perspectives/fitting/sldPanel.py	(revision c99a6c514c56374f21266b358ae99f1145058839)
@@ -14,4 +14,12 @@
 _STATICBOX_WIDTH = 350
 _SCALE = 1e-6
+
+#SLD panel size 
+if sys.platform.count("win32")>0:
+    _STATICBOX_WIDTH = 350
+    PANEL_SIZE = 400
+else:
+    _STATICBOX_WIDTH = 380
+    PANEL_SIZE = 430
 
 class SldPanel(wx.Panel):
@@ -35,4 +43,9 @@
             Draw window content
         """
+        unit_a = '[A]'
+        unit_density = '[g/cm^(3)]'
+        unit_sld= '[1/A^(2)]'
+        unit_cm1='[1/cm]'
+        unit_cm='[cm]'
         sizer_input = wx.GridBagSizer(5,5)
         sizer_output = wx.GridBagSizer(5,5)
@@ -46,11 +59,13 @@
         boxsizer1.SetMinSize((_STATICBOX_WIDTH,-1))
         
-        compound_txt = wx.StaticText(self, -1, 'Compound')
+        compound_txt = wx.StaticText(self, -1, 'Compound ')
         self.compound_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
-        density_txt = wx.StaticText(self, -1, 'Density(g/cm^3)')
+        density_txt = wx.StaticText(self, -1, 'Density ')
         self.density_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
-        wavelength_txt = wx.StaticText(self, -1, 'Wavelength (A)')
+        unit_density_txt = wx.StaticText(self, -1, unit_density)
+        wavelength_txt = wx.StaticText(self, -1, 'Wavelength ')
         self.wavelength_ctl = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,-1))
         self.wavelength_ctl.SetValue(str(self.wavelength))
+        unit_a_txt = wx.StaticText(self, -1, unit_a)
         iy = 0
         ix = 0
@@ -67,4 +82,7 @@
         sizer_input.Add(self.density_ctl,(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_input.Add(unit_density_txt,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
         iy += 1
         ix = 0
@@ -73,4 +91,7 @@
         ix +=1
         sizer_input.Add(self.wavelength_ctl,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        sizer_input.Add(unit_a_txt,(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
         boxsizer1.Add( sizer_input )
@@ -81,7 +102,4 @@
         boxsizer2.SetMinSize((_STATICBOX_WIDTH,-1))
         
-        unit_a= '[A^(-2)]'
-        unit_cm1='[cm^(-1)]'
-        unit_cm='[cm]'
         i_complex= '+ i'
         neutron_sld_txt = wx.StaticText(self, -1, 'Neutron SLD')
@@ -92,5 +110,5 @@
         self.neutron_sld_im_ctl.SetEditable(False)
         self.neutron_sld_im_ctl.SetToolTipString("Neutron SLD imaginary.")
-        neutron_sld_units_txt = wx.StaticText(self, -1, unit_a)
+        neutron_sld_units_txt = wx.StaticText(self, -1, unit_sld)
         
         cu_ka_sld_txt = wx.StaticText(self, -1, 'Cu Ka SLD')
@@ -101,5 +119,5 @@
         self.cu_ka_sld_im_ctl.SetEditable(False)
         self.cu_ka_sld_im_ctl.SetToolTipString("Cu Ka SLD imaginary.")
-        cu_ka_sld_units_txt = wx.StaticText(self, -1, unit_a)
+        cu_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
         
         mo_ka_sld_txt = wx.StaticText(self, -1, 'Mo Ka SLD')
@@ -110,5 +128,5 @@
         self.mo_ka_sld_im_ctl.SetEditable(False)
         self.mo_ka_sld_im_ctl.SetToolTipString("Mo Ka SLD reel.")
-        mo_ka_sld_units_txt = wx.StaticText(self, -1, unit_a)
+        mo_ka_sld_units_txt = wx.StaticText(self, -1, unit_sld)
         
         neutron_inc_txt = wx.StaticText(self, -1, 'Neutron Inc. Xs')
@@ -339,5 +357,5 @@
 class SldWindow(wx.Frame):
     def __init__(self, parent=None, id=1, title="SLD Calculator",base=None):
-        wx.Frame.__init__(self, parent, id, title, size=(400, 400))
+        wx.Frame.__init__(self, parent, id, title, size=( PANEL_SIZE,  PANEL_SIZE))
         
         self.panel = SldPanel(self, base=base)
