Index: sansview/perspectives/fitting/fitpage1D.py
===================================================================
--- sansview/perspectives/fitting/fitpage1D.py	(revision a92d51b6ca47a3af1666d6c63385f9839e476a72)
+++ sansview/perspectives/fitting/fitpage1D.py	(revision f39511b8d2d22017d4b786bdab20f232c2d107eb)
@@ -25,5 +25,5 @@
 
     
-class FitPage1D(wx.Panel):
+class FitPage1D(wx.ScrolledWindow):
     """
         FitPanel class contains fields allowing to display results when
@@ -40,9 +40,9 @@
     
     def __init__(self, parent,data, *args, **kwargs):
-        wx.Panel.__init__(self, parent, *args, **kwargs)
+        wx.ScrolledWindow.__init__(self, parent, *args, **kwargs)
         """ 
             Initialization of the Panel
         """
-        self.scroll = wx.ScrolledWindow(self)
+        #self.scroll = wx.ScrolledWindow(self)
         
         self.manager = None
@@ -58,12 +58,12 @@
         
         
-        self.DataSource  =wx.StaticText(self.scroll, -1,str(data.name))
-        
-        self.modelbox = wx.ComboBox(self.scroll, -1)
+        self.DataSource  =wx.StaticText(self, -1,str(data.name))
+        
+        self.modelbox = wx.ComboBox(self, -1)
         id = wx.NewId()
-        self.btFit =wx.Button(self.scroll,id,'Fit')
+        self.btFit =wx.Button(self,id,'Fit')
         self.btFit.Bind(wx.EVT_BUTTON, self.onFit,id=id)
         self.btFit.SetToolTipString("Perform fit.")
-        self.static_line_1 = wx.StaticLine(self.scroll, -1)
+        self.static_line_1 = wx.StaticLine(self, -1)
        
         self.vbox.Add(self.sizer3)
@@ -75,10 +75,10 @@
         
         id = wx.NewId()
-        self.btClose =wx.Button(self.scroll,id,'Close')
+        self.btClose =wx.Button(self,id,'Close')
         self.btClose.Bind(wx.EVT_BUTTON, self.onClose,id=id)
         self.btClose.SetToolTipString("Close page.")
         ix = 0
         iy = 1
-        self.sizer3.Add(wx.StaticText(self.scroll, -1, 'Data Source Name : '),(iy,ix),\
+        self.sizer3.Add(wx.StaticText(self, -1, 'Data Source Name : '),(iy,ix),\
                  (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
@@ -88,5 +88,5 @@
         ix = 0
         iy += 1
-        self.sizer3.Add(wx.StaticText(self.scroll,-1,'Model'),(iy,ix),(1,1)\
+        self.sizer3.Add(wx.StaticText(self,-1,'Model'),(iy,ix),(1,1)\
                   , wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
@@ -96,19 +96,19 @@
         iy = 1
         #set maximum range for x in linear scale
-        self.text4_3 = wx.StaticText(self.scroll, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT)
+        self.text4_3 = wx.StaticText(self, -1, 'Maximum Data Range(Linear)', style=wx.ALIGN_LEFT)
         self.sizer4.Add(self.text4_3,(iy,ix),(1,1),\
                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
-        self.sizer4.Add(wx.StaticText(self.scroll, -1, 'Min'),(iy, ix),(1,1),\
+        self.sizer4.Add(wx.StaticText(self, -1, 'Min'),(iy, ix),(1,1),\
                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 2
-        self.sizer4.Add(wx.StaticText(self.scroll, -1, 'Max'),(iy, ix),(1,1),\
+        self.sizer4.Add(wx.StaticText(self, -1, 'Max'),(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         ix = 0
         iy += 1
-        self.sizer4.Add(wx.StaticText(self.scroll, -1, 'x range'),(iy, ix),(1,1),\
+        self.sizer4.Add(wx.StaticText(self, -1, 'x range'),(iy, ix),(1,1),\
                             wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
-        self.xmin    = wx.TextCtrl(self.scroll, -1,size=(_BOX_WIDTH,20))
+        self.xmin    = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
         self.xmin.SetValue(format_number(numpy.min(data.x)))
         self.xmin.SetToolTipString("Minimun value of x in linear scale.")
@@ -120,5 +120,5 @@
        
         ix += 2
-        self.xmax    = wx.TextCtrl(self.scroll, -1,size=(_BOX_WIDTH,20))
+        self.xmax    = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
         self.xmax.SetValue(format_number(numpy.max(data.x)))
         self.xmax.SetToolTipString("Maximum value of x in linear scale.")
@@ -133,15 +133,15 @@
         ix = 0
         iy = 1
-        self.smear= wx.CheckBox(self.scroll, -1, "Fit with Smear", (10, 10))
-        wx.EVT_CHECKBOX(self.scroll, self.smear.GetId(), self.onSmear)
+        self.smear= wx.CheckBox(self, -1, "Fit with Smear", (10, 10))
+        wx.EVT_CHECKBOX(self, self.smear.GetId(), self.onSmear)
         self.sizer1.Add(self.smear,(iy,ix),(1,1),\
                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         iy+=1
-        self.text1_1 = wx.StaticText(self.scroll, -1, 'Chi2/dof', style=wx.ALIGN_LEFT)
+        self.text1_1 = wx.StaticText(self, -1, 'Chi2/dof', style=wx.ALIGN_LEFT)
         #self.sizer1.Add(self.text1_1,1)
         self.sizer1.Add(self.text1_1,(iy,ix),(1,1),\
                    wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
         ix += 1
-        self.tcChi    = wx.TextCtrl(self.scroll, -1,size=(_BOX_WIDTH,20))
+        self.tcChi    = wx.TextCtrl(self, -1,size=(_BOX_WIDTH,20))
         self.tcChi.SetToolTipString("Chi^2 over degrees of freedom.")
         #self.sizer1.Add(self.tcChi, 1, wx.R | wx.BOTTOM , 5)
@@ -167,6 +167,6 @@
         self.model_list_box={}
         self.data = data
-        self.vbox.Layout()
-        
+        
+        """
         bs = wx.BoxSizer(wx.VERTICAL)
         bs.Add(self.scroll, 1, wx.EXPAND)
