Index: src/sas/perspectives/fitting/simfitpage.py
===================================================================
--- src/sas/perspectives/fitting/simfitpage.py	(revision acf8e4a58aad50df871a259b771db1d582942abb)
+++ src/sas/perspectives/fitting/simfitpage.py	(revision 6f16e25ca8391464dfcea6ba0d48d6b3702d148e)
@@ -46,6 +46,10 @@
     ## Title to appear on top of the window
     window_caption = "Simultaneous Fit Page"
-
-    def __init__(self, parent, page_finder={}, id= -1, batch_on=False,
+    ID_SET_ALL = wx.NewId()
+    ID_REMOVE = wx.NewId()
+    ID_FIT = wx.NewId()
+    ID_ADD = wx.NewId()
+
+    def __init__(self, parent, page_finder={}, id= wx.ID_ANY, batch_on=False,
                      *args, **kwargs):
         ScrolledPanel.__init__(self, parent, id=id,
@@ -78,5 +82,4 @@
         self.model_cbox_left = None
         self.model_cbox_right = None
-        self.uid = wx.NewId()
         ## draw page
         self.define_page_structure()
@@ -294,5 +297,5 @@
 
         self.sizer1.Clear(True)
-        box_description = wx.StaticBox(self, -1, "Fit Combinations")
+        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Combinations")
         boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
         sizer_title = wx.BoxSizer(wx.HORIZONTAL)
@@ -303,10 +306,10 @@
             msg += " Please load data and set up "
             msg += "at least two fit panels first..."
-            sizer_title.Add(wx.StaticText(self, -1, msg))
+            sizer_title.Add(wx.StaticText(self, wx.ID_ANY, msg))
         else:
             ## store model
             self._store_model()
 
-            self.cb1 = wx.CheckBox(self, -1, 'Select all')
+            self.cb1 = wx.CheckBox(self, wx.ID_ANY, 'Select all')
             self.cb1.SetValue(False)
 
@@ -370,15 +373,15 @@
         Show constraint fields
         """
-        box_description = wx.StaticBox(self, -1, "Easy Setup ")
+        box_description = wx.StaticBox(self, wx.ID_ANY, "Easy Setup ")
         boxsizer = wx.StaticBoxSizer(box_description, wx.HORIZONTAL)
         sizer_constraint = wx.BoxSizer(wx.HORIZONTAL)
-        self.model_cbox_left = wx.ComboBox(self, -1, style=wx.CB_READONLY)
+        self.model_cbox_left = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY)
         self.model_cbox_left.Clear()
-        self.model_cbox_right = wx.ComboBox(self, -1, style=wx.CB_READONLY)
+        self.model_cbox_right = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY)
         self.model_cbox_right.Clear()
-        wx.EVT_COMBOBOX(self.model_cbox_left, -1, self._on_select_modelcb)
-        wx.EVT_COMBOBOX(self.model_cbox_right, -1, self._on_select_modelcb)
-        egal_txt = wx.StaticText(self, -1, " = ")
-        self.set_button = wx.Button(self, wx.NewId(), 'Set All')
+        wx.EVT_COMBOBOX(self.model_cbox_left, wx.ID_ANY, self._on_select_modelcb)
+        wx.EVT_COMBOBOX(self.model_cbox_right, wx.ID_ANY, self._on_select_modelcb)
+        egal_txt = wx.StaticText(self, wx.ID_ANY, " = ")
+        self.set_button = wx.Button(self, self.ID_SET_ALL, 'Set All')
         self.set_button.Bind(wx.EVT_BUTTON, self._on_set_all_equal,
                              id=self.set_button.GetId())
@@ -399,10 +402,10 @@
         boxsizer.Add(self.model_cbox_left,
                              flag=wx.RIGHT | wx.EXPAND, border=10)
-        boxsizer.Add(wx.StaticText(self, -1, ".parameters"),
+        boxsizer.Add(wx.StaticText(self, wx.ID_ANY, ".parameters"),
                              flag=wx.RIGHT | wx.EXPAND, border=5)
         boxsizer.Add(egal_txt, flag=wx.RIGHT | wx.EXPAND, border=5)
         boxsizer.Add(self.model_cbox_right,
                              flag=wx.RIGHT | wx.EXPAND, border=10)
-        boxsizer.Add(wx.StaticText(self, -1, ".parameters"),
+        boxsizer.Add(wx.StaticText(self, wx.ID_ANY, ".parameters"),
                              flag=wx.RIGHT | wx.EXPAND, border=5)
         boxsizer.Add((20, -1))
@@ -510,7 +513,7 @@
 
         sizer_constraint = wx.BoxSizer(wx.HORIZONTAL)
-        model_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY)
+        model_cbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY)
         model_cbox.Clear()
-        param_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY, size=(100, -1),)
+        param_cbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY, size=(100, -1),)
         param_cbox.Hide()
 
@@ -518,8 +521,8 @@
         self.param_cbox = param_cbox
 
-        wx.EVT_COMBOBOX(param_cbox, -1, self._on_select_param)
-        self.ctl2 = wx.TextCtrl(self, -1)
-        egal_txt = wx.StaticText(self, -1, " = ")
-        self.btRemove = wx.Button(self, wx.NewId(), 'Remove')
+        wx.EVT_COMBOBOX(param_cbox, wx.ID_ANY, self._on_select_param)
+        self.ctl2 = wx.TextCtrl(self, wx.ID_ANY)
+        egal_txt = wx.StaticText(self, wx.ID_ANY, " = ")
+        self.btRemove = wx.Button(self, self.ID_REMOVE, 'Remove')
         self.btRemove.Bind(wx.EVT_BUTTON, self.onRemove,
                            id=self.btRemove.GetId())
@@ -536,6 +539,6 @@
         self.model_cbox = model_cbox
 
-        wx.EVT_COMBOBOX(model_cbox, -1, self._on_select_model)
-        sizer_constraint.Add((5, -1))
+        wx.EVT_COMBOBOX(model_cbox, wx.ID_ANY, self._on_select_model)
+        sizer_constraint.Add((5, wx.ID_ANY))
         sizer_constraint.Add(model_cbox, flag=wx.RIGHT | wx.EXPAND, border=10)
         sizer_constraint.Add(param_cbox, flag=wx.RIGHT | wx.EXPAND, border=5)
@@ -672,9 +675,9 @@
         """
         self.sizer3.Clear(True)
-        box_description = wx.StaticBox(self, -1, "Fit ")
+        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, wx.NewId(), 'Fit', size=wx.DefaultSize)
+        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.")
@@ -684,5 +687,5 @@
             text = " This page requires at least one FitPage with a data\n"
             text = " and a model for fitting."
-        text_hint = wx.StaticText(self, -1, text)
+        text_hint = wx.StaticText(self, wx.ID_ANY, text)
 
         sizer_button.Add(text_hint, wx.RIGHT | wx.EXPAND, 10)
@@ -705,5 +708,5 @@
                 self.sizer2.Show(False)
             return
-        box_description = wx.StaticBox(self, -1, "Fit Constraints")
+        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Constraints")
         boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL)
         sizer_title = wx.BoxSizer(wx.HORIZONTAL)
