Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
+++ sansview/perspectives/fitting/basepage.py	(revision b787e68c1ba3f939b02051b4663e38eee6a12ab3)
@@ -15,9 +15,11 @@
         This class provide general structure of  fitpanel page
     """
+     ## Internal name for the AUI manager
+    window_name = "Basic Page"
+    ## Title to appear on top of the window
+    window_caption = "Basic page "
     
     def __init__(self,parent, page_info):
         wx.ScrolledWindow.__init__(self, parent)
-        ## store name
-        self.name = page_info.name
         ##window_name
         self.window_name = page_info.window_name
@@ -177,6 +179,5 @@
         self.polydisp= sans.models.dispersion_models.models
         self.disp_box = wx.ComboBox(self, -1)
-        self.disp_box.SetValue("GaussianModel")
-        
+       
         for key in self.polydisp.iterkeys():
             name = str(key.__name__)
@@ -184,7 +185,9 @@
                 # Remove the option until the rest of the code is ready for it
                 self.disp_box.Append("Select customized Model",key)
-                pass  
+                
             else:
-                self.disp_box.Append(name,key) 
+                self.disp_box.Append(name,key)
+        self.disp_box.SetSelection(0) 
+        
         wx.EVT_COMBOBOX(self.disp_box,-1, self._on_select_Disp) 
              
@@ -439,4 +442,8 @@
         if hasattr(self,"enable_smearer"):
             self.state.enable_smearer = self.enable_smearer.GetValue()   
+            
+        if hasattr(self,"disp_box"):
+            self.state.disp_box = self.disp_box.GetCurrentSelection()
+        self._save_plotting_range()
       
         ## save checkbutton state and txtcrtl values
@@ -454,18 +461,28 @@
     def reset_page(self, state):
         """
-            Use page_info and change the state of existing button
+            Use page_state and change the state of existing page
         """
         self.state = state.clone()
         self.model= self.state.model
         self.data = self.state.data
+       
+        ##model parameter values restore
         self._set_model_sizer_selection( self.model )
         self.set_model_param_sizer(self.model)
+        
+        ## display dispersion info layer
+        self.enable_disp.SetValue(self.state.enable_disp)
+        if hasattr(self, "disp_box"):
+            self.disp_box.SetSelection(self.state.disp_box)  
+        self._set_dipers_Param(event=None)
+       
+        ## smearing info  restore
+        if hasattr(self,"enable_smearer"):
+            self.enable_smearer.SetValue(state.enable_smearer)
+        
+        ##plotting range restore    
         self._reset_plotting_range()
         
-        self.enable_disp.SetValue(self.state.enable_disp)
-        self._set_dipers_Param(event=None)
-        
-        if hasattr(self,"enable_smearer"):
-            self.enable_smearer= self.state.enable_smearer
+        ## reset state of checkbox,textcrtl  and parameters value
         if hasattr(self, "cb1"):    
             self.cb1.SetValue(self.state.cb1)
@@ -473,4 +490,6 @@
         self._reset_parameters_state(self.fittable_param,state.fittable_param)
         self._reset_parameters_state(self.fixed_param,state.fixed_param)
+        
+        ## draw the model with previous parameters value
         self._draw_model()
         
@@ -497,5 +516,6 @@
         self.qmax.SetValue(format_number(self.state.qmax)) 
         if self.state.npts!=None:
-            self.npts= self.state.npts
+            self.npts.SetValue(format_number(self.state.npts)) 
+            self.num_points = float(self.state.npts)
             
         self.qmin_x = float(self.qmin.GetValue())
@@ -507,8 +527,8 @@
             save the state of plotting range 
         """
-        self.state.qmin = self.qmin.GetValue()   
-        self.state.qmax = self.qmax.GetValue()   
+        self.state.qmin = self.qmin_x
+        self.state.qmax = self.qmax_x 
         if self.npts!=None:
-            self.state.npts= self.npts.GetValue()
+            self.state.npts= self.num_points
             
             
@@ -520,5 +540,5 @@
         """
         if self.model !=None:
-            self.save_current_state()
+            
             # Flag to register when a parameter has changed.
             is_modified = False
@@ -547,4 +567,7 @@
                     self.num_points = float(self.npts.GetValue())
                     is_modified = True
+            ## save current state
+            self.save_current_state()
+            
             ## if any value is modify draw model with new value
             if is_modified:
@@ -596,4 +619,5 @@
                 else:
                     item_page[6].Hide()
+                            
                             
     def _copy_parameters_state(self, listtocopy, statelist):
@@ -1053,5 +1077,6 @@
                 else:
                     ## set gaussian sizer 
-                    self._set_sizer_gaussian()  
+                    #self._set_sizer_gaussian()  
+                    self._on_select_Disp(event=None)
             else:
                 self.model_disp.Hide()
@@ -1117,5 +1142,7 @@
              self.disp_list should change type later .now only gaussian
         """
