Index: src/sas/perspectives/fitting/simfitpage.py
===================================================================
--- src/sas/perspectives/fitting/simfitpage.py	(revision d7b4decd86aa380c3097056f40899305200dd6ff)
+++ src/sas/perspectives/fitting/simfitpage.py	(revision 662d8d87e9e23b096bab9ae00b2d0677025933d2)
@@ -13,4 +13,5 @@
 from sas.guiframe.events import PanelOnFocusEvent
 from sas.guiframe.utils import IdList
+from sas.guiframe.documentation_window import DocumentationWindow
 
 #Control panel width 
@@ -30,5 +31,5 @@
 def get_fittableParam(model):
     """
-    return list of fittable parameters name of a model
+    return list of fittable parameters from a model
 
     :param model: the model used
@@ -56,4 +57,5 @@
     ## Title to appear on top of the window
     window_caption = "Simultaneous Fit Page"
+    ID_DOC = wx.NewId()
     ID_SET_ALL = wx.NewId()
     ID_FIT = wx.NewId()
@@ -79,9 +81,9 @@
         ## store page_finder
         self.page_finder = page_finder
-        ## list contaning info to set constraint
+        ## list containing info to set constraint
         ## look like self.constraint_dict[page_id]= page
         self.constraint_dict = {}
         ## item list
-        # self.constraints_list=[combobox1, combobox2,=,textcrtl, button ]
+        ## self.constraints_list=[combobox1, combobox2,=,textcrtl, button ]
         self.constraints_list = []
         ## list of current model
@@ -96,10 +98,9 @@
         self.define_page_structure()
         self.draw_page()
-        self.set_layout()
         self._set_save_flag(False)
 
     def define_page_structure(self):
         """
