Index: sansview/perspectives/fitting/basepage.py
===================================================================
--- sansview/perspectives/fitting/basepage.py	(revision 87a43fedbdc7b6600d724354da7ae1f6a5d7dd52)
+++ sansview/perspectives/fitting/basepage.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
@@ -6,5 +6,7 @@
 from sans.guiframe.utils import format_number
 from sans.guicomm.events import StatusEvent   
-
+import pagestate
+from pagestate import PageState
+(PageInfoEvent, EVT_PAGE_INFO)   = wx.lib.newevent.NewEvent()
 _BOX_WIDTH = 80
 
@@ -13,30 +15,28 @@
         This class provide general structure of  fitpanel page
     """
-    ## Internal name for the AUI manager
-    window_name = "Fit page"
-    ## Title to appear on top of the window
-    window_caption = "Fit Page"
-    
-    name=""
-    
-    def __init__(self,parent, pageinfo, name):
+    
+    def __init__(self,parent, page_info):
         wx.ScrolledWindow.__init__(self, parent)
         ## store name
-        self.name = name
-        ## store info of panel
-        self.page_info= pageinfo
-        self.page_info.page_name = name
+        self.name = page_info.name
+        ##window_name
+        self.window_name = page_info.window_name
+        ##window_caption
+        self.window_caption = page_info.window_caption
         ## parent of the page
         self.parent = parent
         ## manager is the fitting plugin
-        self.manager=None
+        self.manager= page_info.manager
         ## owner of the page (fitting plugin)
-        self.event_owner= None
-        ## create the basic structure of the panel with empty sizer
-        self.define_page_structure()
+        self.event_owner= page_info.event_owner
+         ## current model
+        self.model = page_info.model
+        ## data
+        self.data = page_info.data
         ## dictionary containing list of models
-        self.model_list_box={}
+        self.model_list_box = page_info.model_list_box
         ## Data member to store the dispersion object created
         self._disp_obj_dict = {}
+        ## selected parameters to apply dispersion
         self.disp_cb_dict ={}
         ##list of model parameters. each item must have same length
@@ -52,31 +52,23 @@
         ##list of dispersion parameters
         self.disp_list=[]
-        
+        if self.model !=None:
+            self.disp_list= self.model.getDispParamList()
         ##enable model 2D draw
         self.enable2D= False
         ## check that the fit range is correct to plot the model again
         self.fitrange= True
-        ## current model
-        self.model= None
-        ## data
-        self.data=None
         ## Q range
         self.qmin_x= 0.001
         self.qmax_x= 0.1
         self.num_points= 100
-        ## changing initial values given page_info value
-        if self.page_info !=None and len(self.page_info.model_list_box) >0:
-            self.model_list_box = self.page_info.model_list_box
-            ## current model
-            self.model=self.page_info.model
-            self.data = self.page_info.data
-            self.event_owner = self.page_info.event_owner
-            self.manager=self.page_info.manager
-            
-            if self.model !=None:
-                self.disp_list= self.model.getDispParamList()
+        ## Create memento to save the current state
+        
+        self.state= PageState(parent= self.parent,model=self.model, data=self.data)
+        ## create the basic structure of the panel with empty sizer
+        self.define_page_structure()
         ## drawing Initial dispersion parameters sizer 
         self.set_dispers_sizer()
         self._fill_save_sizer()
+        
         ## layout
         self.set_layout()
@@ -134,5 +126,5 @@
         """
         self.event_owner = owner    
-        self.page_info.event_owner = owner
+        self.state.event_owner = owner
   
     def set_manager(self, manager):
@@ -142,5 +134,5 @@
         """
         self.manager = manager  
-        self.page_info.manager = manager
+        self.state.manager = manager
         
     def populate_box(self, dict):
@@ -150,6 +142,5 @@
         """
         self.model_list_box = dict
-        if self.page_info!=None:
-            self.page_info.model_list_box = self.model_list_box
+        self.state.model_list_box = self.model_list_box
             
     
@@ -165,4 +156,7 @@
         self.disable_disp = wx.RadioButton(self, -1, 'No', (10, 10), style=wx.RB_GROUP)
         self.enable_disp = wx.RadioButton(self, -1, 'Yes', (10, 30))
+        ## saving the state of enable dispersity button
+        self.state.enable_disp= self.enable_disp.GetValue()
+        
         self.Bind(wx.EVT_RADIOBUTTON, self._set_dipers_Param, id=self.disable_disp.GetId())
         self.Bind(wx.EVT_RADIOBUTTON, self._set_dipers_Param, id=self.enable_disp.GetId())