-        dispersity  =event.GetClientData()
+        
+        n = self.disp_box.GetCurrentSelection()
+        dispersity= self.disp_box.GetClientData(n)
         name= dispersity.__name__
         if name == "GaussianDispersion":
@@ -1125,6 +1152,10 @@
             self._set_sizer_arraydispersion()
         
-            
-    
+        self.state.disp_box= n
+        ## post state to fit panel
+        event = PageInfoEvent(page = self)
+        wx.PostEvent(self.parent, event)
+        
+        
     def _set_sizer_arraydispersion(self):
         """
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
+++ sansview/perspectives/fitting/fitpage.py	(revision b787e68c1ba3f939b02051b4663e38eee6a12ab3)
@@ -10,5 +10,8 @@
 from sans.guiframe.utils import format_number
 
+## event to post model to fit to fitting plugins
 (ModelEventbox, EVT_MODEL_BOX) = wx.lib.newevent.NewEvent()
+
+## event to know the selected fit engine
 (FitterTypeEvent, EVT_FITTER_TYPE)   = wx.lib.newevent.NewEvent()
 _BOX_WIDTH = 80
@@ -16,4 +19,5 @@
 import basepage
 from basepage import BasicPage
+from basepage import PageInfoEvent
 
 
@@ -31,6 +35,4 @@
             Initialization of the Panel
         """
-        self.name = self.data.name
-        
         ## fit page does not content npts txtcrtl
         self.npts=None
@@ -39,12 +41,10 @@
         ## default fitengine type
         self.engine_type = "scipy"
-        
+        ## draw sizer
         self._fill_datainfo_sizer()
-        
         self._fill_model_sizer( self.sizer1)
         self._on_select_model(event=None)
         self._fill_range_sizer() 
-        
-       
+    
         ## to update the panel according to the fit engine type selected
         self.Bind(EVT_FITTER_TYPE,self._on_engine_change)
@@ -515,7 +515,9 @@
                 wx.PostEvent(self.manager.parent, StatusEvent(status=\
                             "Data contains smearing information %s"%msg))
-            self.manager.set_smearer(smear, qmin= self.qmin_x, qmax= self.qmax_x)   
+            self.manager.set_smearer(smear, qmin= float(self.qmin_x),
+                                      qmax= float(self.qmax_x))   
         ## save the state enable smearing
         self.save_current_state()
+        
   
     def compute_chisqr2D(self):
Index: sansview/perspectives/fitting/fitpanel.py
===================================================================
--- sansview/perspectives/fitting/fitpanel.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
+++ sansview/perspectives/fitting/fitpanel.py	(revision b787e68c1ba3f939b02051b4663e38eee6a12ab3)
@@ -96,5 +96,5 @@
         """
         state = self.get_current_page().createMemento()
-        page_name = self.get_current_page().name
+        page_name = self.get_current_page().window_name
         page_finder = self.manager.get_page_finder() 
         fitproblem = None
@@ -103,5 +103,4 @@
             fitproblem= page_finder[self.get_current_page()]
             
-        self.manager._add_page_onmenu(page_name, fitproblem)
         
         selected_page = self.GetPage(self.GetSelection())
@@ -114,8 +113,9 @@
             
             #Delete the page from notebook
-            if selected_page.name in self.list_fitpage_name:
-                self.list_fitpage_name.remove(selected_page.name)
-                
-            if selected_page.name== self.draw_model_name:
+            if selected_page.window_name in self.list_fitpage_name:
+                self.list_fitpage_name.remove(selected_page.window_name)
+           
+            if selected_page.window_name== "Model":
+                fitproblem = self.get_current_page().model.clone()
                 self.draw_model_name=None
                 self.model_page=None
@@ -128,5 +128,8 @@
             self.about_page=None
         else:
-            self.manager.sim_page=None  
+            self.manager.sim_page=None 
+        ## page on menu
+        self.manager._add_page_onmenu(page_name, fitproblem)
+        
         
         
@@ -177,5 +180,5 @@
             Add a fitting page on the notebook contained by fitpanel
             @param data: data to fit
-            @return panel : page just added for futher used. is used by fitting module
+            @return panel : page just added for further used. is used by fitting module
         """     
         try:
@@ -188,11 +191,12 @@
             myinfo.event_owner = self.event_owner 
             myinfo.manager = self.manager
-            myinfo.window_name = "Fit Page"
-            myinfo.window_caption = "Fit Page"
+            myinfo.window_name = name
+            myinfo.window_caption = name
         
             #if not name in self.fit_page_name :
             from fitpage import FitPage
             panel = FitPage(parent= self, page_info=myinfo)
-            self.AddPage(page=panel,caption=name,select=True)
+            
+            self.AddPage(page=panel, caption=name, select=True)
             self.list_fitpage_name.append(name)
             if reset:
@@ -209,6 +213,6 @@
         
    
-    def add_model_page(self,model,page_title, qmin=0, qmax=0.1,
-                        npts=50, topmenu=False,page_info=None):
+    def add_model_page(self,model, qmin=0, qmax=0.1,
+                        npts=50, topmenu=False, reset=False):
         """
             Add a model page only one  to display any model selected from the menu or the page combo box.
@@ -224,12 +228,10 @@
         if topmenu==True:
             if  self.draw_model_name ==None:
-                self._help_add_model_page(model,page_title, 
-                                qmin=qmin, qmax=qmax, npts=npts, page_info=page_info)
+                self._help_add_model_page(model=model,
+                                qmin=qmin, qmax=qmax, npts=npts, reset=reset)
             else:
                 self.model_page.select_model(model, page_title)
-        else:
-            if  self.draw_model_name ==None:
-                self._create_model_page(model,page_title, qmin=qmin, qmax=qmax,
-                                         npts=npts, page_info=page_info)
+       
+      
            
     def  _onGetstate(self, event):
@@ -238,10 +240,10 @@
         """
         page= event.page
-        if page.name in self.fit_page_name:
-            self.fit_page_name[page.name].insert(0,page.createMemento()) 
+        if page.window_name in self.fit_page_name:
+            self.fit_page_name[page.window_name].insert(0,page.createMemento()) 
             
                 
-    def _help_add_model_page(self,model,page_title, qmin=0, 
-                             qmax=0.1, npts=50,page_info=None):
+    def _help_add_model_page(self,model,page_title="Model", qmin=0, 
+                             qmax=0.1, npts=50,reset= False):
         """
             #TODO: fill in description
@@ -251,42 +253,35 @@
             @param npts: number of Q points
         """
-        self._create_model_page(model,page_title,qmin=qmin, qmax=qmax,
-                                 npts=npts,page_info= page_info)
+        ## creating object that contaning info about model 
+        myinfo = PageInfo(model= model ,name= page_title)
+        myinfo.model_list_box = self.model_list_box.get_list()
+        myinfo.event_owner = self.event_owner 
+        myinfo.manager = self.manager
+        myinfo.window_name = page_title
+        myinfo.window_caption = page_title
+      
+        from modelpage import ModelPage
+        panel = ModelPage(self,myinfo)
+        
+        self.AddPage(page=panel,caption=page_title,select=True)
+
+        self.model_page_number=self.GetSelection()
+        self.model_page=self.GetPage(self.GetSelection())
+        # Set the range used to plot models
+        self.model_page.set_range(qmin, qmax, npts)
+        ##  resetting page
+        if reset:
+            if page_title in self.fit_page_name.keys():
+                
+                memento= self.fit_page_name[page_title][0]
+                panel.reset_page(memento)
+        else:
+            self.fit_page_name[page_title]=[]
+            self.fit_page_name[page_title].insert(0,panel.createMemento())
+         
         # We just created a model page, we are ready to plot the model
         #self.manager.draw_model(model, model.name)
         #FOR PLUGIN  for some reason model.name is = BASEcomponent
         self.manager.draw_model(model)
