Index: sansview/perspectives/fitting/fitpage.py
===================================================================
--- sansview/perspectives/fitting/fitpage.py	(revision d89f09b35713186021727a80260c3d5a38746821)
+++ sansview/perspectives/fitting/fitpage.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
@@ -495,4 +495,7 @@
             when enter value on panel redraw model according to changed
         """
+        self.set_model_parameter()
+        
+    def set_model_parameter(self):
         if len(self.parameters) !=0 and self.model !=None:
             for item in self.parameters:
@@ -507,6 +510,4 @@
                      wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\
                             "Drawing  Error:wrong value entered : %s"% sys.exc_value))
-        
-       
     def select_all_param(self,event): 
         """
Index: sansview/perspectives/fitting/fitpanel.py
===================================================================
--- sansview/perspectives/fitting/fitpanel.py	(revision d89f09b35713186021727a80260c3d5a38746821)
+++ sansview/perspectives/fitting/fitpanel.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
@@ -49,5 +49,6 @@
         self.model_list_box={}
         # save the title of the last page tab added
-        self.name=None
+        self.fit_page_name=None
+        self.draw_model_name=[]
         self.nb.Update()
         self.SetSizer(self.sizer)
@@ -72,5 +73,5 @@
       
         
-    def add_page( self,page_title ):
+    def add_fit_page( self,page_title ):
         """ 
             Add a fitting page on the notebook contained by fitpanel
@@ -79,5 +80,5 @@
             @return panel : page just added for futher used. is used by fitting module
         """     
-        if self.name != page_title:
+        if self.fit_page_name != page_title:
             from fitpage import FitPage
             panel = FitPage(self.nb, -1)
@@ -86,6 +87,16 @@
             self.nb.AddPage(page=panel,text=page_title,select=True)
             panel.populate_box( self.model_list_box)
-            self.name = page_title
+            self.fit_page_name = page_title
             return panel
+    def add_model_page(self,model,page_title):
+        if not  page_title in self.draw_model_name: 
+            from modelpage import ModelPage
+            panel = ModelPage(self.nb,model, -1)
+            panel.set_manager(self.manager)
+            panel.set_owner(self.event_owner)
+            self.nb.AddPage(page=panel,text=page_title,select=True)
+            panel.populate_box( self.model_list_box)
+            self.draw_model_name.append(page_title)
+           
   
     def get_notebook(self):