@@ -712,7 +715,7 @@
         sizer_button = wx.BoxSizer(wx.HORIZONTAL)
 
-        self.hide_constraint = wx.RadioButton(self, -1, 'No', (10, 10),
+        self.hide_constraint = wx.RadioButton(self, wx.ID_ANY, 'No', (10, 10),
                                               style=wx.RB_GROUP)
-        self.show_constraint = wx.RadioButton(self, -1, 'Yes', (10, 30))
+        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())
@@ -725,9 +728,9 @@
         self.show_constraint.SetValue(False)
 
-        sizer_title.Add(wx.StaticText(self, -1, " Model"))
+        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Model"))
         sizer_title.Add((10, 10))
-        sizer_title.Add(wx.StaticText(self, -1, " Parameter"))
+        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Parameter"))
         sizer_title.Add((10, 10))
-        sizer_title.Add(wx.StaticText(self, -1, " Add Constraint?"))
+        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Add Constraint?"))
         sizer_title.Add((10, 10))
         sizer_title.Add(self.show_constraint)
@@ -735,5 +738,5 @@
         sizer_title.Add((10, 10))
 
-        self.btAdd = wx.Button(self, wx.NewId(), 'Add')
+        self.btAdd = wx.Button(self, self.ID_ADD, 'Add')
         self.btAdd.Bind(wx.EVT_BUTTON, self._onAdd_constraint,
                         id=self.btAdd.GetId())
@@ -741,5 +744,5 @@
         self.btAdd.Hide()
 
-        text_hint = wx.StaticText(self, -1,
+        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)
@@ -821,5 +824,5 @@
         sizer.Clear(True)
 
-        new_name = wx.StaticText(self, -1, '  Model Title ',
+        new_name = wx.StaticText(self, wx.ID_ANY, '  Model Title ',
                                  style=wx.ALIGN_CENTER)
         new_name.SetBackgroundColour('orange')
@@ -828,5 +831,5 @@
                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
         ix += 2
-        model_type = wx.StaticText(self, -1, '  Model ')
+        model_type = wx.StaticText(self, wx.ID_ANY, '  Model ')
         model_type.SetBackgroundColour('grey')
         model_type.SetForegroundColour(wx.WHITE)
@@ -834,5 +837,5 @@
                             wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
-        data_used = wx.StaticText(self, -1, '  Data ')
+        data_used = wx.StaticText(self, wx.ID_ANY, '  Data ')
         data_used.SetBackgroundColour('grey')
         data_used.SetForegroundColour(wx.WHITE)
@@ -840,5 +843,5 @@
                             wx.EXPAND | wx.ADJUST_MINSIZE, 0)
         ix += 1
-        tab_used = wx.StaticText(self, -1, '  FitPage ')
+        tab_used = wx.StaticText(self, wx.ID_ANY, '  FitPage ')
         tab_used.SetBackgroundColour('grey')
         tab_used.SetForegroundColour(wx.WHITE)
@@ -879,5 +882,5 @@
             if model is not None:
                 name = str(model.name)
-            cb = wx.CheckBox(self, -1, name)
+            cb = wx.CheckBox(self, wx.ID_ANY, name)
             cb.SetValue(False)
             cb.Enable(model is not None and data.is_data)
@@ -887,13 +890,13 @@
             ix += 2
             type = model.__class__.__name__
-            model_type = wx.StaticText(self, -1, str(type))
+            model_type = wx.StaticText(self, wx.ID_ANY, str(type))
             sizer.Add(model_type, (iy, ix), (1, 1),
                       wx.EXPAND | wx.ADJUST_MINSIZE, 0)
             if self.batch_on:
-                data_used = wx.ComboBox(self, -1, style=wx.CB_READONLY)
+                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, -1, data_list[0])
+                data_used = wx.StaticText(self, wx.ID_ANY, data_list[0])
 
             ix += 1
@@ -902,5 +905,5 @@
             ix += 1
             caption = value.get_fit_tab_caption()
-            tab_caption_used = wx.StaticText(self, -1, str(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)