-        Create empty sizer for a panel
+        Create empty sizers, their hierarchy and set the sizer for the panel
         """
         self.vbox = wx.BoxSizer(wx.VERTICAL)
@@ -114,19 +115,281 @@
         self.vbox.Add(self.sizer2)
         self.vbox.Add(self.sizer3)
-
-    def set_scroll(self):
-        """
-        """
-        self.Layout()
-
-    def set_layout(self):
-        """
-        layout
-        """
-        self.vbox.Layout()
-        self.vbox.Fit(self)
         self.SetSizer(self.vbox)
-        self.set_scroll()
         self.Centre()
+
+    def draw_page(self):
+        """
+        Construct the Simultaneous/Constrained fit page. fills the first
+        region (sizer1) with the list of available fit page pairs of data 
+        and models.  Then fills sizer2 with the checkbox for adding
+        constraints, and finally fills sizer3 with the fit button and
+        instructions.
+        """
+
+        # create blank list of constraints
+        self.model_list = []
+        self.model_toFit = []
+        self.constraints_list = []
+        self.constraint_dict = {}
+        self.nb_constraint = 0
+        self.model_cbox_left = None
+        self.model_cbox_right = None
+
+        if len(self.model_list) > 0:
+            for item in self.model_list:
+                item[0].SetValue(False)
+                self.manager.schedule_for_fit(value=0, uid=item[2])
+
+        #-------------------------------------------------------
+        ## setup sizer1 (which fitpages to include)
+        self.sizer1.Clear(True)
+        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Combinations")
+        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
+        sizer_title = wx.BoxSizer(wx.HORIZONTAL)
+        sizer_couples = wx.GridBagSizer(5, 5)
+
+        #This if statement should be obsolete and can be removed in version 4
+        #Leave it here for now as no time to thoroughly test.  However if no
+        #fit page is found the menu item that calls this page is inactive 
+        # Nov. 22 2015  --PDB
+        if len(self.page_finder) == 0:
+            msg = " No fit combinations are found! \n\n"
+            msg += " Please load data and set up "
+            msg += "at least one fit panels first..."
+            sizer_title.Add(wx.StaticText(self, wx.ID_ANY, msg))
+        else:
+            ## store model
+            self._store_model()
+
+            self.cb1 = wx.CheckBox(self, wx.ID_ANY, 'Select all')
+            self.cb1.SetValue(False)
+            wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.check_all_model_name)
+
+            sizer_title.Add((10, 10), 0,
+                wx.TOP | wx.BOTTOM | wx.EXPAND | wx.ADJUST_MINSIZE, border=5)
+            sizer_title.Add(self.cb1, 0,
+                wx.TOP | wx.BOTTOM | wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, border=5)
+
+            ## draw list of model and data names
+            self._fill_sizer_model_list(sizer_couples)
+
+        boxsizer1.Add(sizer_title, flag=wx.TOP | wx.BOTTOM, border=5)
+        boxsizer1.Add(sizer_couples, 1, flag=wx.TOP | wx.BOTTOM, border=5)
+        self.sizer1.Add(boxsizer1, 1, wx.EXPAND | wx.ALL, 10)
+#        self.sizer1.Layout()
+
+        #--------------------------------------------------------
+        ## set up the other 2 sizers: the constraints list and the
+        ## buttons (fit, help etc) sizer at the bottom of the page.
+        ## Note: the if statement should be removed along with the above
+        ## if statement as soon as it can be properly tested.
+        ## Nov. 22 2015  --PDB
+        if len(self.page_finder) > 0:
+            ## draw the sizer containing constraint info
+            if not self.batch_on:
+                self._fill_sizer_constraint()
+            ## draw fit button sizer
+            self._fill_sizer_fit()
+
+
+    def _fill_sizer_model_list(self, sizer):
+        """
+        Receive a dictionary containing information to display model name
+        """
+        ix = 0
+        iy = 0
+        list = []
+        sizer.Clear(True)
+
+        new_name = wx.StaticText(self, wx.ID_ANY, '  Model Title ',
+                                 style=wx.ALIGN_CENTER)
+        new_name.SetBackgroundColour('orange')
+        new_name.SetForegroundColour(wx.WHITE)
+        sizer.Add(new_name, (iy, ix), (1, 1),
+                            wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+        ix += 2
+        model_type = wx.StaticText(self, wx.ID_ANY, '  Model ')
+        model_type.SetBackgroundColour('grey')
+        model_type.SetForegroundColour(wx.WHITE)
+        sizer.Add(model_type, (iy, ix), (1, 1),
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        data_used = wx.StaticText(self, wx.ID_ANY, '  Data ')
+        data_used.SetBackgroundColour('grey')
+        data_used.SetForegroundColour(wx.WHITE)
+        sizer.Add(data_used, (iy, ix), (1, 1),
+                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        ix += 1
+        tab_used = wx.StaticText(self, wx.ID_ANY, '  FitPage ')
+        tab_used.SetBackgroundColour('grey')
+        tab_used.SetForegroundColour(wx.WHITE)
+        sizer.Add(tab_used, (iy, ix), (1, 1),
+                  wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+        for id, value in self.page_finder.iteritems():
+            if id not in self.parent.opened_pages:
+                continue
+
+            if self.batch_on != self.parent.get_page_by_id(id).batch_on:
+                continue
+
+            data_list = []
+            model_list = []
+            # get data name and model objetta
+            for fitproblem in value.get_fit_problem():
+
+                data = fitproblem.get_fit_data()
+                if not data.is_data:
+                    continue
+                name = '-'
+                if data is not None and data.is_data:
+                    name = str(data.name)
+                data_list.append(name)
+
+                model = fitproblem.get_model()
+                if model is None:
+                    continue
+                model_list.append(model)
+
+            if len(model_list) == 0:
+                continue
+            # Draw sizer
+            ix = 0
+            iy += 1
+            model = model_list[0]
+            name = '_'
+            if model is not None:
+                name = str(model.name)
+            cb = wx.CheckBox(self, wx.ID_ANY, name)
+            cb.SetValue(False)
+            cb.Enable(model is not None and data.is_data)
+            sizer.Add(cb, (iy, ix), (1, 1),
+                      wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+            wx.EVT_CHECKBOX(self, cb.GetId(), self.check_model_name)
+            ix += 2
+            model_type = wx.StaticText(self, wx.ID_ANY,
+                                       model.__class__.__name__)
+            sizer.Add(model_type, (iy, ix), (1, 1),
+                      wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+            if self.batch_on:
+                data_used = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY)
+                data_used.AppendItems(data_list)
+                data_used.SetSelection(0)
+            else:
+                data_used = wx.StaticText(self, wx.ID_ANY, data_list[0])
+
+            ix += 1
+            sizer.Add(data_used, (iy, ix), (1, 1),
+                      wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+            ix += 1
+            caption = value.get_fit_tab_caption()
+            tab_caption_used = wx.StaticText(self, wx.ID_ANY, str(caption))
+            sizer.Add(tab_caption_used, (iy, ix), (1, 1),
+                      wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+
+            self.model_list.append([cb, value, id, model])
+
+        iy += 1
+        sizer.Add((20, 20), (iy, ix), (1, 1),
+                  wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+
+    def _fill_sizer_constraint(self):
+        """
+        Fill sizer containing constraint info
+        """
+        msg = "Select at least 1 model to add constraint "
+        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+
+        self.sizer2.Clear(True)
+        if self.batch_on:
+            if self.sizer2.IsShown():
+                self.sizer2.Show(False)
+            return
+        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Constraints")
+        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
+        sizer_title = wx.BoxSizer(wx.HORIZONTAL)
+        self.sizer_all_constraints = wx.BoxSizer(wx.HORIZONTAL)
+        self.sizer_constraints = wx.BoxSizer(wx.VERTICAL)
+        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
+
+        self.hide_constraint = wx.RadioButton(self, wx.ID_ANY, 'No', (10, 10),
+                                              style=wx.RB_GROUP)
+        self.show_constraint = wx.RadioButton(self, wx.ID_ANY, 'Yes', (10, 30))
+        self.Bind(wx.EVT_RADIOBUTTON, self._display_constraint,
+                  id=self.hide_constraint.GetId())
+        self.Bind(wx.EVT_RADIOBUTTON, self._display_constraint,
+                  id=self.show_constraint.GetId())
+        if self.batch_on:
+            self.hide_constraint.Enable(False)
+            self.show_constraint.Enable(False)
+        self.hide_constraint.SetValue(True)
+        self.show_constraint.SetValue(False)
+
+        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Model"))
+        sizer_title.Add((10, 10))
+        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Parameter"))
+        sizer_title.Add((10, 10))
+        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Add Constraint?"))
+        sizer_title.Add((10, 10))
+        sizer_title.Add(self.show_constraint)
+        sizer_title.Add(self.hide_constraint)
+        sizer_title.Add((10, 10))
+
+        self.btAdd = wx.Button(self, self.ID_ADD, 'Add')
+        self.btAdd.Bind(wx.EVT_BUTTON, self._onAdd_constraint,
+                        id=self.btAdd.GetId())
+        self.btAdd.SetToolTipString("Add another constraint?")
+        self.btAdd.Hide()
+
+        text_hint = wx.StaticText(self, wx.ID_ANY,
+                                  "Example: [M0][paramter] = M1.parameter")
+        sizer_button.Add(text_hint, 0,
+                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10)
+        sizer_button.Add(self.btAdd, 0,
+                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10)
+
+        boxsizer1.Add(sizer_title, flag=wx.TOP | wx.BOTTOM, border=10)
+        boxsizer1.Add(self.sizer_all_constraints, flag=wx.TOP | wx.BOTTOM,
+                      border=10)
+        boxsizer1.Add(self.sizer_constraints, flag=wx.TOP | wx.BOTTOM,
+                      border=10)
+        boxsizer1.Add(sizer_button, flag=wx.TOP | wx.BOTTOM, border=10)
+
+        self.sizer2.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10)
+
+
+    def _fill_sizer_fit(self):
+        """
+        Draw fit button
+        """
+        self.sizer3.Clear(True)
+        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit ")
+        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
+        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
+
+        #Fit button
+        self.btFit = wx.Button(self, self.ID_FIT, 'Fit', size=wx.DefaultSize)
+        self.btFit.Bind(wx.EVT_BUTTON, self.onFit, id=self.btFit.GetId())
+        self.btFit.SetToolTipString("Perform fit.")
+
+        #General Help button
+        self.btHelp = wx.Button(self, wx.ID_HELP, 'HELP')
+        self.btHelp.SetToolTipString("Simultaneous/Constrained Fitting help.")
+        self.btHelp.Bind(wx.EVT_BUTTON, self._onHelp)
+
+        #hint text on button line
+        if self.batch_on:
+            text = " Fit in Parallel all Data sets\n"
+            text += "and model selected."
+        else:
+            text = " At least one set of model and data\n"
+            text += " must be selected for fitting."
+        text_hint = wx.StaticText(self, wx.ID_ANY, text)
+
+        sizer_button.Add(text_hint)
+        sizer_button.Add(self.btFit, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10)
+        sizer_button.Add(self.btHelp, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10)
+
+        boxsizer1.Add(sizer_button, flag=wx.TOP | wx.BOTTOM, border=10)
+        self.sizer3.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10)
 
     def onRemove(self, event):
@@ -149,9 +412,8 @@
                 item.sizer.Clear(True)
                 self.sizer_constraints.Remove(item.sizer)
-                ##self.SetScrollbars(20,20,25,65)
                 self.constraints_list.remove(item)
                 self.nb_constraint -= 1
                 self.sizer2.Layout()
-                self.Layout()
+                self.FitInside()
                 break
 
@@ -186,4 +448,24 @@
             wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
 
+    def _onHelp(self, event):
+        """
+        Bring up the simultaneous Fitting Documentation whenever the HELP
+        button is clicked.
+
+        Calls DocumentationWindow with the path of the location within the
+        documentation tree (after /doc/ ....".  Note that when using old
+        versions of Wx (before 2.9) and thus not the release version of
+        installers, the help comes up at the top level of the file as
+        webbrowser does not pass anything past the # to the browser when it is
+        running "file:///...."
+
+    :param evt: Triggers on clicking the help button
+    """
+        _TreeLocation = "user/perspectives/fitting/fitting_help.html"
+        _PageAnchor = "#simultaneous-fit-mode"
+        _doc_viewer = DocumentationWindow(self, self.ID_DOC, _TreeLocation,
+                                          _PageAnchor,
+                                          "Simultaneous/Constrained Fitting Help")
+
     def set_manager(self, manager):
         """
@@ -223,6 +505,6 @@
 
         self._update_easy_setup_cb()
-        self.Layout()
-        self.Refresh()
+        self.FitInside()
+
 
     def check_model_name(self, event):
@@ -256,9 +538,9 @@
         if len(self.model_list) == len(self.model_toFit):
             self.cb1.SetValue(True)
-            self.Layout()
+            self.FitInside()
             return
         else:
             self.cb1.SetValue(False)
-            self.Layout()
+            self.FitInside()
 
     def _update_easy_setup_cb(self):
@@ -277,64 +559,4 @@
             self.model_cbox_left.SetSelection(0)
         self.sizer2.Layout()
-        self.sizer3.Layout()
-
-    def draw_page(self):
-        """
-        Draw a sizer containing couples of data and model
-        """
-        self.model_list = []
-        self.model_toFit = []
-        self.constraints_list = []
-        self.constraint_dict = {}
-        self.nb_constraint = 0
-        self.model_cbox_left = None
-        self.model_cbox_right = None
-
-        if len(self.model_list) > 0:
-            for item in self.model_list:
-                item[0].SetValue(False)
-                self.manager.schedule_for_fit(value=0, uid=item[2])
-
-        self.sizer1.Clear(True)
-        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Combinations")
-        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
-        sizer_title = wx.BoxSizer(wx.HORIZONTAL)
-        sizer_couples = wx.GridBagSizer(5, 5)
-        #------------------------------------------------------
-        if len(self.page_finder) == 0:
-            msg = " No fit combinations are found! \n\n"
-            msg += " Please load data and set up "
-            msg += "at least two fit panels first..."
-            sizer_title.Add(wx.StaticText(self, wx.ID_ANY, msg))
-        else:
-            ## store model
-            self._store_model()
-
-            self.cb1 = wx.CheckBox(self, wx.ID_ANY, 'Select all')
-            self.cb1.SetValue(False)
-
-            wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.check_all_model_name)
-
-            sizer_title.Add((10, 10), 0,
-                wx.TOP | wx.BOTTOM | wx.EXPAND | wx.ADJUST_MINSIZE, border=5)
-            sizer_title.Add(self.cb1, 0,
-                wx.TOP | wx.BOTTOM | wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, border=5)
-
-            ## draw list of model and data name
-            self._fill_sizer_model_list(sizer_couples)
-            ## draw the sizer containing constraint info
-            if not self.batch_on:
-                self._fill_sizer_constraint()
-            ## draw fit button
-            self._fill_sizer_fit()
-        #--------------------------------------------------------
-        boxsizer1.Add(sizer_title, flag=wx.TOP | wx.BOTTOM, border=5)
-        boxsizer1.Add(sizer_couples, 1, flag=wx.TOP | wx.BOTTOM, border=5)
-
-        self.sizer1.Add(boxsizer1, 1, wx.EXPAND | wx.ALL, 10)
-        self.sizer1.Layout()
-        #self.SetScrollbars(20,20,25,65)
-        self.AdjustScrollbars()
-        self.Layout()
 
     def _store_model(self):