@@ -278,6 +272,6 @@
             save history of the data and model
         """
-        self.page_info.model= self.model
-        self.page_info.data = self.data
+        self.state.model= self.model
+        self.state.data = self.data
         import os
                  
@@ -363,4 +357,5 @@
             after fitting
         """
+        
         if hasattr(self,"text2_3"):
             self.text2_3.Hide()
@@ -420,6 +415,65 @@
         except:
             raise 
-     
-    
+    
+    
+    def createMemento(self):
+        """
+            return the current state of the page
+        """
+        return self.state.clone()
+    
+    
+    def save_current_state(self):
+        """
+            Store current state
+        """
+        self.state.model = self.model.clone()
+        self.state.save_data(self.data)
+    
+        if hasattr(self,"cb1"):
+            self.state.cb1= self.cb1.GetValue()
+            
+        if hasattr(self,"enable_disp"):
+            self.state.enable_disp= self.enable_disp.GetValue()
+            
+        if hasattr(self,"enable_smearer"):
+            self.state.enable_smearer = self.enable_smearer.GetValue()   
+      
+        ## save checkbutton state and txtcrtl values
+        self.state.parameters=[]
+        self.state.fittable_param=[]
+        self.state.fixed_param=[]
+        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)
+        
+        ## post state to fit panel
+        event = PageInfoEvent(page = self)
+        wx.PostEvent(self.parent, event)
+    
+    def reset_page(self, state):
+        """
+            Use page_info and change the state of existing button
+        """
+        self.state = state.clone()
+        self.model= self.state.model
+        self.data = self.state.data
+        self._set_model_sizer_selection( self.model )
+        self.set_model_param_sizer(self.model)
+        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
+        if hasattr(self, "cb1"):    
+            self.cb1.SetValue(self.state.cb1)
+        self._reset_parameters_state(self.parameters,state.parameters)
+        self._reset_parameters_state(self.fittable_param,state.fittable_param)
+        self._reset_parameters_state(self.fixed_param,state.fixed_param)
+        self._draw_model()
+        
+        
     def _selectDlg(self):
         """
@@ -433,6 +487,30 @@
         dlg.Destroy()
         return path
-          
-    
+    
+    
+    def _reset_plotting_range(self):
+        """
+            Reset the plotting range to a given state
+        """
+        
+        self.qmin.SetValue(format_number(self.state.qmin))
+        self.qmax.SetValue(format_number(self.state.qmax)) 
+        if self.state.npts!=None:
+            self.npts= self.state.npts
+            
+        self.qmin_x = float(self.qmin.GetValue())
+        self.qmax_x = float(self.qmax.GetValue())
+        
+        
+    def _save_plotting_range(self ):
+        """
+            save the state of plotting range 
+        """
+        self.state.qmin = self.qmin.GetValue()   
+        self.state.qmax = self.qmax.GetValue()   
+        if self.npts!=None:
+            self.state.npts= self.npts.GetValue()
+            
+            
     def _onparamEnter_helper(self):
         """