@@ -174,11 +174,15 @@
         self.scroll.SetSizer(self.vbox)        
         self.scroll.SetScrollbars(20,20,55,40)
-        width,height = self.GetSize()
-     
+        #width,height = self.GetSize()
+         """
+        self.vbox.Layout()
+        self.vbox.Fit(self) 
+        self.SetSizer(self.vbox)
+        self.SetScrollbars(20,20,55,40)
+        
         self.Centre()
         self.Layout()
         self.GrandParent.GetSizer().Layout()
-        print self.GetSize()
-        print self.scroll.GetSize()
+       
 
         
@@ -287,6 +291,9 @@
             if name ==event.GetString():
                 try:
-                    evt = ModelEventbox(model=item(),name=name)
+                    self.model=item()
+                    evt = ModelEventbox(model=self.model,name=name)
                     wx.PostEvent(self.event_owner, evt)
+                    #self.model= item()
+                    #self.set_panel(self.model)
                 except:
                     raise #ValueError,"model.name is not equal to model class name"
@@ -301,5 +308,5 @@
             flag=self.checkFitRange()
             if flag==True and self.model!=None:
-                print"fit page",self.xmin.GetValue(),self.xmax.GetValue()
+                #print"fit page",self.xmin.GetValue(),self.xmax.GetValue()
                 self.manager.redraw_model(float(self.xmin.GetValue())\
                                                ,float(self.xmax.GetValue()))
@@ -374,8 +381,8 @@
         iq=1
         if len(disp_list)>0:
-            disp = wx.StaticText(self.scroll, -1, 'Dispersion')
+            disp = wx.StaticText(self, -1, 'Dispersion')
             self.sizer5.Add(disp,( iq, ip),(1,1),  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
             ip += 1 
-            values = wx.StaticText(self.scroll, -1, 'Values')
+            values = wx.StaticText(self, -1, 'Values')
             self.sizer5.Add(values,( iq, ip),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
             
@@ -383,19 +390,19 @@
         iy = 1
         ix = 0
-        self.cb1 = wx.CheckBox(self.scroll, -1,'Parameters', (10, 10))
-        wx.EVT_CHECKBOX(self.scroll, self.cb1.GetId(), self.select_all_param)
+        self.cb1 = wx.CheckBox(self, -1,'Parameters', (10, 10))
+        wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param)
         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.scroll, -1, 'Values')
+        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 +=2
-        self.text2_3 = wx.StaticText(self.scroll, -1, 'Errors')
+        self.text2_3 = wx.StaticText(self, -1, 'Errors')
         self.sizer2.Add(self.text2_3,(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0)
         self.text2_3.Hide() 
         ix +=1
-        self.text2_4 = wx.StaticText(self.scroll, -1, 'Units')
+        self.text2_4 = wx.StaticText(self, -1, 'Units')
         self.sizer2.Add(self.text2_4,(iy, ix),(1,1),\
                             wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
@@ -407,12 +414,12 @@
                 ix = 0
     
-                cb = wx.CheckBox(self.scroll, -1, item, (10, 10))
+                cb = wx.CheckBox(self, -1, item, (10, 10))
                 cb.SetValue(False)
                 self.sizer2.Add( cb,( iy, ix),(1,1),  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-                wx.EVT_CHECKBOX(self.scroll, cb.GetId(), self.select_param)
+                wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param)
                 
                 ix += 1
                 value= self.model.getParam(item)
-                ctl1 = wx.TextCtrl(self.scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                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)
@@ -420,10 +427,10 @@
                 self.sizer2.Add(ctl1, (iy,ix),(1,1), wx.EXPAND)
                 ix += 1
-                text2=wx.StaticText(self.scroll, -1, '+/-')
+                text2=wx.StaticText(self, -1, '+/-')
                 self.sizer2.Add(text2,(iy, ix),(1,1),\
                                 wx.EXPAND|wx.ADJUST_MINSIZE, 0) 
                 text2.Hide()  
                 ix += 1
-                ctl2 = wx.TextCtrl(self.scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                ctl2 = wx.TextCtrl(self, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
                 self.sizer2.Add(ctl2, (iy,ix),(1,1), wx.EXPAND|wx.ADJUST_MINSIZE, 0)
                 ctl2.Hide()
@@ -431,19 +438,19 @@
                 # Units
                 try:
-                    units = wx.StaticText(self.scroll, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)
+                    units = wx.StaticText(self, -1, self.model.details[item][0], style=wx.ALIGN_LEFT)
                 except:
-                    units = wx.StaticText(self.scroll, -1, "", style=wx.ALIGN_LEFT)
+                    units = wx.StaticText(self, -1, "", style=wx.ALIGN_LEFT)
                 self.sizer2.Add(units, (iy,ix),(1,1),  wx.EXPAND|wx.ADJUST_MINSIZE, 0)
             else:
                 ip = 0
                 iq += 1
-                cb = wx.CheckBox(self.scroll, -1, item, (10, 10))
+                cb = wx.CheckBox(self, -1, item, (10, 10))
                 cb.SetValue(False)
                 self.sizer5.Add( cb,( iq, ip),(1,1),  wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15)
-                wx.EVT_CHECKBOX(self.scroll, cb.GetId(), self.select_param)
+                wx.EVT_CHECKBOX(self, cb.GetId(), self.select_param)
                 
                 ip += 1
                 value= self.model.getParam(item)
-                ctl1 = wx.TextCtrl(self.scroll, -1, size=(_BOX_WIDTH,20), style=wx.TE_PROCESS_ENTER)
+                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)