Index: sansview/perspectives/fitting/fitproblem.py
===================================================================
--- sansview/perspectives/fitting/fitproblem.py	(revision d89f09b35713186021727a80260c3d5a38746821)
+++ sansview/perspectives/fitting/fitproblem.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
@@ -65,7 +65,6 @@
         """
         
-        self.model_list[0].model.setParam(name,value)
-        new_model=Model(self.model_list[0].model)
-        self.model_list[0]=new_model
+        self.model_list[0].setParam(name,value)
+       
         
     def reset_model(self,model):
Index: sansview/perspectives/fitting/fitting.py
===================================================================
--- sansview/perspectives/fitting/fitting.py	(revision d89f09b35713186021727a80260c3d5a38746821)
+++ sansview/perspectives/fitting/fitting.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
@@ -74,4 +74,5 @@
         self.fit_panel.set_model_list(self.menu_mng.get_model_list())
         owner.Bind(fitpage.EVT_MODEL_BOX,self._on_model_panel)
+        #owner.Bind(modelpage.EVT_MODEL_DRAW,self.draw_model)
       
         return [(id, self.menu1, "Fitting"),(id2, menu2, "Model")]
@@ -154,5 +155,5 @@
                     name = 'Fit'
                 try:
-                    page = self.fit_panel.add_page(name)
+                    page = self.fit_panel.add_fit_page(name)
                     page.set_data_name(item)
                     self.page_finder[page]= FitProblem()
@@ -219,7 +220,7 @@
             for name in pars:
                 if result.pvec.__class__==numpy.float64:
-                    model.model.setParam(name,result.pvec)
+                    model.setParam(name,result.pvec)
                 else:
-                    model.model.setParam(name,result.pvec[i])
+                    model.setParam(name,result.pvec[i])
                     #print "fitting: i name out[i]", i,name,float(result.pvec[i])
                     i += 1
@@ -255,10 +256,10 @@
                     print "fitting: fit in park fitting", p.name, p.value,p.stderr
                     model_name,param_name = self.split_string(p.name)  
-                    print "fitting: simultfit",model.model.name,model_name,param_name ,p.name,param_name,p.value
-                    if model.model.name == model_name:
+                    print "fitting: simultfit",model.name,model_name,param_name ,p.name,param_name,p.value
+                    if model.name == model_name:
                         print "fitting: hello",p.name,param_name,p.value
                         small_out.append(p.value )
                         small_cov.append(p.stderr)
-                        model.model.setParam(param_name,p.value)   
+                        model.setParam(param_name,p.value)   
                 #print "fitting: out of each page",page,small_out,small_cov,data.group_id
                 page.onsetValues(result.fitness, small_out,small_cov)
@@ -408,5 +409,5 @@
                     #print "fitter",self.fitter
                     #print "fitting: model name",model.name
-                    self.fitter.set_model(model,model.model.name, self.id, pars) 
+                    self.fitter.set_model(Model(model),model.name, self.id, pars) 
                     self.fitter.set_data(data,self.id,qmin,qmax)
                 else:
@@ -455,5 +456,5 @@
             self.page_finder[current_pg].set_theory("Fitness")
             #print "on model",model.name
-            self.page_finder[current_pg].set_model(Model(model),M_name)
+            self.page_finder[current_pg].set_model(model,M_name)
             self.plot_helper(currpage= current_pg,qmin= None,qmax= None)
             sim_page.add_model(self.page_finder)
@@ -503,5 +504,5 @@
                 try:
                     tempx = qmin
-                    tempy = model.eval(qmin)
+                    tempy = model.run(qmin)
                     theory.x.append(tempx)
                     theory.y.append(tempy)
@@ -514,5 +515,5 @@
                         if data.x[i]> qmin and data.x[i]< qmax:
                             tempx = data.x[i]
-                            tempy = model.eval(tempx)
+                            tempy = model.run(tempx)
                             
                             theory.x.append(tempx) 
@@ -523,5 +524,5 @@
                 try:
                     tempx = qmax
-                    tempy = model.eval(qmax)
+                    tempy = model.run(qmax)
                     theory.x.append(tempx)
                     theory.y.append(tempy)
@@ -542,4 +543,10 @@
             Plot a theory from a model selected from the menu
         """
+        #name = evt.model.__class__.__name__
+        name="Model View"
+        self.fit_panel.add_model_page(evt.model,name)       
+        self.draw_model(evt.model)
+        
+    def draw_model(self,model):
         x = pylab.arange(0.001, 0.1, 0.001)
         xlen = len(x)
@@ -548,5 +555,5 @@
         
         for i in range(xlen):
-            y[i] = evt.model.run(x[i])
+            y[i] = model.run(x[i])
             dy[i] = math.sqrt(math.fabs(y[i]))
         try:
@@ -562,5 +569,4 @@
             print "SimView.complete1D: could not import sans.guicomm.events"
 
-
 if __name__ == "__main__":
     i = Plugin()