@@ -442,5 +520,5 @@
         """
         if self.model !=None:
-            
+            self.save_current_state()
             # Flag to register when a parameter has changed.
             is_modified = False
@@ -449,4 +527,5 @@
             is_modified =self._check_value_enter( self.parameters ,is_modified)        
            
+            
             self.Layout()
             # Here we should check whether the boundaries have been modified.
@@ -473,4 +552,93 @@
                 
                 
+    def _reset_parameters_state(self, listtorestore,statelist):
+        """
+            Reset the parameters at the given state
+        """
+        if len(self.state.parameters)!=  len(listtorestore) :
+            return
+        for j in range(len(listtorestore)):
+            item_page = listtorestore[j]
+            item_page_info = statelist[j]
+            ##change the state of the check box for simple parameters
+            if item_page[0]!=None:
+                item_page[0].SetValue(item_page_info[0])
+    
+            if item_page[2]!=None:
+                item_page[2].SetValue(item_page_info[2])
+                
+            if item_page[3]!=None:
+                ## show or hide text +/-
+                if item_page_info[2]:
+                    item_page[3].Show(True)
+                else:
+                    item_page[3].Hide()
+            if item_page[4]!=None:
+                ## show of hide the text crtl for fitting error
+                if item_page_info[4][0]:
+                    item_page[4].Show(True)
+                    item_page[4].SetValue(item_page_info[4][1])
+                else:
+                    item_page[3].Hide()
+            if item_page[5]!=None:
+                ## show of hide the text crtl for fitting error
+                if item_page_info[5][0]:
+                    item_page[5].Show(True)
+                    item_page[5].SetValue(item_page_info[4][1])
+                else:
+                    item_page[5].Hide()
+                    
+            if item_page[6]!=None:
+                ## show of hide the text crtl for fitting error
+                if item_page_info[6][0]:
+                    item_page[6].Show(True)
+                    item_page[6].SetValue(item_page_info[6][1])
+                else:
+                    item_page[6].Hide()
+                            
+    def _copy_parameters_state(self, listtocopy, statelist):
+        """
+            copy the state of button 
+            @param listtocopy: the list of check button to copy
+            @param statelist: list of state object to store the current state
+        """
+        if len(listtocopy)==0:
+            return
+        
+        for item in listtocopy:
+            checkbox_state = None
+            if item[0]!= None:
+                checkbox_state= item[0].GetValue()
+            parameter_name = item[1]
+            parameter_value = None
+            if item[2]!=None:
+                parameter_value = item[2].GetValue()
+            static_text = None
+            if item[3]!=None:
+                static_text = item[3].IsShown()
+            error_value = None
+            error_state = None
+            if item[4]!= None:
+                error_value = item[4].GetValue()
+                error_state = item[4].IsShown()
+                
+            min_value = None
+            min_state = None
+            if item[5]!= None:
+                min_value = item[5].GetValue()
+                min_state = item[5].IsShown()
+                
+            max_value = None
+            max_state = None
+            if item[6]!= None:
+                max_value = item[6].GetValue()
+                max_state = item[6].IsShown()
+               
+            statelist.append([checkbox_state, parameter_name, parameter_value,
+                              static_text ,[error_state,error_value],
+                                [min_state,min_value],[max_state , max_value],None])
+           
+        
+   
     def _set_model_sizer_selection(self, model):
         """
@@ -565,5 +733,4 @@
                     
         
-        
     def _draw_model(self):
         """
@@ -606,11 +773,5 @@
                             id= self.plugin_rbutton.GetId() )  
         wx.EVT_CHECKBOX(self, self.multip_cb.GetId() , self._show_combox )              
-        ## store state
-        self.page_info.save_radiobox_state( self.shape_rbutton )
-        self.page_info.save_radiobox_state( self.shape_indep_rbutton )
-        self.page_info.save_radiobox_state( self.struct_rbutton )
-        self.page_info.save_radiobox_state( self.plugin_rbutton )
-       
-        
+      
         sizer_radiobutton = wx.GridSizer(3, 3,5, 5)
         sizer_radiobutton.Add(self.shape_rbutton)
@@ -674,9 +835,4 @@
             Show combox box associate with type of model selected
         """
-        self.page_info.save_radiobox_state( self.shape_rbutton )
-        self.page_info.save_radiobox_state( self.shape_indep_rbutton )
-        self.page_info.save_radiobox_state( self.struct_rbutton )
-        self.page_info.save_radiobox_state( self.plugin_rbutton )
-        
         ## Don't want to populate combo box again if the event comes from check box
         if self.shape_rbutton.GetValue()and\
@@ -758,6 +914,4 @@
         
         self.set_scroll()
-        
-        
    
             
@@ -781,5 +935,5 @@
         except:
             pass
-        #wx.EVT_COMBOBOX(combobox,-1, self._on_select_model) 
+    
         return 0
    
@@ -811,5 +965,7 @@
         else:
             self.model= form_factor()
-        self.page_info.model= self.model
+       
+        ## post state to fit panel
+        self.save_current_state()
        
         
@@ -842,5 +998,5 @@
                     if format_number(item[5].GetValue())!="NaN":
                         param_min = float(item[5].GetValue())
-                    self.model.details[name][1]=param_min
+                    
                 ## check maximum value
                 if item[6]!= None:
@@ -854,6 +1010,6 @@
                         msg+= "name %s of model %s "%(name, self.model.name)
                         wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
-                    
-                self.model.details[name][1:]= param_min,param_max
+                if name in self.model.details.keys():   
+                    self.model.details[name][1:]= param_min,param_max
                 
                 ## hide statictext +/-    
@@ -878,5 +1034,4 @@
         return is_modified 
         