@@ -362,9 +584,8 @@
             self._show_all_constraint()
             self._show_constraint()
-            self.Layout()
+            self.FitInside()
             return
         else:
             self._hide_constraint()
-            self.Layout()
             return
 
@@ -415,8 +636,5 @@
                              item=sizer_constraint,
                              flag=wx.TOP | wx.BOTTOM | wx.EXPAND, border=5)
-
-        self.sizer_all_constraints.Layout()
-        self.sizer2.Layout()
-        #self.SetScrollbars(20,20,25,65)
+        self.FitInside()
 
     def _on_select_modelcb(self, event):
@@ -475,8 +693,5 @@
                 self._show_constraint()
 
-        self.sizer_constraints.Layout()
-        self.sizer2.Layout()
-        self.SetScrollbars(20, 20, 25, 65)
-        self.Layout()
+        self.FitInside()
         if not has_param:
             msg = " There is no adjustable parameter (checked to fit)"
@@ -564,4 +779,5 @@
         self.sizer_constraints.Layout()
         self.sizer2.Layout()
+        self.Layout
 
     def _hide_constraint(self):
@@ -589,4 +805,6 @@
         self.sizer_constraints.Layout()
         self.sizer2.Layout()
+        self.Layout
+        self.FitInside()
 
     def _on_select_model(self, event):