-    
-    def _create_model_page(self,model,page_title, qmin, qmax, npts,page_info=None):
-        """
-        adding model page occurs here
-        """
-        ## creating object that contaning info about model 
-        if page_info==None:
-            
-            myinfo = PageInfo(model=model ,name=page_title)
-            myinfo.model_list_box = self.model_list_box.get_list()
-            myinfo.event_owner = self.event_owner 
-            myinfo.manager = self.manager
-            myinfo.window_name = "Model Page"
-            myinfo.window_caption = "Model Page"
-        else:
-            myinfo = page_info
-    
-        from modelpage import ModelPage
-        panel = ModelPage(self,myinfo)
-       
-        self.AddPage(page=panel,caption="Model",select=True)
-
-        self.draw_model_name=page_title
-        self.model_page_number=self.GetSelection()
-        self.model_page=self.GetPage(self.GetSelection())
-        
-        
-        # Set the range used to plot models
-        self.model_page.set_range(qmin, qmax, npts)
-        
-        
   
-   
- 
+  
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
+++ sansview/perspectives/fitting/fitting.py	(revision b787e68c1ba3f939b02051b4663e38eee6a12ab3)
@@ -471,6 +471,5 @@
             if event.GetId() in value:
                 id,fitproblem = value
-                
-                if name !="Model Page":
+                if name !="Model":
                     data= fitproblem.get_fit_data()
                     page = self.fit_panel.add_fit_page(data= data,reset=True)
@@ -478,7 +477,7 @@
                         self.page_finder[page]=fitproblem
                 else:
-                    model= page_info.model
-                    self.fit_panel.add_model_page(model,model.name,topmenu=False,
-                                                  page_info=page_info)
+                    model = fitproblem
+                    self.fit_panel.add_model_page(model=model, topmenu=True,
+                                                  reset= True)
                     break
         
@@ -787,7 +786,4 @@
             @param evt: wx.menu event
         """
-        name = evt.model.__class__.__name__
-        if hasattr(evt.model, "name"):
-            name = evt.model.name
         model = evt.model
      
@@ -795,5 +791,5 @@
         # will be plotted automatically. If a page already exists,
         # the content will be updated and the plot refreshed
-        self.fit_panel.add_model_page(model,name,topmenu=True)
+        self.fit_panel.add_model_page(model,topmenu=True)
     
    
Index: sansview/perspectives/fitting/modelpage.py
===================================================================
--- sansview/perspectives/fitting/modelpage.py	(revision b94a0a6f68081523253dfa7579d5f384f5e303e3)
+++ sansview/perspectives/fitting/modelpage.py	(revision b787e68c1ba3f939b02051b4663e38eee6a12ab3)
@@ -24,11 +24,9 @@
   
     """
-    def __init__(self,parent, page_info, name=""):
+    def __init__(self,parent, page_info):
         BasicPage.__init__(self, parent, page_info)
         """ 
             Initialization of the Panel
         """
-        self.name ="Model"
-        page_info.page_name= "Model Page"
         self._fill_model_sizer( self.sizer1)  
         self._fill_range_sizer() 
@@ -251,7 +249,4 @@
         """
         self.model = model
-        self.parent.model_page.name = name
-        self.parent.draw_model_name = name
-        
         self.set_model_param_sizer(self.model)
         self._draw_model()
Index: sansview/perspectives/fitting/pagestate.py
===================================================================
--- sansview/perspectives/fitting/pagestate.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
+++ sansview/perspectives/fitting/pagestate.py	(revision b787e68c1ba3f939b02051b4663e38eee6a12ab3)
@@ -51,5 +51,6 @@
         self.formfactorcombobox = ""
         self.structurecombobox  = ""
-        self.disp_box=""
+        ## the indice of the current selection
+        self.disp_box = 0
         ## Qrange
         ## Q range
@@ -70,6 +71,5 @@
         """
         self.data = copy.deepcopy(data)
-    
-    
+
         
     def clone(self):
@@ -86,8 +86,12 @@
         obj.fixed_param = copy.deepcopy(self.fixed_param)
         obj.fittable_param = copy.deepcopy(self.fittable_param)
-        obj.enable_disp= self.enable_disp
-        obj.enable_smearer = self.enable_smearer
-        obj.disp_box= copy.deepcopy(self.disp_box)
-        obj.cb1 = self.cb1
+        obj.enable_disp = copy.deepcopy(self.enable_disp)
+        obj.enable_smearer = copy.deepcopy(self.enable_smearer)
+        obj.disp_box = copy.deepcopy(self.disp_box)
+        obj.qmin = copy.deepcopy(self.qmin)
+        obj.qmax = copy.deepcopy(self.qmax)
+        obj.npts = copy.deepcopy(self.npts )
+        obj.cb1 = copy.deepcopy(self.cb1)
+        
         return obj
 