-        
  
     def _set_dipers_Param(self, event):
@@ -889,4 +1044,5 @@
             return 
         else:
+           
             if self.enable_disp.GetValue():
                 self.model_disp.Show(True)
@@ -903,4 +1059,8 @@
                 self.sizer4_4.Clear(True)
                 self._reset_dispersity()
+                
+          
+            ## post state to fit panel
+            self.save_current_state()
             
             self.sizer4.Layout()
@@ -908,5 +1068,4 @@
             self.SetScrollbars(20,20,200,100)
             
-   
         
     def _layout_sizer_noDipers(self):
@@ -929,5 +1088,4 @@
         return 
     
- 
             
     def _reset_dispersity(self):
@@ -966,6 +1124,5 @@
         if  name=="ArrayDispersion":
             self._set_sizer_arraydispersion()
-            
-            
+        
             
     
@@ -1038,5 +1195,6 @@
            boxsizer1.Add((10,10))
         boxsizer1.Add(sizer_horizontal)
-       
+        ## save state
+        self.save_current_state()
         #----------------------------------------------------------------
         self.sizer5.Add(boxsizer1,0, wx.EXPAND | wx.ALL, 10)
@@ -1044,4 +1202,5 @@
         self.Layout()
         self.SetScrollbars(20,20,200,100)
+    
     
     def _fill_save_sizer(self):
Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision dcf29d72fbb8dcfe3b667c7278083176f2a6cf45)
+++ sansview/perspectives/fitting/fitpage.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
@@ -26,12 +26,11 @@
   
     """
-    def __init__(self,parent, page_info, name=""):
-        BasicPage.__init__(self, parent, page_info,name)
+    def __init__(self,parent, page_info):
+        BasicPage.__init__(self, parent, page_info)
         """ 
             Initialization of the Panel
         """
-        self.name= self.data.name
-        page_info.page_name= self.data.name
-       
+        self.name = self.data.name
+        
         ## fit page does not content npts txtcrtl
         self.npts=None
@@ -42,9 +41,11 @@
         
         self._fill_datainfo_sizer()
+        
         self._fill_model_sizer( self.sizer1)
+        self._on_select_model(event=None)
         self._fill_range_sizer() 
-        self.model = self.formfactorbox.GetClientData(0)()
-        self.page_info.model= self.model
-        self._on_select_model(event=None)
+        
+       
+        ## to update the panel according to the fit engine type selected
         self.Bind(EVT_FITTER_TYPE,self._on_engine_change)
     
@@ -92,6 +93,6 @@
         """
         ## save state of radiobox
-        self.page_info. save_radiobox_state( self.description_hide )
-        self.page_info. save_radiobox_state( self.description_show )
+        #self.page_info. save_radiobox_state( self.description_hide )
+        #self.page_info. save_radiobox_state( self.description_show )
         ## Show description
         if not self.description_show.GetValue():
@@ -99,8 +100,10 @@
             
         else:
-            model=self.page_info.model
+            #model=self.page_info.model
+            
             description=""
-            if model!=None:
-                description = self.page_info.model.description
+            if self.model!=None:
+                description = self.model.description
+                #description = self.page_info.model.description
             self.description = wx.StaticText( self,-1,str(description) )
             self.sizer_description.Add( self.description, 1, wx.EXPAND | wx.ALL, 10 )
@@ -410,4 +413,5 @@
         self.compute_chisqr()
         
+        
     def get_range(self):
         """
@@ -512,5 +516,6 @@
                             "Data contains smearing information %s"%msg))
             self.manager.set_smearer(smear, qmin= self.qmin_x, qmax= self.qmax_x)   
-              
+        ## save the state enable smearing
+        self.save_current_state()
   
     def compute_chisqr2D(self):
@@ -593,4 +598,5 @@
         """
         self.param_toFit=[]
+        
         if  self.parameters !=[]:
             if  self.cb1.GetValue()==True:
@@ -608,5 +614,6 @@
                     item[0].SetValue(False)
                 self.param_toFit=[]
-               
+        self.save_current_state()  
+        
                 
                 
@@ -640,5 +647,7 @@
         else:
             self.cb1.SetValue(False)
-    
+        ## save current state of the page
+        self.save_current_state()
+        
     
     def set_model_description(self,description,sizer):
@@ -669,6 +678,6 @@
      
         
-        self.page_info.save_radiobox_state( self.description_hide )
-        self.page_info.save_radiobox_state( self.description_show )
+        #self.page_info.save_radiobox_state( self.description_hide )
+        #self.page_info.save_radiobox_state( self.description_show )
         
         sizer_selection.Add( self.description_show )