Index: sansview/perspectives/fitting/modelpage.py
===================================================================
--- sansview/perspectives/fitting/modelpage.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
+++ sansview/perspectives/fitting/modelpage.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
@@ -0,0 +1,257 @@
+import sys
+import wx
+import wx.lib
+import numpy
+import copy
+
+from sans.guicomm.events import StatusEvent   
+(ModelEventbox, EVT_MODEL_BOX) = wx.lib.newevent.NewEvent()
+_BOX_WIDTH = 80
+
+def format_number(value, high=False):
+    """
+        Return a float in a standardized, human-readable formatted string 
+    """
+    try: 
+        value = float(value)
+    except:
+        print "returning 0"
+        return "0"
+    
+    if high:
+        return "%-6.4g" % value
+    else:
+        return "%-5.3g" % value
+
+    
+class ModelPage(wx.Panel):
+    """
+        FitPanel class contains fields allowing to display results when
+        fitting  a model and one data
+        @note: For Fit to be performed the user should check at least one parameter
+        on fit Panel window.
+  
+    """
+    ## Internal name for the AUI manager
+    window_name = "Fit page"
+    ## Title to appear on top of the window
+    window_caption = "Fit Page"
+    
+    
+    def __init__(self, parent,model, *args, **kwargs):
+        wx.Panel.__init__(self, parent, *args, **kwargs)
+        """ 
+            Initialization of the Panel
+        """
+        self.manager = None
+        self.parent  = parent
+        self.event_owner=None
+        #panel interface
+        self.vbox  = wx.BoxSizer(wx.VERTICAL)
+       
+        self.sizer3 = wx.GridBagSizer(5,5)
+        self.sizer2 = wx.GridBagSizer(5,5)
+       
+        self.modelbox = wx.ComboBox(self, -1)
+        id = wx.NewId()
+       
+        self.vbox.Add(self.sizer3)
+        self.vbox.Add(self.sizer2)
+      
+        ix = 0
+        iy = 1
+        
+        self.sizer3.Add(wx.StaticText(self,-1,'Model'),(iy,ix),(1,1)\
+                  , wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix += 1
+        self.sizer3.Add(self.modelbox,(iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+       
+        # contains link between  model ,all its parameters, and panel organization
+        self.parameters=[]
+        #contains link between a model and selected parameters to fit 
+        self.param_toFit=[]
+        # model on which the fit would be performed
+        self.model=model
+        self.set_panel(model)
+        # preview selected model name
+        self.prevmodel_name=model.__class__.__name__
+        self.modelbox.SetValue(self.prevmodel_name)
+        # flag to check if the user has selected a new model in the combox box
+        self.model_hasChanged=False
+       
+        #dictionary of model name and model class
+        self.model_list_box={}
+        # Data1D to make a deep comparison between 2 Data1D for checking data
+        #change
+       
+        self.vbox.Layout()
+        self.vbox.Fit(self) 
+        self.SetSizer(self.vbox)
+        self.Centre()
+        
+        
+    def set_owner(self,owner):
+        """ 
+            set owner of fitpage
+            @param owner: the class responsible of plotting
+        """
+        self.event_owner=owner    
+   
+  
+    def set_manager(self, manager):
+        """
+             set panel manager
+             @param manager: instance of plugin fitting
+        """
+        self.manager = manager
+  
+    def populate_box(self, dict):
+        """
+            Populate each combox box of each page
+            @param page: the page to populate
+        """
+        id=0
+        self.model_list_box=dict
+        for item in self.model_list_box.itervalues():
+            if hasattr(item, "name"):
+                name = item.name
+            else:
+                name = item.__name__
+            
+            self.modelbox.Insert(name,int(id))
+            id+=1
+            
+            wx.EVT_COMBOBOX(self.modelbox,-1, self._on_select_model) 
+        return 0
+    
+    
+    def _on_select_model(self,event):
+        """
+            react when a model is selected from page's combo box
+            post an event to its owner to draw an appropriate theory
+        """
+        print "modelpage: self.model_list_box ",self.model_list_box
+        for item in self.model_list_box.itervalues():
+            model=item()
+            print "modelpage:model",model
+            if hasattr(model, "name"):
+                name = model.name
+            else:
+                name = model.__class__.__name__
+            try:
+                if name ==event.GetString():
+                    self.model=model
+                    self.set_panel(self.model)
+                    self.manager.draw_model(self.model)
+            except:
+                raise #ValueError,"model.name is not equal to model class name"
+    def set_model_name(self,name):
+        """ 
+            set model name. set also self.model_hasChanged to true is the model 
+            type has changed or false if it didn't
+            @param name: model 's name
+        """
+        self.model_hasChanged=False
+        if (name != self.prevmodel_name):
+            self.model_hasChanged=True
+       
+        self.prevmodel_name=self.modelbox.GetValue()
+       
+            
+    def get_model_box(self): 
+        """ return reference to combox box self.model"""
+        return self.modelbox
+
+    
+    def get_param_list(self):
+        """
+            @return self.param_toFit: list containing  references to TextCtrl
+            checked.Theses TextCtrl will allow reference to parameters to fit.
+            @raise: if return an empty list of parameter fit will nnote work 
+            properly so raise ValueError,"missing parameter to fit"
+        """
+        if self.param_toFit !=[]:
+            return self.param_toFit
+        else:
+            raise ValueError,"missing parameter to fit"
+        
+        
+    def set_panel(self,model):
+        """
+            Build the panel from the model content
+            @param model: the model selected in combo box for fitting purpose
+        """
+    
+        self.sizer2.Clear(True)
+        self.parameters = []
+        self.param_toFit=[]
+        self.model = model
+        keys = self.model.getParamList()
+        keys.sort()
+        iy = 1
+        ix = 0
+        self.cb1 = wx.StaticText(self, -1,'Parameters')
+        self.sizer2.Add(self.cb1,(iy, ix),(1,1),\
+                          wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+        ix +=1
+        self.text2_2 = wx.StaticText(self, -1, 'Values')
+        self.sizer2.Add(self.text2_2,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        ix +=1
+        self.text2_4 = wx.StaticText(self, -1, 'Units')
+        self.sizer2.Add(self.text2_4,(iy, ix),(1,1),\
+                            wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
+        self.text2_4.Hide()
+        for item in keys:
+            iy += 1
+            ix = 0
+            cb=wx.StaticText(self, -1, item)
+            self.sizer2.Add( cb,( iy, ix),(1,1),  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
+            ix += 1
+            value= self.model.getParam(item)
+            ctl1 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+            ctl1.SetValue(str (format_number(value)))
+            ctl1.Bind(wx.EVT_KILL_FOCUS, self._onparamEnter)
+            self.sizer2.Add(ctl1, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+           
+            ix +=1
+            # Units
+            try:
+                units = wx.StaticText(self, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)
+            except:
+                units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT)
+            self.sizer2.Add(units, (iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
+            #save data
+            self.parameters.append([cb,ctl1])
+        #Display units text on panel
+        for item in keys:   
+            if self.model.details[item][0]!='':
+                self.text2_4.Show()
+                break
+            else:
+                self.text2_4.Hide()
+       
+        self.vbox.Layout()
+        self.GrandParent.GetSizer().Layout()
+        
+        
+    def _onparamEnter(self,event):
+        """ 
+            when enter value on panel redraw model according to changed
+        """
+        self.set_model_parameter()
+        
+    def set_model_parameter(self):
+        if len(self.parameters) !=0 and self.model !=None:
+            for item in self.parameters:
+                try:
+                     name=str(item[0])
+                     value= float(item[1].GetValue())
+                     
+                     self.model.setParam(name,value)
+                     self.manager.draw_model(self.model)
+                except:
+                     wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\
+                            "Drawing  Error:wrong value entered : %s"% sys.exc_value))
+   
+  
Index: sansview/perspectives/fitting/simfitpage.py
===================================================================
--- sansview/perspectives/fitting/simfitpage.py	(revision d89f09b35713186021727a80260c3d5a38746821)
+++ sansview/perspectives/fitting/simfitpage.py	(revision 1b07935d9fc66943962a7fbfdb0f3368a1b27b9b)
@@ -1,3 +1,2 @@
-
 
 import sys,re,string, wx   
@@ -55,4 +54,5 @@
         self.model_list=[]
         self.model_toFit=[]
+        self.page_finder={}
         iy +=1
         self.sizer2.Add((20,20),(iy, ix))
@@ -64,10 +64,14 @@
         
     def onFit(self,event):
-         """ signal for fitting"""
-         if len(self.model_toFit) >0 :
-             self.set_model()
-             self.manager._on_simul_fit()
-         else:
-             wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\
+        """ signal for fitting"""
+        if len(self.model_toFit) >0 :
+            if len(self.params)>0:
+                self.set_model()
+            else:
+                for page in self.page_finder.iterkeys():
+                    page.set_model_parameter()
+            self.manager._on_simul_fit()
+        else:
+            wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\
                             "Select at least on model to fit "))
     def set_manager(self, manager):
@@ -99,7 +103,9 @@
             @param page_finder: the dictionary containing models information
         """
+        import copy 
         self.model_list=[]
         self.model_toFit=[]
         self.sizer1.Clear(True)
+        self.page_finder=page_finder
         ix = 0
         iy = 1 
@@ -179,9 +185,9 @@
                 #print "simfitpage: list fitpanel2",list,list[0]
                 model=list[0]
-                param_list=model.model.getParamList()
+                param_list=model.getParamList()
                 #print "simfitpage: on set_model ",self.params
                 if self.params !=[]:
                     for element in self.params:
-                        if model.model.name == str(element[0]):
+                        if model.name == str(element[0]):
                             for item in param_list:
                                 if item==str(element[1]):
@@ -189,8 +195,8 @@
                                     #print "simfitpage: model name",element[0], model.name
                                     #print "simfitpage: param name ,param value",element[1],element[2]
-                                    self.manager.set_page_finder(model.model.name,element[1],\
+                                    self.manager.set_page_finder(model.name,element[1],\
                                                                  str(element[2]))
                             #print "simfitpage:on set_model page 2",model.params['A'],self.params[2]
-                
+    
                 
     def _onTextEnter(self,event):