@@ -620,5 +838,6 @@
         btRemove.Show(True)
         self.btAdd.Show(True)
-        self.sizer2.Layout()
+#        self.Layout()
+        self.FitInside()
 
     def _on_select_param(self, event):
@@ -666,104 +885,9 @@
         ## some model or parameters can be constrained
         self._show_constraint()
-        self.sizer3.Layout()
-        self.Layout()
-        self.Refresh()
-
-    def _fill_sizer_fit(self):
-        """
-        Draw fit button
-        """
-        self.sizer3.Clear(True)
-        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit ")
-        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
-        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-
-        self.btFit = wx.Button(self, self.ID_FIT, 'Fit', size=wx.DefaultSize)
-        self.btFit.Bind(wx.EVT_BUTTON, self.onFit, id=self.btFit.GetId())
-        self.btFit.SetToolTipString("Perform fit.")
-        if self.batch_on:
-            text = " Fit in Parallel all Data set and model selected.\n"
-        else:
-            text = " This page requires at least one FitPage with a data\n"
-            text = " and a model for fitting."
-        text_hint = wx.StaticText(self, wx.ID_ANY, text)
-
-        sizer_button.Add(text_hint, wx.RIGHT | wx.EXPAND, 10)
-        sizer_button.Add(self.btFit, 0, wx.LEFT | wx.ADJUST_MINSIZE, 10)
-
-        boxsizer1.Add(sizer_button, flag=wx.TOP | wx.BOTTOM, border=10)
-        self.sizer3.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10)
-        self.sizer3.Layout()
-
-    def _fill_sizer_constraint(self):
-        """
-        Fill sizer containing constraint info
-        """
-        msg = "Select at least 2 model to add constraint "
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
-
-        self.sizer2.Clear(True)
-        if self.batch_on:
-            if self.sizer2.IsShown():
-                self.sizer2.Show(False)
-            return
-        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Constraints")
-        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
-        sizer_title = wx.BoxSizer(wx.HORIZONTAL)
-        self.sizer_all_constraints = wx.BoxSizer(wx.HORIZONTAL)
-        self.sizer_constraints = wx.BoxSizer(wx.VERTICAL)
-        sizer_button = wx.BoxSizer(wx.HORIZONTAL)
-
-        self.hide_constraint = wx.RadioButton(self, wx.ID_ANY, 'No', (10, 10),
-                                              style=wx.RB_GROUP)
-        self.show_constraint = wx.RadioButton(self, wx.ID_ANY, 'Yes', (10, 30))
-        self.Bind(wx.EVT_RADIOBUTTON, self._display_constraint,
-                  id=self.hide_constraint.GetId())
-        self.Bind(wx.EVT_RADIOBUTTON, self._display_constraint,
-                  id=self.show_constraint.GetId())
-        if self.batch_on:
-            self.hide_constraint.Enable(False)
-            self.show_constraint.Enable(False)
-        self.hide_constraint.SetValue(True)
-        self.show_constraint.SetValue(False)
-
-        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Model"))
-        sizer_title.Add((10, 10))
-        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Parameter"))
-        sizer_title.Add((10, 10))
-        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Add Constraint?"))
-        sizer_title.Add((10, 10))
-        sizer_title.Add(self.show_constraint)
-        sizer_title.Add(self.hide_constraint)
-        sizer_title.Add((10, 10))
-
-        self.btAdd = wx.Button(self, self.ID_ADD, 'Add')
-        self.btAdd.Bind(wx.EVT_BUTTON, self._onAdd_constraint,
-                        id=self.btAdd.GetId())
-        self.btAdd.SetToolTipString("Add another constraint?")
-        self.btAdd.Hide()
-
-        text_hint = wx.StaticText(self, wx.ID_ANY,
-                                  "Example: [M0][paramter] = M1.parameter")
-        sizer_button.Add(text_hint, 0,
-                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10)
-        sizer_button.Add(self.btAdd, 0,
-                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10)
-
-        boxsizer1.Add(sizer_title, flag=wx.TOP | wx.BOTTOM, border=10)
-        boxsizer1.Add(self.sizer_all_constraints, flag=wx.TOP | wx.BOTTOM,
-                      border=10)
-        boxsizer1.Add(self.sizer_constraints, flag=wx.TOP | wx.BOTTOM,
-                      border=10)
-        boxsizer1.Add(sizer_button, flag=wx.TOP | wx.BOTTOM, border=10)
-
-        self.sizer2.Add(boxsizer1, 0, wx.EXPAND | wx.ALL, 10)
-        self.sizer2.Layout()
-
-        #self.SetScrollbars(20,20,25,65)
+        self.FitInside()
 
     def _set_constraint(self):
         """
-        get values from the constrainst textcrtl ,parses them into model name
+        get values from the constraint textcrtl ,parses them into model name
         parameter name and parameters values.
         store them in a list self.params .when when params is not empty
@@ -817,105 +941,4 @@
         return True
 
-    def _fill_sizer_model_list(self, sizer):
-        """
-        Receive a dictionary containing information to display model name
-        """
-        ix = 0
-        iy = 0
-        list = []
-        sizer.Clear(True)
-
-        new_name = wx.StaticText(self, wx.ID_ANY, '  Model Title ',
-                                 style=wx.ALIGN_CENTER)
-        new_name.SetBackgroundColour('orange')
-        new_name.SetForegroundColour(wx.WHITE)
-        sizer.Add(new_name, (iy, ix), (1, 1),
-                            wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
-        ix += 2
-        model_type = wx.StaticText(self, wx.ID_ANY, '  Model ')
-        model_type.SetBackgroundColour('grey')
-        model_type.SetForegroundColour(wx.WHITE)
-        sizer.Add(model_type, (iy, ix), (1, 1),
-                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        data_used = wx.StaticText(self, wx.ID_ANY, '  Data ')
-        data_used.SetBackgroundColour('grey')
-        data_used.SetForegroundColour(wx.WHITE)
-        sizer.Add(data_used, (iy, ix), (1, 1),
-                            wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-        ix += 1
-        tab_used = wx.StaticText(self, wx.ID_ANY, '  FitPage ')
-        tab_used.SetBackgroundColour('grey')
-        tab_used.SetForegroundColour(wx.WHITE)
-        sizer.Add(tab_used, (iy, ix), (1, 1),
-                  wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-        for id, value in self.page_finder.iteritems():
-            if id not in self.parent.opened_pages:
-                continue
-
-            if self.batch_on != self.parent.get_page_by_id(id).batch_on:
-                continue
-
-            data_list = []
-            model_list = []
-            # get data name and model objetta
-            for fitproblem in value.get_fit_problem():
-
-                data = fitproblem.get_fit_data()
-                if not data.is_data:
-                    continue
-                name = '-'
-                if data is not None and data.is_data:
-                    name = str(data.name)
-                data_list.append(name)
-
-                model = fitproblem.get_model()
-                if model is None:
-                    continue
-                model_list.append(model)
-
-            if len(model_list) == 0:
-                continue
-            # Draw sizer
-            ix = 0
-            iy += 1
-            model = model_list[0]
-            name = '_'
-            if model is not None:
-                name = str(model.name)
-            cb = wx.CheckBox(self, wx.ID_ANY, name)
-            cb.SetValue(False)
-            cb.Enable(model is not None and data.is_data)
-            sizer.Add(cb, (iy, ix), (1, 1),
-                      wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
-            wx.EVT_CHECKBOX(self, cb.GetId(), self.check_model_name)
-            ix += 2
-            model_type = wx.StaticText(self, wx.ID_ANY,
-                                       model.__class__.__name__)
-            sizer.Add(model_type, (iy, ix), (1, 1),
-                      wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-            if self.batch_on:
-                data_used = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY)
-                data_used.AppendItems(data_list)
-                data_used.SetSelection(0)
-            else:
-                data_used = wx.StaticText(self, wx.ID_ANY, data_list[0])
-
-            ix += 1
-            sizer.Add(data_used, (iy, ix), (1, 1),
-                      wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-            ix += 1
-            caption = value.get_fit_tab_caption()
-            tab_caption_used = wx.StaticText(self, wx.ID_ANY, str(caption))
-            sizer.Add(tab_caption_used, (iy, ix), (1, 1),
-                      wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-
-            self.model_list.append([cb, value, id, model])
-
-        iy += 1
-        sizer.Add((20, 20), (iy, ix), (1, 1),
-                  wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
-        sizer.Layout()
-
     def on_set_focus(self, event=None):
         """