@@ -700,4 +709,5 @@
         self.sizer3.Clear(True)
         self.parameters = []
+        #self.page_info.parameters=[]
         self.param_toFit=[]
         self.fittable_param=[]
@@ -823,4 +833,7 @@
                 self.parameters.append([cb,item, ctl1,
                                         text2,ctl2, ctl3, ctl4,None])
+                #self.page_info.parameters.append([cb.GetValue(),item, ctl1.GetValue(),
+                #                        text2.IsShown(),[ctl2.IsShown(),ctl2.GetValue()],
+                #[ctl3.IsShown(),ctl3.GetValue()],[ ctl4.IsShown(),ctl4.GetValue()],None])
                 
         iy+=1
@@ -855,5 +868,5 @@
         data= Data1D(x=[1,2], y=[3,4], dy=[0.1, 0,1])
     
-        from pageInfo import PageInfo
+        from fitpanel import PageInfo
         myinfo = PageInfo(self,  model, data=data )
         
Index: sansview/perspectives/fitting/fitpanel.py
===================================================================
--- sansview/perspectives/fitting/fitpanel.py	(revision dcf29d72fbb8dcfe3b667c7278083176f2a6cf45)
+++ sansview/perspectives/fitting/fitpanel.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
@@ -6,6 +6,36 @@
 #import models
 _BOX_WIDTH = 80
-(PageInfoEvent, EVT_PAGE_INFO)   = wx.lib.newevent.NewEvent()
-
+import basepage
+
+class PageInfo(object):
+    """
+        this class contains the minimum numbers of data members
+        a fitpage or model page need to be initialized.
+    """
+    data = None
+    model= None
+    manager= None
+    event_owner= None
+    model_list_box = None
+    name=None
+     ## Internal name for the AUI manager
+    window_name = "Page"
+    ## Title to appear on top of the window
+    window_caption = "Page"
+    
+    def __init__(self, model=None,data=None, manager=None,
+                  event_owner=None,model_list_box=None , name=None):
+        """
+            Initialize data members
+        """
+        self.data = data
+        self.model= model
+        self.manager= manager
+        self.event_owner= event_owner
+        self.model_list_box = model_list_box
+        self.name=None
+        self.window_name = "Page"
+        self.window_caption = "Page"
+    
 class FitPanel(wx.aui.AuiNotebook):    
 
@@ -42,6 +72,8 @@
         ##dictionary of page info
         self.page_info_dict={}
-        # save the title of the last page tab added
-        self.fit_page_name=[]
+        ## save the title of the last page tab added
+        self.fit_page_name={}
+        ## list of existing fit page
+        self.list_fitpage_name=[]
         self.draw_model_name=None
         #model page info
@@ -50,4 +82,6 @@
         self.model_page=None
         self.sim_page=None
+        ## get the state of a page
+        self.Bind(basepage.EVT_PAGE_INFO, self._onGetstate)
         # increment number for model name
         self.count=0
@@ -61,6 +95,6 @@
              close page and remove all references to the closed page
         """
-        page_info = self.get_current_page().page_info.clone()
-        page_info.page_name = self.get_current_page().page_info.page_name
+        state = self.get_current_page().createMemento()
+        page_name = self.get_current_page().name
         page_finder = self.manager.get_page_finder() 
         fitproblem = None
@@ -69,5 +103,5 @@
             fitproblem= page_finder[self.get_current_page()]
             
-        self.manager._add_page_onmenu(page_info.page_name, page_info, fitproblem)
+        self.manager._add_page_onmenu(page_name, fitproblem)
         
         selected_page = self.GetPage(self.GetSelection())
@@ -80,6 +114,6 @@
             
             #Delete the page from notebook
-            if selected_page.name in self.fit_page_name:
-                self.fit_page_name.remove(selected_page.name)
+            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:
@@ -139,5 +173,5 @@
         return self.sim_page
         
-    def add_fit_page( self,data, page_info=None ):
+    def add_fit_page( self,data, reset=False ):
         """ 
             Add a fitting page on the notebook contained by fitpanel
@@ -149,21 +183,25 @@
         except:
             name = 'Fit'
-        if page_info==None:
-            from pageInfo import  PageInfo
-            myinfo = PageInfo( self, data=data )
+        if not name in self.list_fitpage_name:
+            myinfo = PageInfo( data=data, name=name )
             myinfo.model_list_box = self.model_list_box.get_list()
             myinfo.event_owner = self.event_owner 
             myinfo.manager = self.manager
-        else:
-            myinfo = page_info
-        
-        if not name in self.fit_page_name :
+            myinfo.window_name = "Fit Page"
+            myinfo.window_caption = "Fit Page"
+        
+            #if not name in self.fit_page_name :
             from fitpage import FitPage
-            panel = FitPage(parent= self, page_info=myinfo, name=name )
-            panel.name = name
-            panel.window_name= "fitpage"
+            panel = FitPage(parent= self, page_info=myinfo)
             self.AddPage(page=panel,caption=name,select=True)
-            self.fit_page_name.append(name)
-            
+            self.list_fitpage_name.append(name)
+            if reset:
+                if name in self.fit_page_name.keys():
+                    memento= self.fit_page_name[name][0]
+                    panel.reset_page(memento)
+            else:
+                self.fit_page_name[name]=[]
+                self.fit_page_name[name].insert(0,panel.createMemento())
+         
             return panel 
         else:
@@ -195,4 +233,12 @@
                                          npts=npts, page_info=page_info)
            
+    def  _onGetstate(self, event):
+        """
+            copy the state of a page
+        """
+        page= event.page
+        if page.name in self.fit_page_name:
+            self.fit_page_name[page.name].insert(0,page.createMemento()) 
+            
                 
     def _help_add_model_page(self,model,page_title, qmin=0, 
@@ -218,18 +264,19 @@
         ## creating object that contaning info about model 
         if page_info==None:
-            from pageInfo import  PageInfo
-            myinfo = PageInfo( self, model=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 = "Model Page"
+            myinfo.window_caption = "Model Page"
         else:
             myinfo = page_info
     
         from modelpage import ModelPage
-        panel = ModelPage(self,myinfo,page_title)
+        panel = ModelPage(self,myinfo)
        
         self.AddPage(page=panel,caption="Model",select=True)
 
-        panel.name = page_title
         self.draw_model_name=page_title
         self.model_page_number=self.GetSelection()
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision 0f5fe6b865dc85375df7d4b9a352bcebb44a5150)
+++ sansview/perspectives/fitting/fitting.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
@@ -447,5 +447,5 @@
               
               
-    def _add_page_onmenu(self, name, page_info,fitproblem=None):
+    def _add_page_onmenu(self, name,fitproblem=None):
         """
             Add name of a closed page of fitpanel in a menu 
@@ -454,5 +454,5 @@
         for item in list:
             if name == item.GetItemLabel():
-                self.closed_page_dict[name][1:] = page_info, fitproblem
+                self.closed_page_dict[name][1] = fitproblem
                 
         if not name in self.closed_page_dict.keys():    
@@ -460,5 +460,5 @@
             event_id = wx.NewId()
             self.menu1.Append(event_id, name, "Show %s fit panel" % name)
-            self.closed_page_dict[name]= [event_id,page_info, fitproblem]
+            self.closed_page_dict[name]= [event_id, fitproblem]
             wx.EVT_MENU(self.parent,event_id,  self._open_closed_page)
         
@@ -468,11 +468,11 @@
             reopen a closed page
         """
-        for value in self.closed_page_dict.values():
+        for name, value in self.closed_page_dict.iteritems():
             if event.GetId() in value:
-                id, page_info,fitproblem = value
-        
-                if page_info.page_name !="Model Page":
-                    page = self.fit_panel.add_fit_page(data= page_info.data,
-                                                        page_info=page_info)
+                id,fitproblem = value
+                
+                if name !="Model Page":
+                    data= fitproblem.get_fit_data()
+                    page = self.fit_panel.add_fit_page(data= data,reset=True)
                     if fitproblem != None:
                         self.page_finder[page]=fitproblem
@@ -591,7 +591,8 @@
                         wx.PostEvent(self.parent, StatusEvent(status="Page was already Created"))
                 except:
-                    wx.PostEvent(self.parent, StatusEvent(status="Creating Fit page: %s"\
-                    %sys.exc_value))
-                    return
+                    raise
+                    #wx.PostEvent(self.parent, StatusEvent(status="Creating Fit page: %s"\
+                    #%sys.exc_value))
+                    #return
     
     def _single_fit_completed(self,result,pars,cpage, elapsed=None):
@@ -605,6 +606,6 @@
           
         """
-        #wx.PostEvent(self.parent, StatusEvent(status="Single fit \
-        #complete! " , type="stop"))
+        wx.PostEvent(self.parent, StatusEvent(status="Single fit \
+        complete! " , type="stop"))
         try:
             for page, value in self.page_finder.iteritems():
Index: sansview/perspectives/fitting/modelpage.py
===================================================================
--- sansview/perspectives/fitting/modelpage.py	(revision dcf29d72fbb8dcfe3b667c7278083176f2a6cf45)
+++ sansview/perspectives/fitting/modelpage.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
@@ -25,5 +25,5 @@
     """
     def __init__(self,parent, page_info, name=""):
-        BasicPage.__init__(self, parent, page_info,name)
+        BasicPage.__init__(self, parent, page_info)
         """ 
             Initialization of the Panel
@@ -33,9 +33,9 @@
         self._fill_model_sizer( self.sizer1)  
         self._fill_range_sizer() 
-        if hasattr(self.page_info,"model"):
-            model=self.page_info.model
-            description=""
-            if model!=None:
-                description = self.page_info.model.description
+       
+        description=""
+        if self.model!=None:
+            #description = self.page_info.model.description
+            description = self.model.description
             self.set_model_param_sizer(self.model)
             self.set_model_description(description,self.sizer2)
@@ -59,6 +59,6 @@
         """
         ## save state of radiobox
-        self.page_info. save_radiobox_state( self.description_hide )
-        self.page_info. save_radiobox_state( self.description_show )
+        #self.page_info. save_radiobox_state( self.description_hide )
+        #self.page_info. save_radiobox_state( self.description_show )
         ## Show description
         if not self.description_show.GetValue():
@@ -66,8 +66,9 @@
             
         else:
-            model=self.page_info.model
+            #model=self.page_info.model
             description=""
-            if model!=None:
-                description = self.page_info.model.description
+            if self.model!=None:
+                #description = self.page_info.model.description
+                description = self.model.description
             self.description = wx.StaticText( self,-1,str(description) )
             self.sizer_description.Add( self.description, 1, wx.EXPAND | wx.ALL, 10 )
@@ -93,4 +94,5 @@
         sizer_npts.Add(self.npts,1, wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 5) 
         self._set_range_sizer( title="Plotted Q Range", object= sizer_npts)
+       
        
     def _on_select_model(self, event): 
@@ -291,6 +293,6 @@
         self.model_description.SetToolTipString("See more description in help menu.")
         
-        self.page_info.save_radiobox_state( self.description_hide )
-        self.page_info.save_radiobox_state( self.description_show )
+        #self.page_info.save_radiobox_state( self.description_hide )
+        #self.page_info.save_radiobox_state( self.description_show )
         
         sizer_selection.Add( self.description_show )
@@ -435,5 +437,5 @@
         #from sans.models.LineModel import LineModel
         #model = LineModel()
-        from pageInfo import PageInfo
+        from fitpanel import PageInfo
         myinfo = PageInfo(self,model)
         from models import ModelList
Index: sansview/perspectives/fitting/pageInfo.py
===================================================================
--- sansview/perspectives/fitting/pageInfo.py	(revision dcf29d72fbb8dcfe3b667c7278083176f2a6cf45)
+++ 	(revision )
@@ -1,85 +1,0 @@
-
-
-import wx
-import copy
-
-class PageInfo(object):
-    """
-        Contains info to reconstruct a page
-    """
-    def __init__(self, parent,model=None, data=None):
-        
-        """ 
-            Initialization of the Panel
-        """
-        #TODO: remove this once the inheritence is cleaned up
-        ## Data member to store the dispersion object created
-        self._disp_obj_dict = {}
-
-        #Data used for fitting 
-        self.data = data
-        # flag to allow data2D plot
-        self.enable2D=False
-        # model on which the fit would be performed
-        self.model = model
-        #fit page manager 
-        self.manager = None
-        #Store the parent of this panel parent
-        # For this application fitpanel is the parent
-        self.parent  = parent
-        # Event_owner is the owner of model event
-        self.event_owner = None
-        ##page name
-        self.page_name=""
-        # Contains link between  model ,all its parameters, and panel organization
-        self.parameters=[]
-        # Contains list of parameters that cannot be fitted and reference to 
-        #panel objects 
-        self.fixed_param=[]
-        # Contains list of parameters with dispersity and reference to 
-        #panel objects 
-        self.fittable_param=[]
-        #list of dispersion paramaters
-        self.disp_list=[]
-        #contains link between a model and selected parameters to fit 
-        self.param_toFit=[]
-        #dictionary of model type and model class
-        self.model_list_box =None
-        ## list of check box   
-        self.list_of_radiobox={} 
-        ## save  current value of combobox
-        self.formfactorcombobox = ""
-        self.structurecombobox  = ""
-        ## Qrange
-        self.qmin=None
-        self.qmax=None
-        self.npts=None
-       
-        
-                  
-    def save_radiobox_state(self, object ):
-        """
-            save  radiobox state 
-            @param object: radiobox
-            self.list_of_check= ["label", id, state]
-           
-        """
-        label = object.GetLabel()
-        id = object.GetId()
-        state = object.GetValue()
-        self.list_of_radiobox[label]=[label, id, state]    
-    
-    
-    def clone(self):
-        model=None
-        if self.model !=None:
-            model = self.model.clone()
-        
-        obj          = PageInfo( self.parent,model= model )
-        obj.data = copy.deepcopy(self.data)
-        obj.model_list_box = copy.deepcopy(self.model_list_box)
-        obj.manager = self.manager
-        obj.event_owner = self.event_owner
-        return obj
-
-       
Index: sansview/perspectives/fitting/pagestate.py
===================================================================
--- sansview/perspectives/fitting/pagestate.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
+++ sansview/perspectives/fitting/pagestate.py	(revision cfc091378ea439152bd4e2d41ece44c4e94ebece)
@@ -0,0 +1,117 @@
+
+
+import wx
+import copy
+
+class PageState(object):
+    """
+        Contains info to reconstruct a page
+    """
+    def __init__(self, parent,model=None, data=None):
+        
+        """ 
+            Initialization of the Panel
+        """
+        #TODO: remove this once the inheritence is cleaned up
+        ## Data member to store the dispersion object created
+        self._disp_obj_dict = {}
+        ## reset True change the state of exsiting button
+        self.reset = False
+        #Data used for fitting 
+        self.data = data
+        # flag to allow data2D plot
+        self.enable2D = False
+        # model on which the fit would be performed
+        self.model = model
+        #fit page manager 
+        self.manager = None
+        #Store the parent of this panel parent
+        # For this application fitpanel is the parent
+        self.parent  = parent
+        # Event_owner is the owner of model event
+        self.event_owner = None
+        ##page name
+        self.page_name = ""
+        # Contains link between  model ,all its parameters, and panel organization
+        self.parameters =[]
+        # Contains list of parameters that cannot be fitted and reference to 
+        #panel objects 
+        self.fixed_param =[]
+        # Contains list of parameters with dispersity and reference to 
+        #panel objects 
+        self.fittable_param =[]
+        #list of dispersion paramaters
+        self.disp_list =[]
+        #contains link between a model and selected parameters to fit 
+        self.param_toFit =[]
+        #dictionary of model type and model class
+        self.model_list_box = None
+       
+        ## save  current value of combobox
+        self.formfactorcombobox = ""
+        self.structurecombobox  = ""
+        self.disp_box=""
+        ## Qrange
+        ## Q range
+        self.qmin= 0.001
+        self.qmax= 0.1
+        self.npts = None
+        ## enable smearering state
+        self.enable_smearer = False
+        ## disperity selection
+        self.enable_disp= False
+        ## state of selected all check button
+        self.cb1 = False
+       
+   
+    def save_data(self, data):
+        """
+            Save data
+        """
+        self.data = copy.deepcopy(data)
+    
+    
+        
+    def clone(self):
+        model=None
+        if self.model !=None:
+            model = self.model.clone()
+        
+        obj          = PageState( self.parent,model= model )
+        obj.data = copy.deepcopy(self.data)
+        obj.model_list_box = copy.deepcopy(self.model_list_box)
+        obj.manager = self.manager
+        obj.event_owner = self.event_owner
+        obj.parameters = copy.deepcopy(self.parameters)
+        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
+        return obj
+
+class PageMemento(object):
+    """
+        Store the state of a fitpage or model page of fitpanel
+    """
+    def __init__(self, state):
+        """ Initialization"""
+        self.state = state
+       
+    def setState(self,state):
+        """
+            set current state
+            @param state: new state
+        """
+        self.state = state
+        
+    def getState(self):
+        """
+            @return state
+        """
+        return self.state
+       
+       
+       
+       
