Changeset 6f16e25 in sasview for src/sas/perspectives


Ignore:
Timestamp:
Oct 21, 2015 8:35:00 AM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
85130cb
Parents:
2d88fc4
Message:

clean up wx id handling in fitting perspective

Location:
src/sas/perspectives/fitting
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/sas/perspectives/fitting/basepage.py

    r2c8dc19 r6f16e25  
    1515from wx.lib.scrolledpanel import ScrolledPanel 
    1616from sas.guiframe.panel_base import PanelBase 
    17 from sas.guiframe.utils import format_number, check_float 
     17from sas.guiframe.utils import format_number, check_float, IdList 
    1818from sas.guiframe.events import PanelOnFocusEvent 
    1919from sas.guiframe.events import StatusEvent 
     
    5757    ## Title to appear on top of the window 
    5858    window_caption = "Fit Page " 
     59    # These two buttons have specific IDs since they seem to be created more 
     60    # frequently than they need to.  In particular, set_dispers_sizer() is 
     61    # called by _on_select_model 
     62    ID_BOOKMARK = wx.NewId() 
     63    ID_DISPERSER_HELP = wx.NewId() 
     64    _id_pool = IdList() 
    5965 
    6066    def __init__(self, parent, color='blue', **kwargs): 
     
    6672        #Set window's font size 
    6773        self.SetWindowVariant(variant=FONT_VARIANT) 
    68  
    6974        self.SetBackgroundColour(color) 
     75 
     76        self._ids = iter(self._id_pool) 
    7077        ## parent of the page 
    7178        self.parent = parent 
     
    199206        self.popUpMenu = wx.Menu() 
    200207 
    201         id = wx.NewId() 
    202         self._keep = wx.MenuItem(self.popUpMenu, id, "Add bookmark", 
     208        wx_id = self._ids.next() 
     209        self._keep = wx.MenuItem(self.popUpMenu, wx_id, "Add bookmark", 
    203210                                 " Keep the panel status to recall it later") 
    204211        self.popUpMenu.AppendItem(self._keep) 
     
    206213        self._set_bookmark_flag(False) 
    207214        self._set_save_flag(False) 
    208         wx.EVT_MENU(self, id, self.on_bookmark) 
     215        wx.EVT_MENU(self, wx_id, self.on_bookmark) 
    209216        self.popUpMenu.AppendSeparator() 
    210217 
     
    594601        fill sizer containing dispersity info 
    595602        """ 
     603        #print "==== entering set_dispers_sizer ===" 
    596604        self.sizer4.Clear(True) 
    597605        name = "Polydispersity and Orientational Distribution" 
    598         box_description = wx.StaticBox(self, -1, name) 
     606        box_description = wx.StaticBox(self, wx.ID_ANY, name) 
    599607        box_description.SetForegroundColour(wx.BLUE) 
    600608        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    601609        #---------------------------------------------------- 
    602         self.disable_disp = wx.RadioButton(self, -1, 'Off', (10, 10), 
     610        self.disable_disp = wx.RadioButton(self, wx.ID_ANY, 'Off', (10, 10), 
    603611                                           style=wx.RB_GROUP) 
    604         self.enable_disp = wx.RadioButton(self, -1, 'On', (10, 30)) 
     612        self.enable_disp = wx.RadioButton(self, wx.ID_ANY, 'On', (10, 30)) 
    605613        # best size for MAC and PC 
    606614        if ON_MAC: 
     
    608616        else: 
    609617            size_q = (20, 15) 
    610         self.disp_help_bt = wx.Button(self, wx.NewId(), '?', 
     618        self.disp_help_bt = wx.Button(self, self.ID_DISPERSER_HELP, '?', 
    611619                                      style=wx.BU_EXACTFIT, 
    612620                                      size=size_q) 
     
    624632        sizer_dispersion.Add((20, 20)) 
    625633        name = ""  # Polydispersity and \nOrientational Distribution " 
    626         sizer_dispersion.Add(wx.StaticText(self, -1, name)) 
     634        sizer_dispersion.Add(wx.StaticText(self, wx.ID_ANY, name)) 
    627635        sizer_dispersion.Add(self.enable_disp) 
    628636        sizer_dispersion.Add((20, 20)) 
     
    795803        wx.PostEvent(self._manager.parent, StatusEvent(status=msg)) 
    796804 
    797         id = wx.NewId() 
    798         self.popUpMenu.Append(id, name, str(msg)) 
    799         wx.EVT_MENU(self, id, self.onResetModel) 
     805        self.popUpMenu.Append(self.ID_BOOKMARK, name, str(msg)) 
     806        wx.EVT_MENU(self, self.ID_BOOKMARK, self.onResetModel) 
    800807        wx.PostEvent(self._manager.parent, 
    801808                     AppendBookmarkEvent(title=name, 
     
    14381445        reset the context menu 
    14391446        """ 
     1447        ids = iter(self._id_pool)  # Reusing ids for context menu 
    14401448        for name, _ in self.state.saved_states.iteritems(): 
    14411449            self.number_saved_state += 1 
    14421450            ## Add item in the context menu 
    1443             id = wx.NewId() 
     1451            wx_id = ids.next() 
    14441452            msg = 'Save model and state %g' % self.number_saved_state 
    1445             self.popUpMenu.Append(id, name, msg) 
    1446             wx.EVT_MENU(self, id, self.onResetModel) 
     1453            self.popUpMenu.Append(wx_id, name, msg) 
     1454            wx.EVT_MENU(self, wx_id, self.onResetModel) 
    14471455 
    14481456    def _reset_plotting_range(self, state): 
     
    18311839        sld_data.name = 'SLD' 
    18321840        sld_data.axes = self.sld_axes 
    1833         self.panel = SLDPanel(self, data=sld_data, axes=self.sld_axes, id= -1) 
     1841        self.panel = SLDPanel(self, data=sld_data, axes=self.sld_axes, 
     1842                              id=wx.ID_ANY) 
    18341843        self.panel.ShowModal() 
    18351844 
     
    24212430        self.sizer4_4.Clear(True) 
    24222431        text = "No polydispersity available for this model" 
    2423         model_disp = wx.StaticText(self, -1, text) 
     2432        model_disp = wx.StaticText(self, wx.ID_ANY, text) 
    24242433        self.sizer4_4.Add(model_disp, (iy, ix), (1, 1), 
    24252434                          wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10) 
     
    28512860            name = self.formfactorbox.GetValue() 
    28522861            _PageAnchor = '#' + name.lower() 
    2853             _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, 
     2862            _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, 
    28542863                                              _PageAnchor, name + " Help") 
    28552864        else: 
    2856             _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
    2857                                                 "General Model Help") 
     2865            _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, 
     2866                                              "", "General Model Help") 
    28582867 
    28592868 
     
    29062915 
    29072916        _TreeLocation = "_images/M_angles_pic.bmp" 
    2908         _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     2917        _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 
    29092918                                          "Magnetic Angle Defintions") 
    29102919 
     
    29262935 
    29272936        _TreeLocation = "user/perspectives/fitting/mag_help.html" 
    2928         _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     2937        _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 
    29292938                                          "Polarized Beam/Magnetc Help") 
    29302939 
     
    29732982        _TreeLocation = "user/perspectives/fitting/pd_help.html" 
    29742983        _PageAnchor = "" 
    2975         _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, 
     2984        _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, 
    29762985                                          _PageAnchor, "Polydispersity Help") 
    29772986 
     
    35173526        fill sizer containing model info 
    35183527        """ 
     3528        # This should only be called once per fit tab 
     3529        #print "==== Entering _fill_model_sizer" 
    35193530        ##Add model function Details button in fitpanel. 
    35203531        ##The following 3 lines are for Mac. Let JHC know before modifying... 
     
    35223533        self.formfactorbox = None 
    35233534        self.multifactorbox = None 
    3524         self.mbox_description = wx.StaticBox(self, -1, str(title)) 
     3535        self.mbox_description = wx.StaticBox(self, wx.ID_ANY, str(title)) 
    35253536        boxsizer1 = wx.StaticBoxSizer(self.mbox_description, wx.VERTICAL) 
    35263537        sizer_cat = wx.BoxSizer(wx.HORIZONTAL) 
    35273538        self.mbox_description.SetForegroundColour(wx.RED) 
    3528         id = wx.NewId() 
    3529         self.model_func = wx.Button(self, id, 'Help', size=(80, 23)) 
    3530         self.model_func.Bind(wx.EVT_BUTTON, self.on_function_help_clicked, id=id) 
     3539        wx_id = self._ids.next() 
     3540        self.model_func = wx.Button(self, wx_id, 'Help', size=(80, 23)) 
     3541        self.model_func.Bind(wx.EVT_BUTTON, self.on_function_help_clicked, 
     3542                             id=wx_id) 
    35313543        self.model_func.SetToolTipString("Full Model Function Help") 
    3532         id = wx.NewId() 
    3533         self.model_help = wx.Button(self, id, 'Description', size=(80, 23)) 
    3534         self.model_help.Bind(wx.EVT_BUTTON, self.on_model_help_clicked, id=id) 
     3544        wx_id = self._ids.next() 
     3545        self.model_help = wx.Button(self, wx_id, 'Description', size=(80, 23)) 
     3546        self.model_help.Bind(wx.EVT_BUTTON, self.on_model_help_clicked, 
     3547                             id=wx_id) 
    35353548        self.model_help.SetToolTipString("Short Model Function Description") 
    3536         id = wx.NewId() 
    3537         self.model_view = wx.Button(self, id, "Show 2D", size=(80, 23)) 
    3538         self.model_view.Bind(wx.EVT_BUTTON, self._onModel2D, id=id) 
     3549        wx_id = self._ids.next() 
     3550        self.model_view = wx.Button(self, wx_id, "Show 2D", size=(80, 23)) 
     3551        self.model_view.Bind(wx.EVT_BUTTON, self._onModel2D, id=wx_id) 
    35393552        hint = "toggle view of model from 1D to 2D  or 2D to 1D" 
    35403553        self.model_view.SetToolTipString(hint) 
    35413554 
    3542         cat_set_box = wx.StaticBox(self, -1, 'Category') 
     3555        cat_set_box = wx.StaticBox(self, wx.ID_ANY, 'Category') 
    35433556        sizer_cat_box = wx.StaticBoxSizer(cat_set_box, wx.HORIZONTAL) 
    35443557        sizer_cat_box.SetMinSize((200, 50)) 
    3545         self.categorybox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     3558        self.categorybox = wx.ComboBox(self, wx.ID_ANY, 
     3559                                       style=wx.CB_READONLY) 
    35463560        self.categorybox.SetToolTip(wx.ToolTip("Select a Category/Type")) 
    35473561        self._populate_listbox() 
    3548         wx.EVT_COMBOBOX(self.categorybox, -1, self._show_combox) 
    3549         #self.shape_rbutton = wx.RadioButton(self, -1, 'Shapes', 
     3562        wx.EVT_COMBOBOX(self.categorybox, wx.ID_ANY, self._show_combox) 
     3563        #self.shape_rbutton = wx.RadioButton(self, wx.ID_ANY, 'Shapes', 
    35503564        #                                     style=wx.RB_GROUP) 
    3551         #self.shape_indep_rbutton = wx.RadioButton(self, -1, 
     3565        #self.shape_indep_rbutton = wx.RadioButton(self, wx.ID_ANY, 
    35523566        #                                          "Shape-Independent") 
    3553         #self.struct_rbutton = wx.RadioButton(self, -1, "Structure Factor ") 
    3554         #self.plugin_rbutton = wx.RadioButton(self, -1, "Uncategorized") 
     3567        #self.struct_rbutton = wx.RadioButton(self, wx.ID_ANY, 
     3568        #                                     "Structure Factor ") 
     3569        #self.plugin_rbutton = wx.RadioButton(self, wx.ID_ANY, 
     3570        #                                     "Uncategorized") 
    35553571 
    35563572        #self.Bind(wx.EVT_RADIOBUTTON, self._show_combox, 
     
    35643580        #MAC needs SetValue 
    35653581 
    3566         show_cat_button = wx.Button(self, -1, "Modify") 
     3582        show_cat_button = wx.Button(self, wx.ID_ANY, "Modify") 
    35673583        cat_tip = "Modify model categories \n" 
    35683584        cat_tip += "(also accessible from the menu bar)." 
     
    35903606        mutifactor_selection = wx.BoxSizer(wx.HORIZONTAL) 
    35913607 
    3592         self.text1 = wx.StaticText(self, -1, "") 
    3593         self.text2 = wx.StaticText(self, -1, "P(Q)*S(Q)") 
    3594         self.mutifactor_text = wx.StaticText(self, -1, "No. of Shells: ") 
    3595         self.mutifactor_text1 = wx.StaticText(self, -1, "") 
    3596         self.show_sld_button = wx.Button(self, -1, "Show SLD Profile") 
     3608        self.text1 = wx.StaticText(self, wx.ID_ANY, "") 
     3609        self.text2 = wx.StaticText(self, wx.ID_ANY, "P(Q)*S(Q)") 
     3610        self.mutifactor_text = wx.StaticText(self, wx.ID_ANY, "No. of Shells: ") 
     3611        self.mutifactor_text1 = wx.StaticText(self, wx.ID_ANY, "") 
     3612        self.show_sld_button = wx.Button(self, wx.ID_ANY, "Show SLD Profile") 
    35973613        self.show_sld_button.Bind(wx.EVT_BUTTON, self._on_show_sld) 
    35983614 
    3599         self.formfactorbox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     3615        self.formfactorbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
    36003616        self.formfactorbox.SetToolTip(wx.ToolTip("Select a Model")) 
    36013617        if self.model != None: 
    36023618            self.formfactorbox.SetValue(self.model.name) 
    3603         self.structurebox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
    3604         self.multifactorbox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     3619        self.structurebox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
     3620        self.multifactorbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
    36053621        self.initialize_combox() 
    3606         wx.EVT_COMBOBOX(self.formfactorbox, -1, self._on_select_model) 
    3607  
    3608         wx.EVT_COMBOBOX(self.structurebox, -1, self._on_select_model) 
    3609         wx.EVT_COMBOBOX(self.multifactorbox, -1, self._on_select_model) 
     3622        wx.EVT_COMBOBOX(self.formfactorbox, wx.ID_ANY, self._on_select_model) 
     3623 
     3624        wx.EVT_COMBOBOX(self.structurebox, wx.ID_ANY, self._on_select_model) 
     3625        wx.EVT_COMBOBOX(self.multifactorbox, wx.ID_ANY, self._on_select_model) 
    36103626        ## check model type to show sizer 
    36113627        if self.model != None: 
  • src/sas/perspectives/fitting/batchfitpage.py

    r373d4ee r6f16e25  
    3838        fill sizer 0 with data info 
    3939        """ 
    40         self.data_box_description = wx.StaticBox(self, -1, 'I(q) Data Source') 
     40        self.data_box_description = wx.StaticBox(self, wx.ID_ANY, 'I(q) Data Source') 
    4141        if check_data_validity(self.data): 
    4242            dname_color = wx.BLUE 
     
    4747        #---------------------------------------------------------- 
    4848        sizer_data = wx.BoxSizer(wx.VERTICAL) 
    49         text1 = wx.StaticText(self, -1, ' - Choose a file to set initial fit parameters -') 
     49        text1 = wx.StaticText(self, wx.ID_ANY, ' - Choose a file to set initial fit parameters -') 
    5050        text1.SetForegroundColour(wx.RED) 
    5151        sizer_data.Add(text1) 
    52         text2 = wx.StaticText(self, -1, ' - This panel is not designed to view individual fits. - ') 
     52        text2 = wx.StaticText(self, wx.ID_ANY, ' - This panel is not designed to view individual fits. - ') 
    5353        text2.SetForegroundColour(wx.RED) 
    5454        sizer_data.Add(text2) 
    5555 
    5656        combo = wx.BoxSizer(wx.HORIZONTAL) 
    57         self.dataSource = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
    58         wx.EVT_COMBOBOX(self.dataSource, -1, self.on_select_data) 
     57        self.dataSource = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
     58        wx.EVT_COMBOBOX(self.dataSource, wx.ID_ANY, self.on_select_data) 
    5959        self.dataSource.SetMinSize((_DATA_BOX_WIDTH, -1)) 
    6060 
    61         combo.Add(wx.StaticText(self, -1, 'Name : ')) 
     61        combo.Add(wx.StaticText(self, wx.ID_ANY, 'Name : ')) 
    6262        combo.Add((0, 5)) 
    6363        combo.Add(self.dataSource) 
     
    8686#          
    8787#         #Sizers 
    88 #         box_description_range = wx.StaticBox(self, -1, str(title)) 
     88#         box_description_range = wx.StaticBox(self, wx.ID_ANY, str(title)) 
    8989#         boxsizer_range = wx.StaticBoxSizer(box_description_range, wx.VERTICAL)       
    9090#         self.sizer_set_smearer = wx.BoxSizer(wx.VERTICAL) 
     
    9696#         sizer_fit = wx.GridSizer(2, 4, 2, 6) 
    9797#         #Fit button 
    98 #         self.btFit = wx.Button(self, wx.NewId(), 'Fit', size=(88, 25)) 
     98#         self.btFit = wx.Button(self, self._ids.next(), 'Fit', size=(88, 25)) 
    9999#         self.default_bt_colour =  self.btFit.GetDefaultAttributes() 
    100100#         self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id= self.btFit.GetId()) 
     
    102102#  
    103103#         # Update and Draw button 
    104 #         self.draw_button = wx.Button(self, wx.NewId(), 'Compute', size=(88, 24)) 
     104#         self.draw_button = wx.Button(self, self._ids.next(), 'Compute', size=(88, 24)) 
    105105#         self.draw_button.Bind(wx.EVT_BUTTON, \ 
    106106#                               self._onDraw,id=self.draw_button.GetId()) 
     
    122122#         self.sizer5.Clear(True) 
    123123#       
    124 #         self.qmin  = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     124#         self.qmin  = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 
    125125#                                           style=wx.TE_PROCESS_ENTER,  
    126126#                                     text_enter_callback = self._onQrangeEnter) 
     
    128128#         self.qmin.SetToolTipString("Minimun value of Q in linear scale.") 
    129129#       
    130 #         self.qmax  = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     130#         self.qmax  = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 
    131131#                                           style=wx.TE_PROCESS_ENTER,  
    132132#                                         text_enter_callback=self._onQrangeEnter) 
     
    134134#         self.qmax.SetToolTipString("Maximum value of Q in linear scale.") 
    135135#          
    136 #         id = wx.NewId() 
     136#         id = self._ids.next() 
    137137#         self.reset_qrange =wx.Button(self, id, 'Reset', size=(77, 20)) 
    138138#        
     
    144144#         sizer = wx.GridSizer(2, 4, 2, 6) 
    145145#  
    146 #         self.btEditMask = wx.Button(self, wx.NewId(),'Editor', size=(88, 23)) 
     146#         self.btEditMask = wx.Button(self, self._ids.next(),'Editor', size=(88, 23)) 
    147147#         self.btEditMask.Bind(wx.EVT_BUTTON,  
    148148#                              self._onMask,id=self.btEditMask.GetId()) 
    149149#         self.btEditMask.SetToolTipString("Edit Mask.") 
    150 #         self.EditMask_title = wx.StaticText(self, -1, ' Masking(2D)') 
    151 #  
    152 #         sizer.Add(wx.StaticText(self, -1, 'Q range'))      
    153 #         sizer.Add(wx.StaticText(self, -1, ' Min[1/A]')) 
    154 #         sizer.Add(wx.StaticText(self, -1, ' Max[1/A]')) 
     150#         self.EditMask_title = wx.StaticText(self, wx.ID_ANY, ' Masking(2D)') 
     151#  
     152#         sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Q range')) 
     153#         sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Min[1/A]')) 
     154#         sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Max[1/A]')) 
    155155#         sizer.Add(self.EditMask_title) 
    156156 
  • src/sas/perspectives/fitting/fitpage.py

    r225aca8 r6f16e25  
    9393        fill sizer 0 with data info 
    9494        """ 
    95         self.data_box_description = wx.StaticBox(self, -1, 'I(q) Data Source') 
     95        self.data_box_description = wx.StaticBox(self, wx.ID_ANY, 
     96                                                 'I(q) Data Source') 
    9697        if check_data_validity(self.data): 
    9798            dname_color = wx.BLUE 
     
    102103        #---------------------------------------------------------- 
    103104        sizer_data = wx.BoxSizer(wx.HORIZONTAL) 
    104         self.dataSource = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
    105         wx.EVT_COMBOBOX(self.dataSource, -1, self.on_select_data) 
     105        self.dataSource = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
     106        wx.EVT_COMBOBOX(self.dataSource, wx.ID_ANY, self.on_select_data) 
    106107        self.dataSource.SetMinSize((_DATA_BOX_WIDTH, -1)) 
    107         sizer_data.Add(wx.StaticText(self, -1, 'Name : ')) 
     108        sizer_data.Add(wx.StaticText(self, wx.ID_ANY, 'Name : ')) 
    108109        sizer_data.Add(self.dataSource) 
    109110        sizer_data.Add((0, 5)) 
     
    221222 
    222223        #Sizers 
    223         box_description_range = wx.StaticBox(self, -1, str(title)) 
     224        box_description_range = wx.StaticBox(self, wx.ID_ANY, str(title)) 
    224225        box_description_range.SetForegroundColour(wx.BLUE) 
    225226        boxsizer_range = wx.StaticBoxSizer(box_description_range, wx.VERTICAL) 
     
    229230        self.sizer_set_masking = wx.BoxSizer(wx.HORIZONTAL) 
    230231        sizer_chi2 = wx.BoxSizer(wx.VERTICAL) 
    231         smear_set_box = wx.StaticBox(self, -1, 'Set Instrumental Smearing') 
     232        smear_set_box = wx.StaticBox(self, wx.ID_ANY, 
     233                                     'Set Instrumental Smearing') 
    232234        sizer_smearer_box = wx.StaticBoxSizer(smear_set_box, wx.HORIZONTAL) 
    233235        sizer_smearer_box.SetMinSize((_DATA_BOX_WIDTH, 60)) 
    234236 
    235         weighting_set_box = wx.StaticBox(self, -1, \ 
     237        weighting_set_box = wx.StaticBox(self, wx.ID_ANY, 
    236238                                'Set Weighting by Selecting dI Source') 
    237239        weighting_box = wx.StaticBoxSizer(weighting_set_box, wx.HORIZONTAL) 
     
    239241        weighting_box.SetMinSize((_DATA_BOX_WIDTH, 40)) 
    240242        #Filling the sizer containing weighting info. 
    241         self.dI_noweight = wx.RadioButton(self, -1, 'No Weighting', 
    242                                           style=wx.RB_GROUP) 
    243         self.dI_didata = wx.RadioButton(self, -1, 'Use dI Data') 
    244         self.dI_sqrdata = wx.RadioButton(self, -1, 'Use |sqrt(I Data)|') 
    245         self.dI_idata = wx.RadioButton(self, -1, 'Use |I Data|') 
     243        self.dI_noweight = wx.RadioButton(self, wx.ID_ANY, 
     244                                          'No Weighting', style=wx.RB_GROUP) 
     245        self.dI_didata = wx.RadioButton(self, wx.ID_ANY, 'Use dI Data') 
     246        self.dI_sqrdata = wx.RadioButton(self, wx.ID_ANY, 'Use |sqrt(I Data)|') 
     247        self.dI_idata = wx.RadioButton(self, wx.ID_ANY, 'Use |I Data|') 
    246248        self.Bind(wx.EVT_RADIOBUTTON, self.onWeighting, 
    247249                  id=self.dI_noweight.GetId()) 
     
    269271 
    270272        # combobox for smear2d accuracy selection 
    271         self.smear_accuracy = wx.ComboBox(self, -1, size=(50, -1), 
    272                                           style=wx.CB_READONLY) 
     273        self.smear_accuracy = wx.ComboBox(self, wx.ID_ANY, 
     274                                          size=(50, -1), style=wx.CB_READONLY) 
    273275        self._set_accuracy_list() 
    274276        self.smear_accuracy.SetValue(self.smear2d_accuracy) 
    275277        self.smear_accuracy.SetSelection(0) 
    276         self.smear_accuracy.SetToolTipString(\ 
     278        self.smear_accuracy.SetToolTipString( 
    277279            "'Higher' uses more Gaussian points for smearing computation.") 
    278280 
    279         wx.EVT_COMBOBOX(self.smear_accuracy, -1, self._on_select_accuracy) 
     281        wx.EVT_COMBOBOX(self.smear_accuracy, wx.ID_ANY, 
     282                        self._on_select_accuracy) 
    280283 
    281284        #Fit button 
    282         self.btFit = wx.Button(self, wx.NewId(), 'Fit') 
     285        self.btFit = wx.Button(self, self._ids.next(), 'Fit') 
    283286        self.default_bt_colour = self.btFit.GetDefaultAttributes() 
    284287        self.btFit.Bind(wx.EVT_BUTTON, self._onFit, id=self.btFit.GetId()) 
     
    286289 
    287290        #General Help button 
    288         self.btFitHelp = wx.Button(self, -1, 'Help') 
     291        self.btFitHelp = wx.Button(self, wx.ID_ANY, 'Help') 
    289292        self.btFitHelp.SetToolTipString("General fitting help.") 
    290293        self.btFitHelp.Bind(wx.EVT_BUTTON, self._onFitHelp) 
     
    299302        else: 
    300303            size_q = (30, 20)  #on MAC 
    301         self.btSmearHelp = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT,\ 
    302                                      size=size_q) 
     304        self.btSmearHelp = wx.Button(self, wx.ID_ANY, '?', 
     305                                     style=wx.BU_EXACTFIT, size=size_q) 
    303306        self.btSmearHelp.SetToolTipString("Resolution smearing help.") 
    304307        self.btSmearHelp.Bind(wx.EVT_BUTTON, self._onSmearHelp) 
    305308         
    306309        #textcntrl for custom resolution 
    307         self.smear_pinhole_max = ModelTextCtrl(self, -1, 
     310        self.smear_pinhole_max = ModelTextCtrl(self, wx.ID_ANY, 
    308311                            size=(_BOX_WIDTH - 25, 20), 
    309312                            style=wx.TE_PROCESS_ENTER, 
    310313                            text_enter_callback=self.onPinholeSmear) 
    311         self.smear_pinhole_min = ModelTextCtrl(self, -1, 
     314        self.smear_pinhole_min = ModelTextCtrl(self, wx.ID_ANY, 
    312315                            size=(_BOX_WIDTH - 25, 20), 
    313316                            style=wx.TE_PROCESS_ENTER, 
    314317                            text_enter_callback=self.onPinholeSmear) 
    315         self.smear_slit_height = ModelTextCtrl(self, -1, 
     318        self.smear_slit_height = ModelTextCtrl(self, wx.ID_ANY, 
    316319                            size=(_BOX_WIDTH - 25, 20), 
    317320                            style=wx.TE_PROCESS_ENTER, 
    318321                            text_enter_callback=self.onSlitSmear) 
    319         self.smear_slit_width = ModelTextCtrl(self, -1, 
     322        self.smear_slit_width = ModelTextCtrl(self, wx.ID_ANY, 
    320323                            size=(_BOX_WIDTH - 25, 20), 
    321324                            style=wx.TE_PROCESS_ENTER, 
     
    323326 
    324327        ## smear 
    325         self.smear_data_left = BGTextCtrl(self, -1, 
     328        self.smear_data_left = BGTextCtrl(self, wx.ID_ANY, 
    326329                                          size=(_BOX_WIDTH - 25, 20), style=0) 
    327330        self.smear_data_left.SetValue(str(self.dq_l)) 
    328         self.smear_data_right = BGTextCtrl(self, -1, 
     331        self.smear_data_right = BGTextCtrl(self, wx.ID_ANY, 
    329332                                           size=(_BOX_WIDTH - 25, 20), style=0) 
    330333        self.smear_data_right.SetValue(str(self.dq_r)) 
     
    337340 
    338341        #Filling the sizer containing instruments smearing info. 
    339         self.disable_smearer = wx.RadioButton(self, -1, 
     342        self.disable_smearer = wx.RadioButton(self, wx.ID_ANY, 
    340343                                              'None', style=wx.RB_GROUP) 
    341         self.enable_smearer = wx.RadioButton(self, -1, 
    342                                              'Use dQ Data') 
     344        self.enable_smearer = wx.RadioButton(self, wx.ID_ANY, 'Use dQ Data') 
    343345        #self.enable_smearer.SetToolTipString( 
    344346        #"Click to use the loaded dQ data for smearing.") 
    345         self.pinhole_smearer = wx.RadioButton(self, -1, 
     347        self.pinhole_smearer = wx.RadioButton(self, wx.ID_ANY, 
    346348                                              'Custom Pinhole Smear') 
    347349        #self.pinhole_smearer.SetToolTipString 
    348350        #("Click to input custom resolution for pinhole smearing.") 
    349         self.slit_smearer = wx.RadioButton(self, -1, 'Custom Slit Smear') 
     351        self.slit_smearer = wx.RadioButton(self, wx.ID_ANY, 'Custom Slit Smear') 
    350352        #self.slit_smearer.SetToolTipString 
    351353        #("Click to input custom resolution for slit smearing.") 
     
    368370 
    369371        # StaticText for chi2, N(for fitting), Npts + Log/linear spacing 
    370         self.tcChi = BGTextCtrl(self, -1, "-", size=(75, 20), style=0) 
     372        self.tcChi = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 
    371373        self.tcChi.SetToolTipString("Chi2/Npts(Fit)") 
    372         self.Npts_fit = BGTextCtrl(self, -1, "-", size=(75, 20), style=0) 
    373         self.Npts_fit.SetToolTipString(\ 
     374        self.Npts_fit = BGTextCtrl(self, wx.ID_ANY, "-", size=(75, 20), style=0) 
     375        self.Npts_fit.SetToolTipString( 
    374376                            " Npts : number of points selected for fitting") 
    375         self.Npts_total = ModelTextCtrl(self, -1, 
    376                             size=(_BOX_WIDTH, 20), 
     377        self.Npts_total = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 
    377378                            style=wx.TE_PROCESS_ENTER, 
    378379                            text_enter_callback=self._onQrangeEnter) 
     
    382383 
    383384        # Update and Draw button 
    384         self.draw_button = wx.Button(self, wx.NewId(), 'Compute') 
    385         self.draw_button.Bind(wx.EVT_BUTTON, \ 
     385        self.draw_button = wx.Button(self, self._ids.next(), 'Compute') 
     386        self.draw_button.Bind(wx.EVT_BUTTON, 
    386387                              self._onDraw, id=self.draw_button.GetId()) 
    387388        self.draw_button.SetToolTipString("Compute and Draw.") 
    388389 
    389390        self.points_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    390         self.pointsbox = wx.CheckBox(self, -1, 'Log?', (10, 10)) 
     391        self.pointsbox = wx.CheckBox(self, wx.ID_ANY, 'Log?', (10, 10)) 
    391392        self.pointsbox.SetValue(False) 
    392393        self.pointsbox.SetToolTipString("Check mark to use log spaced points") 
    393394        wx.EVT_CHECKBOX(self, self.pointsbox.GetId(), self.select_log) 
    394395 
    395         self.points_sizer.Add(wx.StaticText(self, -1, 'Npts    ')) 
     396        self.points_sizer.Add(wx.StaticText(self, wx.ID_ANY, 'Npts    ')) 
    396397        self.points_sizer.Add(self.pointsbox) 
    397398 
    398         box_description_1 = wx.StaticText(self, -1, '   Chi2/Npts') 
    399         box_description_2 = wx.StaticText(self, -1, 'Npts(Fit)') 
     399        box_description_1 = wx.StaticText(self, wx.ID_ANY, '   Chi2/Npts') 
     400        box_description_2 = wx.StaticText(self, wx.ID_ANY, 'Npts(Fit)') 
    400401 
    401402        # StaticText for smear 
    402         self.smear_description_none = wx.StaticText(self, -1, 
     403        self.smear_description_none = wx.StaticText(self, wx.ID_ANY, 
    403404                                    smear_message_none, style=wx.ALIGN_LEFT) 
    404         self.smear_description_dqdata = wx.StaticText(self, 
    405                                 - 1, smear_message_dqdata, style=wx.ALIGN_LEFT) 
    406         self.smear_description_type = wx.StaticText(self, 
    407                                      - 1, "Type:", style=wx.ALIGN_LEFT) 
    408         self.smear_description_accuracy_type = wx.StaticText(self, -1, 
    409                                         "Accuracy:", style=wx.ALIGN_LEFT) 
    410         self.smear_description_smear_type = BGTextCtrl(self, -1, 
     405        self.smear_description_dqdata = wx.StaticText(self, wx.ID_ANY, 
     406                                smear_message_dqdata, style=wx.ALIGN_LEFT) 
     407        self.smear_description_type = wx.StaticText(self, wx.ID_ANY, 
     408                                    "Type:", style=wx.ALIGN_LEFT) 
     409        self.smear_description_accuracy_type = wx.StaticText(self, wx.ID_ANY, 
     410                                    "Accuracy:", style=wx.ALIGN_LEFT) 
     411        self.smear_description_smear_type = BGTextCtrl(self, wx.ID_ANY, 
    411412                                                       size=(57, 20), style=0) 
    412413        self.smear_description_smear_type.SetValue(str(self.dq_l)) 
    413414        self.SetBackgroundColour(self.GetParent().GetBackgroundColour()) 
    414         self.smear_description_2d = wx.StaticText(self, -1, 
     415        self.smear_description_2d = wx.StaticText(self, wx.ID_ANY, 
    415416                                    smear_message_2d, style=wx.ALIGN_LEFT) 
    416         self.smear_message_new_s = wx.StaticText(self, -1, 
     417        self.smear_message_new_s = wx.StaticText(self, wx.ID_ANY, 
    417418                         smear_message_new_ssmear, style=wx.ALIGN_LEFT) 
    418         self.smear_message_new_p = wx.StaticText(self, -1, 
     419        self.smear_message_new_p = wx.StaticText(self, wx.ID_ANY, 
    419420                            smear_message_new_psmear, style=wx.ALIGN_LEFT) 
    420         self.smear_description_2d_x = wx.StaticText(self, -1, 
     421        self.smear_description_2d_x = wx.StaticText(self, wx.ID_ANY, 
    421422                            smear_message_2d_x_title, style=wx.ALIGN_LEFT) 
    422         self.smear_description_2d_x.SetToolTipString(\ 
     423        self.smear_description_2d_x.SetToolTipString( 
    423424                                        "  dQp(parallel) in q_r direction.") 
    424         self.smear_description_2d_y = wx.StaticText(self, -1, 
     425        self.smear_description_2d_y = wx.StaticText(self, wx.ID_ANY, 
    425426                            smear_message_2d_y_title, style=wx.ALIGN_LEFT) 
    426427        self.smear_description_2d_y.SetToolTipString(\ 
    427428                                    " dQs(perpendicular) in q_phi direction.") 
    428         self.smear_description_pin_min = wx.StaticText(self, -1, 
     429        self.smear_description_pin_min = wx.StaticText(self, wx.ID_ANY, 
    429430                        smear_message_pinhole_min_title, style=wx.ALIGN_LEFT) 
    430         self.smear_description_pin_max = wx.StaticText(self, -1, 
     431        self.smear_description_pin_max = wx.StaticText(self, wx.ID_ANY, 
    431432                        smear_message_pinhole_max_title, style=wx.ALIGN_LEFT) 
    432         self.smear_description_slit_height = wx.StaticText(self, -1, 
     433        self.smear_description_slit_height = wx.StaticText(self, wx.ID_ANY, 
    433434                        smear_message_slit_height_title, style=wx.ALIGN_LEFT) 
    434         self.smear_description_slit_width = wx.StaticText(self, -1, 
     435        self.smear_description_slit_width = wx.StaticText(self, wx.ID_ANY, 
    435436                        smear_message_slit_width_title, style=wx.ALIGN_LEFT) 
    436437 
     
    519520        self.sizer5.Clear(True) 
    520521 
    521         self.qmin = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     522        self.qmin = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 
    522523                                  style=wx.TE_PROCESS_ENTER, 
    523524                                  set_focus_callback=self.qrang_set_focus, 
     
    530531        self.qmin.SetToolTipString(qmin_tip) 
    531532 
    532         self.qmax = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     533        self.qmax = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 
    533534                                  style=wx.TE_PROCESS_ENTER, 
    534535                                  set_focus_callback=self.qrang_set_focus, 
     
    545546        self.qmin.Bind(wx.EVT_TEXT, self.on_qrange_text) 
    546547        self.qmax.Bind(wx.EVT_TEXT, self.on_qrange_text) 
    547         wx_id = wx.NewId() 
     548        wx_id = self._ids.next() 
    548549        self.reset_qrange = wx.Button(self, wx_id, 'Reset') 
    549550 
     
    553554        sizer = wx.GridSizer(5, 5, 2, 6) 
    554555 
    555         self.btEditMask = wx.Button(self, wx.NewId(), 'Editor') 
     556        self.btEditMask = wx.Button(self, self._ids.next(), 'Editor') 
    556557        self.btEditMask.Bind(wx.EVT_BUTTON, self._onMask, 
    557558                             id=self.btEditMask.GetId()) 
    558559        self.btEditMask.SetToolTipString("Edit Mask.") 
    559         self.EditMask_title = wx.StaticText(self, -1, ' Masking(2D)') 
    560  
    561         sizer.Add(wx.StaticText(self, -1, '   Q range')) 
    562         sizer.Add(wx.StaticText(self, -1, ' Min[1/A]')) 
    563         sizer.Add(wx.StaticText(self, -1, ' Max[1/A]')) 
     560        self.EditMask_title = wx.StaticText(self, wx.ID_ANY, ' Masking(2D)') 
     561 
     562        sizer.Add(wx.StaticText(self, wx.ID_ANY, '   Q range')) 
     563        sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Min[1/A]')) 
     564        sizer.Add(wx.StaticText(self, wx.ID_ANY, ' Max[1/A]')) 
    564565        sizer.Add(self.EditMask_title) 
    565566        sizer.Add((-1,5)) 
     
    618619 
    619620        ## fill a sizer with the combobox to select dispersion type 
    620         model_disp = wx.StaticText(self, -1, 'Function') 
     621        model_disp = wx.StaticText(self, wx.ID_ANY, 'Function') 
    621622        CHECK_STATE = self.cb1.GetValue() 
    622623        import sas.models.dispersion_models 
     
    625626        ix = 0 
    626627        iy = 0 
    627         disp = wx.StaticText(self, -1, ' ') 
     628        disp = wx.StaticText(self, wx.ID_ANY, ' ') 
    628629        self.sizer4_4.Add(disp, (iy, ix), (1, 1), 
    629630                          wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    630631        ix += 1 
    631         values = wx.StaticText(self, -1, 'PD[ratio]') 
     632        values = wx.StaticText(self, wx.ID_ANY, 'PD[ratio]') 
    632633        polytext = "Polydispersity (= STD/mean); " 
    633634        polytext += "the standard deviation over the mean value." 
     
    641642        else: 
    642643            err_text = '' 
    643         self.text_disp_1 = wx.StaticText(self, -1, err_text) 
     644        self.text_disp_1 = wx.StaticText(self, wx.ID_ANY, err_text) 
    644645        self.sizer4_4.Add(self.text_disp_1, (iy, ix), (1, 1), \ 
    645646                          wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    646647 
    647648        ix += 1 
    648         self.text_disp_min = wx.StaticText(self, -1, 'Min') 
     649        self.text_disp_min = wx.StaticText(self, wx.ID_ANY, 'Min') 
    649650        self.sizer4_4.Add(self.text_disp_min, (iy, ix), (1, 1), \ 
    650651                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    651652 
    652653        ix += 1 
    653         self.text_disp_max = wx.StaticText(self, -1, 'Max') 
     654        self.text_disp_max = wx.StaticText(self, wx.ID_ANY, 'Max') 
    654655        self.sizer4_4.Add(self.text_disp_max, (iy, ix), (1, 1), 
    655656                          wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    656657 
    657658        ix += 1 
    658         npts = wx.StaticText(self, -1, 'Npts') 
     659        npts = wx.StaticText(self, wx.ID_ANY, 'Npts') 
    659660        npts.SetToolTipString("Number of sampling points for the numerical\n\ 
    660661        integration over the distribution function.") 
     
    662663                          wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    663664        ix += 1 
    664         nsigmas = wx.StaticText(self, -1, 'Nsigs') 
     665        nsigmas = wx.StaticText(self, wx.ID_ANY, 'Nsigs') 
    665666        nsigmas.SetToolTipString("Number of sigmas between which the range\n\ 
    666667         of the distribution function will be used for weighting. \n\ 
     
    695696                    if p == "width": 
    696697                        ix = 0 
    697                         cb = wx.CheckBox(self, -1, name0, (10, 10)) 
     698                        cb = wx.CheckBox(self, wx.ID_ANY, name0, (10, 10)) 
    698699                        cb.SetValue(CHECK_STATE) 
    699700                        cb.SetToolTipString("Check mark to fit") 
     
    703704                        ix = 1 
    704705                        value = self.model.getParam(name1) 
    705                         ctl1 = ModelTextCtrl(self, -1, 
     706                        ctl1 = ModelTextCtrl(self, wx.ID_ANY, 
    706707                                             size=(_BOX_WIDTH / 1.3, 20), 
    707708                                             style=wx.TE_PROCESS_ENTER) 
     
    715716                        ## text to show error sign 
    716717                        ix = 2 
    717                         text2 = wx.StaticText(self, -1, '+/-') 
     718                        text2 = wx.StaticText(self, wx.ID_ANY, '+/-') 
    718719                        self.sizer4_4.Add(text2, (iy, ix), (1, 1), 
    719720                                          wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     
    722723 
    723724                        ix = 3 
    724                         ctl2 = wx.TextCtrl(self, -1, 
     725                        ctl2 = wx.TextCtrl(self, wx.ID_ANY, 
    725726                                           size=(_BOX_WIDTH / 1.3, 20), 
    726727                                           style=0) 
     
    732733 
    733734                        ix = 4 
    734                         ctl3 = ModelTextCtrl(self, -1, 
     735                        ctl3 = ModelTextCtrl(self, wx.ID_ANY, 
    735736                                             size=(_BOX_WIDTH / 2, 20), 
    736737                                             style=wx.TE_PROCESS_ENTER, 
     
    741742 
    742743                        ix = 5 
    743                         ctl4 = ModelTextCtrl(self, -1, 
     744                        ctl4 = ModelTextCtrl(self, wx.ID_ANY, 
    744745                                             size=(_BOX_WIDTH / 2, 20), 
    745746                                             style=wx.TE_PROCESS_ENTER, 
     
    755756                        ix = 6 
    756757                        value = self.model.getParam(name2) 
    757                         Tctl = ModelTextCtrl(self, -1, 
     758                        Tctl = ModelTextCtrl(self, wx.ID_ANY, 
    758759                                             size=(_BOX_WIDTH / 2.2, 20), 
    759760                                             style=wx.TE_PROCESS_ENTER) 
     
    767768                        ix = 7 
    768769                        value = self.model.getParam(name3) 
    769                         Tct2 = ModelTextCtrl(self, -1, 
     770                        Tct2 = ModelTextCtrl(self, wx.ID_ANY, 
    770771                                             size=(_BOX_WIDTH / 2.2, 20), 
    771772                                             style=wx.TE_PROCESS_ENTER) 
     
    779780 
    780781                ix = 8 
    781                 disp_box = wx.ComboBox(self, -1, size=(65, -1), 
     782                disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 
    782783                                       style=wx.CB_READONLY, name='%s' % name1) 
    783784                for key, value in self.polydisp.iteritems(): 
     
    785786                    disp_box.Append(name_disp, value) 
    786787                    disp_box.SetStringSelection("gaussian") 
    787                 wx.EVT_COMBOBOX(disp_box, -1, self._on_disp_func) 
     788                wx.EVT_COMBOBOX(disp_box, wx.ID_ANY, self._on_disp_func) 
    788789                self.sizer4_4.Add(disp_box, (iy, ix), (1, 1), wx.EXPAND) 
    789790                self.fittable_param.append([cb, name1, ctl1, text2, 
     
    815816                    if p == "width": 
    816817                        ix = 0 
    817                         cb = wx.CheckBox(self, -1, name0, (10, 10)) 
     818                        cb = wx.CheckBox(self, wx.ID_ANY, name0, (10, 10)) 
    818819                        cb.SetValue(CHECK_STATE) 
    819820                        cb.SetToolTipString("Check mark to fit") 
     
    828829                        ix = 1 
    829830                        value = self.model.getParam(name1) 
    830                         ctl1 = ModelTextCtrl(self, -1, 
     831                        ctl1 = ModelTextCtrl(self, wx.ID_ANY, 
    831832                                             size=(_BOX_WIDTH / 1.3, 20), 
    832833                                             style=wx.TE_PROCESS_ENTER) 
     
    854855                        ## text to show error sign 
    855856                        ix = 2 
    856                         text2 = wx.StaticText(self, -1, '+/-') 
     857                        text2 = wx.StaticText(self, wx.ID_ANY, '+/-') 
    857858                        self.sizer4_4.Add(text2, (iy, ix), (1, 1), 
    858859                                          wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     
    861862 
    862863                        ix = 3 
    863                         ctl2 = wx.TextCtrl(self, -1, 
     864                        ctl2 = wx.TextCtrl(self, wx.ID_ANY, 
    864865                                           size=(_BOX_WIDTH / 1.3, 20), 
    865866                                           style=0) 
     
    876877 
    877878                        ix = 4 
    878                         ctl3 = ModelTextCtrl(self, -1, 
     879                        ctl3 = ModelTextCtrl(self, wx.ID_ANY, 
    879880                                             size=(_BOX_WIDTH / 2, 20), 
    880881                                             style=wx.TE_PROCESS_ENTER, 
     
    887888 
    888889                        ix = 5 
    889                         ctl4 = ModelTextCtrl(self, -1, 
     890                        ctl4 = ModelTextCtrl(self, wx.ID_ANY, 
    890891                                             size=(_BOX_WIDTH / 2, 20), 
    891892                                             style=wx.TE_PROCESS_ENTER, 
     
    903904                        ix = 6 
    904905                        value = self.model.getParam(name2) 
    905                         Tctl = ModelTextCtrl(self, -1, 
     906                        Tctl = ModelTextCtrl(self, wx.ID_ANY, 
    906907                                             size=(_BOX_WIDTH / 2.2, 20), 
    907908                                             style=wx.TE_PROCESS_ENTER) 
     
    923924                        ix = 7 
    924925                        value = self.model.getParam(name3) 
    925                         Tct2 = ModelTextCtrl(self, -1, 
     926                        Tct2 = ModelTextCtrl(self, wx.ID_ANY, 
    926927                                             size=(_BOX_WIDTH / 2.2, 20), 
    927928                                             style=wx.TE_PROCESS_ENTER) 
     
    943944 
    944945                ix = 8 
    945                 disp_box = wx.ComboBox(self, -1, size=(65, -1), 
     946                disp_box = wx.ComboBox(self, wx.ID_ANY, size=(65, -1), 
    946947                                style=wx.CB_READONLY, name='%s' % name1) 
    947948                for key, value in self.polydisp.iteritems(): 
     
    949950                    disp_box.Append(name_disp, value) 
    950951                    disp_box.SetStringSelection("gaussian") 
    951                 wx.EVT_COMBOBOX(disp_box, -1, self._on_disp_func) 
     952                wx.EVT_COMBOBOX(disp_box, wx.ID_ANY, self._on_disp_func) 
    952953                self.sizer4_4.Add(disp_box, (iy, ix), (1, 1), wx.EXPAND) 
    953954                self.fittable_param.append([cb, name1, ctl1, text2, 
     
    10791080 
    10801081        _TreeLocation = "user/perspectives/fitting/fitting_help.html" 
    1081         _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     1082        _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 
    10821083                                          "General Fitting Help") 
    10831084 
     
    10981099 
    10991100        _TreeLocation = "user/perspectives/fitting/sm_help.html" 
    1100         _doc_viewer = DocumentationWindow(self, -1, _TreeLocation, "", 
     1101        _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "", 
    11011102                                          "Instrumental Resolution Smearing \ 
    11021103                                          Help") 
     
    11821183            self._keep.Enable(False) 
    11831184            self._set_save_flag(False) 
     1185        # TODO: why do we have to variables for one flag?? 
    11841186        self.enable_disp.SetValue(False) 
    11851187        self.disable_disp.SetValue(True) 
     1188        # TODO: should not have an untrapped exception when displaying disperser 
     1189        # TODO: do we need to create the disperser panel on every model change? 
     1190        # Note: if we fix this, then remove ID_DISPERSER_HELP from basepage 
    11861191        try: 
    11871192            self.set_dispers_sizer() 
     
    28312836            return 
    28322837 
    2833         box_description = wx.StaticBox(self, -1, str("Model Parameters")) 
     2838        box_description = wx.StaticBox(self, wx.ID_ANY, str("Model Parameters")) 
    28342839        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    28352840        sizer = wx.GridBagSizer(5, 5) 
     
    28982903        ix = 0 
    28992904        select_text = "Select All" 
    2900         self.cb1 = wx.CheckBox(self, -1, str(select_text), (10, 10)) 
     2905        self.cb1 = wx.CheckBox(self, wx.ID_ANY, str(select_text), (10, 10)) 
    29012906        wx.EVT_CHECKBOX(self, self.cb1.GetId(), self.select_all_param) 
    29022907        self.cb1.SetToolTipString("To check/uncheck all the boxes below.") 
     
    29062911                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5) 
    29072912        ix += 1 
    2908         self.text2_2 = wx.StaticText(self, -1, 'Value') 
     2913        self.text2_2 = wx.StaticText(self, wx.ID_ANY, 'Value') 
    29092914        sizer.Add(self.text2_2, (iy, ix), (1, 1), \ 
    29102915                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    29112916        ix += 2 
    2912         self.text2_3 = wx.StaticText(self, -1, 'Error') 
     2917        self.text2_3 = wx.StaticText(self, wx.ID_ANY, 'Error') 
    29132918        sizer.Add(self.text2_3, (iy, ix), (1, 1), \ 
    29142919                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     
    29162921            self.text2_3.Hide() 
    29172922        ix += 1 
    2918         self.text2_min = wx.StaticText(self, -1, 'Min') 
     2923        self.text2_min = wx.StaticText(self, wx.ID_ANY, 'Min') 
    29192924        sizer.Add(self.text2_min, (iy, ix), (1, 1), \ 
    29202925                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    29212926        #self.text2_min.Hide() 
    29222927        ix += 1 
    2923         self.text2_max = wx.StaticText(self, -1, 'Max') 
     2928        self.text2_max = wx.StaticText(self, wx.ID_ANY, 'Max') 
    29242929        sizer.Add(self.text2_max, (iy, ix), (1, 1), \ 
    29252930                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    29262931        #self.text2_max.Hide() 
    29272932        ix += 1 
    2928         self.text2_4 = wx.StaticText(self, -1, '[Units]') 
     2933        self.text2_4 = wx.StaticText(self, wx.ID_ANY, '[Units]') 
    29292934        sizer.Add(self.text2_4, (iy, ix), (1, 1), \ 
    29302935                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     
    29472952                    self.temp_multi_functional)\ 
    29482953                    and (item in self.model.non_fittable): 
    2949                     non_fittable_name = wx.StaticText(self, -1, item) 
     2954                    non_fittable_name = wx.StaticText(self, wx.ID_ANY, item) 
    29502955                    sizer.Add(non_fittable_name, (iy, ix), (1, 1), \ 
    29512956                            wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 21) 
     
    29552960                    if len(self.model.fun_list) > 0: 
    29562961                        #num = item.split('_')[1][5:7] 
    2957                         fun_box = wx.ComboBox(self, -1, size=(100, -1), 
     2962                        fun_box = wx.ComboBox(self, wx.ID_ANY, size=(100, -1), 
    29582963                                    style=wx.CB_READONLY, name='%s' % item) 
    29592964                        self._set_fun_box_list(fun_box) 
     
    29612966                        #self.fun_box.SetToolTipString("A function 
    29622967                        #    describing the interface") 
    2963                         wx.EVT_COMBOBOX(fun_box, -1, self._on_fun_box) 
     2968                        wx.EVT_COMBOBOX(fun_box, wx.ID_ANY, self._on_fun_box) 
    29642969                    else: 
    2965                         fun_box = ModelTextCtrl(self, -1, 
     2970                        fun_box = ModelTextCtrl(self, wx.ID_ANY, 
    29662971                                                size=(_BOX_WIDTH, 20), 
    29672972                                style=wx.TE_PROCESS_ENTER, name='%s' % item) 
     
    29752980                else: 
    29762981                    ## add parameters name with checkbox for selecting to fit 
    2977                     cb = wx.CheckBox(self, -1, item) 
     2982                    cb = wx.CheckBox(self, wx.ID_ANY, item) 
    29782983                    cb.SetValue(CHECK_STATE) 
    29792984                    cb.SetToolTipString(" Check mark to fit.") 
     
    29872992                    ix += 1 
    29882993                    value = self.model.getParam(item) 
    2989                     ctl1 = ModelTextCtrl(self, -1, size=(_BOX_WIDTH, 20), 
     2994                    ctl1 = ModelTextCtrl(self, wx.ID_ANY, size=(_BOX_WIDTH, 20), 
    29902995                                         style=wx.TE_PROCESS_ENTER) 
    29912996                    ctl1.SetToolTipString(\ 
     
    29953000                    ## text to show error sign 
    29963001                    ix += 1 
    2997                     text2 = wx.StaticText(self, -1, '+/-') 
     3002                    text2 = wx.StaticText(self, wx.ID_ANY, '+/-') 
    29983003                    sizer.Add(text2, (iy, ix), (1, 1), \ 
    29993004                              wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
     
    30013006                        text2.Hide() 
    30023007                    ix += 1 
    3003                     ctl2 = wx.TextCtrl(self, -1, 
     3008                    ctl2 = wx.TextCtrl(self, wx.ID_ANY, 
    30043009                                       size=(_BOX_WIDTH / 1.2, 20), style=0) 
    30053010                    sizer.Add(ctl2, (iy, ix), (1, 1), 
     
    30093014 
    30103015                    ix += 1 
    3011                     ctl3 = ModelTextCtrl(self, -1, 
     3016                    ctl3 = ModelTextCtrl(self, wx.ID_ANY, 
    30123017                                         size=(_BOX_WIDTH / 1.9, 20), 
    30133018                                         style=wx.TE_PROCESS_ENTER, 
     
    30213026 
    30223027                    ix += 1 
    3023                     ctl4 = ModelTextCtrl(self, -1, 
     3028                    ctl4 = ModelTextCtrl(self, wx.ID_ANY, 
    30243029                                         size=(_BOX_WIDTH / 1.9, 20), 
    30253030                                         style=wx.TE_PROCESS_ENTER, 
     
    30343039                    # Units 
    30353040                    if item in self.model.details: 
    3036                         units = wx.StaticText(self, -1, 
     3041                        units = wx.StaticText(self, wx.ID_ANY, 
    30373042                            self.model.details[item][0], style=wx.ALIGN_LEFT) 
    30383043                    else: 
    3039                         units = wx.StaticText(self, -1, "", 
     3044                        units = wx.StaticText(self, wx.ID_ANY, "", 
    30403045                                              style=wx.ALIGN_LEFT) 
    30413046                    sizer.Add(units, (iy, ix), (1, 1), 
     
    30603065        for item in keys: 
    30613066            if item in self.model.orientation_params: 
    3062                 orient_angle = wx.StaticText(self, -1, '[For 2D only]:') 
    3063                 mag_on_button = wx.Button(self, -1, "Magnetic ON") 
     3067                orient_angle = wx.StaticText(self, wx.ID_ANY, '[For 2D only]:') 
     3068                mag_on_button = wx.Button(self, wx.ID_ANY, "Magnetic ON") 
    30643069                mag_on_button.SetToolTipString("Turn Pol Beam/Mag scatt on/off") 
    30653070                mag_on_button.Bind(wx.EVT_BUTTON, self._on_mag_on) 
    3066                 mag_angle_help_button = wx.Button(self, -1, "Magnetic angles?") 
     3071                mag_angle_help_button = wx.Button(self, wx.ID_ANY, "Magnetic angles?") 
    30673072                mag_angle_help_button.SetToolTipString("see angle definitions") 
    3068                 mag_help_button = wx.Button(self, -1, "Mag HELP") 
     3073                mag_help_button = wx.Button(self, wx.ID_ANY, "Mag HELP") 
    30693074                mag_help_button.SetToolTipString("Help on pol beam/mag fitting") 
    30703075                mag_help_button.Bind(wx.EVT_BUTTON, self._on_mag_help) 
     
    31243129                    ix = 0 
    31253130                    ## add parameters name with checkbox for selecting to fit 
    3126                     cb = wx.CheckBox(self, -1, item) 
     3131                    cb = wx.CheckBox(self, wx.ID_ANY, item) 
    31273132                    cb.SetValue(CHECK_STATE) 
    31283133                    cb.SetToolTipString("Check mark to fit") 
  • src/sas/perspectives/fitting/fitpanel.py

    rac7be54 r6f16e25  
    3636        """ 
    3737        """ 
    38         nb.__init__(self, parent, -1, 
     38        nb.__init__(self, parent, wx.ID_ANY, 
    3939                    style=wx.aui.AUI_NB_WINDOWLIST_BUTTON | 
    4040                    wx.aui.AUI_NB_DEFAULT_STYLE | 
     
    324324        if caption == "Const & Simul Fit": 
    325325            self.sim_page = SimultaneousFitPage(self, page_finder=page_finder, 
    326                                                  id= -1, batch_on=False) 
     326                                                 id= wx.ID_ANY, batch_on=False) 
    327327            self.sim_page.window_caption = caption 
    328328            self.sim_page.window_name = caption 
  • src/sas/perspectives/fitting/fitting.py

    r7945367 r6f16e25  
    277277        model_list = model_manager.get_model_name_list() 
    278278        plug_dir = models.find_plugins_dir() 
    279         textdial = TextDialog(None, self, -1, 'Easy Sum/Multi(p1, p2) Editor', 
     279        textdial = TextDialog(None, self, wx.ID_ANY, 'Easy Sum/Multi(p1, p2) Editor', 
    280280                              model_list, plug_dir) 
    281281        self.put_icon(textdial) 
     
    760760        _TreeLocation = "user/perspectives/fitting/optimizer.html" 
    761761        _anchor = "#fit-"+algorithm_id 
    762         DocumentationWindow(self.parent, -1, _TreeLocation, _anchor, "Optimizer Help") 
     762        DocumentationWindow(self.parent, wx.ID_ANY, _TreeLocation, _anchor, "Optimizer Help") 
    763763 
    764764 
  • src/sas/perspectives/fitting/fitting_widgets.py

    r2f4b430 r6f16e25  
    4141        """ 
    4242        vbox = wx.BoxSizer(wx.VERTICAL) 
    43         box_description = wx.StaticBox(self, -1, str("Hint")) 
     43        box_description = wx.StaticBox(self, wx.ID_ANY, str("Hint")) 
    4444        hint_sizer = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    4545        selection_sizer = wx.GridBagSizer(5, 5) 
    4646        button_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    47         self.data_1d_selected = wx.RadioButton(self, -1, 'Data1D', 
     47        self.data_1d_selected = wx.RadioButton(self, wx.ID_ANY, 'Data1D', 
    4848                                                style=wx.RB_GROUP) 
    49         self.data_2d_selected = wx.RadioButton(self, -1, 'Data2D') 
     49        self.data_2d_selected = wx.RadioButton(self, wx.ID_ANY, 'Data2D') 
    5050        self.data_1d_selected.SetValue(True) 
    5151        self.data_2d_selected.SetValue(False) 
     
    5555        hint = "Selected Data set contains both 1D and 2D Data.\n" 
    5656        hint += "Please select on type of analysis before proceeding.\n" 
    57         hint_sizer.Add(wx.StaticText(self, -1, hint)) 
     57        hint_sizer.Add(wx.StaticText(self, wx.ID_ANY, hint)) 
    5858        #draw area containing radio buttons 
    5959        ix = 0 
     
    7272        vbox.Add(hint_sizer, 0, wx.EXPAND | wx.ALL, 10) 
    7373        vbox.Add(selection_sizer, 0, wx.TOP | wx.BOTTOM, 10) 
    74         vbox.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
     74        vbox.Add(wx.StaticLine(self, wx.ID_ANY), 0, wx.EXPAND, 0) 
    7575        vbox.Add(button_sizer, 0, wx.TOP | wx.BOTTOM, 10) 
    7676        self.SetSizer(vbox) 
     
    103103            return 
    104104        select_data_text = " %s Data selected.\n" % str(self._nb_selected_data) 
    105         self._data_text_ctrl = wx.StaticText(self, -1, str(select_data_text)) 
     105        self._data_text_ctrl = wx.StaticText(self, wx.ID_ANY, str(select_data_text)) 
    106106 
    107107        self._data_text_ctrl.SetForegroundColour('blue') 
     
    126126            text += "for adequate plot display size. \n" 
    127127            text += "unchecked data won't be send to fitting . \n" 
    128         text_ctrl = wx.StaticText(self, -1, str(text)) 
     128        text_ctrl = wx.StaticText(self, wx.ID_ANY, str(text)) 
    129129        self._sizer_txt.Add(text_ctrl) 
    130130        iy = 0 
     
    133133        for i in range(len(data_list)): 
    134134            data_count += 1 
    135             cb = wx.CheckBox(self._panel, -1, str(data_list[i].name), (10, 10)) 
     135            cb = wx.CheckBox(self._panel, wx.ID_ANY, str(data_list[i].name), (10, 10)) 
    136136            wx.EVT_CHECKBOX(self, cb.GetId(), self._count_selected_data) 
    137137            if data_count <= MAX_NBR_DATA: 
     
    153153        self._sizer_button.Add(button_OK, 0, 
    154154                                wx.LEFT | wx.RIGHT | wx.ADJUST_MINSIZE, 10) 
    155         static_line = wx.StaticLine(self, -1) 
     155        static_line = wx.StaticLine(self, wx.ID_ANY) 
    156156        self._sizer_txt.Add(self._panel, 0, wx.EXPAND | wx.ALL, 10) 
    157157        self._sizer_main.Add(self._sizer_txt, 0, wx.EXPAND | wx.ALL, 10) 
  • src/sas/perspectives/fitting/hint_fitpage.py

    r2f4b430 r6f16e25  
    2727        """ 
    2828        name = "Hint" 
    29         box_description = wx.StaticBox(self, -1, name) 
     29        box_description = wx.StaticBox(self, wx.ID_ANY, name) 
    3030        boxsizer = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    3131        msg = "    How to link data to the control panel: \n \n" 
     
    3333        msg += "    Then Highlight and right click on the data plot. \n" 
    3434        msg += "    Finally, select 'Select data for fitting' in the pop-up menu. \n" 
    35         self.hint_txt = wx.StaticText(self, -1, msg, style=wx.ALIGN_LEFT) 
     35        self.hint_txt = wx.StaticText(self, wx.ID_ANY, msg, style=wx.ALIGN_LEFT) 
    3636        boxsizer.Add(self.hint_txt, wx.ALL | wx.EXPAND, 20) 
    3737        self.vbox = wx.BoxSizer(wx.VERTICAL) 
  • src/sas/perspectives/fitting/pagestate.py

    r0e33a8d r6f16e25  
    605605        images = self.set_plot_state(figs, canvases) 
    606606        report_list = [report_str, text_str, images] 
    607         dialog = ReportDialog(report_list, None, -1, "") 
     607        dialog = ReportDialog(report_list, None, wx.ID_ANY, "") 
    608608        dialog.Show() 
    609609 
  • src/sas/perspectives/fitting/resultpanel.py

    r9df6a03 r6f16e25  
    4141                 | wx.CLIP_CHILDREN) 
    4242                 & ~wx.aui.AUI_NB_CLOSE_ON_ACTIVE_TAB) 
    43         Notebook.__init__(self, parent, -1, style=style) 
     43        Notebook.__init__(self, parent, wx.ID_ANY, style=style) 
    4444        PanelBase.__init__(self, parent) 
    4545        self.frame = parent 
  • src/sas/perspectives/fitting/simfitpage.py

    racf8e4a5 r6f16e25  
    4646    ## Title to appear on top of the window 
    4747    window_caption = "Simultaneous Fit Page" 
    48  
    49     def __init__(self, parent, page_finder={}, id= -1, batch_on=False, 
     48    ID_SET_ALL = wx.NewId() 
     49    ID_REMOVE = wx.NewId() 
     50    ID_FIT = wx.NewId() 
     51    ID_ADD = wx.NewId() 
     52 
     53    def __init__(self, parent, page_finder={}, id= wx.ID_ANY, batch_on=False, 
    5054                     *args, **kwargs): 
    5155        ScrolledPanel.__init__(self, parent, id=id, 
     
    7882        self.model_cbox_left = None 
    7983        self.model_cbox_right = None 
    80         self.uid = wx.NewId() 
    8184        ## draw page 
    8285        self.define_page_structure() 
     
    294297 
    295298        self.sizer1.Clear(True) 
    296         box_description = wx.StaticBox(self, -1, "Fit Combinations") 
     299        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Combinations") 
    297300        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    298301        sizer_title = wx.BoxSizer(wx.HORIZONTAL) 
     
    303306            msg += " Please load data and set up " 
    304307            msg += "at least two fit panels first..." 
    305             sizer_title.Add(wx.StaticText(self, -1, msg)) 
     308            sizer_title.Add(wx.StaticText(self, wx.ID_ANY, msg)) 
    306309        else: 
    307310            ## store model 
    308311            self._store_model() 
    309312 
    310             self.cb1 = wx.CheckBox(self, -1, 'Select all') 
     313            self.cb1 = wx.CheckBox(self, wx.ID_ANY, 'Select all') 
    311314            self.cb1.SetValue(False) 
    312315 
     
    370373        Show constraint fields 
    371374        """ 
    372         box_description = wx.StaticBox(self, -1, "Easy Setup ") 
     375        box_description = wx.StaticBox(self, wx.ID_ANY, "Easy Setup ") 
    373376        boxsizer = wx.StaticBoxSizer(box_description, wx.HORIZONTAL) 
    374377        sizer_constraint = wx.BoxSizer(wx.HORIZONTAL) 
    375         self.model_cbox_left = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     378        self.model_cbox_left = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
    376379        self.model_cbox_left.Clear() 
    377         self.model_cbox_right = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     380        self.model_cbox_right = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
    378381        self.model_cbox_right.Clear() 
    379         wx.EVT_COMBOBOX(self.model_cbox_left, -1, self._on_select_modelcb) 
    380         wx.EVT_COMBOBOX(self.model_cbox_right, -1, self._on_select_modelcb) 
    381         egal_txt = wx.StaticText(self, -1, " = ") 
    382         self.set_button = wx.Button(self, wx.NewId(), 'Set All') 
     382        wx.EVT_COMBOBOX(self.model_cbox_left, wx.ID_ANY, self._on_select_modelcb) 
     383        wx.EVT_COMBOBOX(self.model_cbox_right, wx.ID_ANY, self._on_select_modelcb) 
     384        egal_txt = wx.StaticText(self, wx.ID_ANY, " = ") 
     385        self.set_button = wx.Button(self, self.ID_SET_ALL, 'Set All') 
    383386        self.set_button.Bind(wx.EVT_BUTTON, self._on_set_all_equal, 
    384387                             id=self.set_button.GetId()) 
     
    399402        boxsizer.Add(self.model_cbox_left, 
    400403                             flag=wx.RIGHT | wx.EXPAND, border=10) 
    401         boxsizer.Add(wx.StaticText(self, -1, ".parameters"), 
     404        boxsizer.Add(wx.StaticText(self, wx.ID_ANY, ".parameters"), 
    402405                             flag=wx.RIGHT | wx.EXPAND, border=5) 
    403406        boxsizer.Add(egal_txt, flag=wx.RIGHT | wx.EXPAND, border=5) 
    404407        boxsizer.Add(self.model_cbox_right, 
    405408                             flag=wx.RIGHT | wx.EXPAND, border=10) 
    406         boxsizer.Add(wx.StaticText(self, -1, ".parameters"), 
     409        boxsizer.Add(wx.StaticText(self, wx.ID_ANY, ".parameters"), 
    407410                             flag=wx.RIGHT | wx.EXPAND, border=5) 
    408411        boxsizer.Add((20, -1)) 
     
    510513 
    511514        sizer_constraint = wx.BoxSizer(wx.HORIZONTAL) 
    512         model_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     515        model_cbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
    513516        model_cbox.Clear() 
    514         param_cbox = wx.ComboBox(self, -1, style=wx.CB_READONLY, size=(100, -1),) 
     517        param_cbox = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY, size=(100, -1),) 
    515518        param_cbox.Hide() 
    516519 
     
    518521        self.param_cbox = param_cbox 
    519522 
    520         wx.EVT_COMBOBOX(param_cbox, -1, self._on_select_param) 
    521         self.ctl2 = wx.TextCtrl(self, -1) 
    522         egal_txt = wx.StaticText(self, -1, " = ") 
    523         self.btRemove = wx.Button(self, wx.NewId(), 'Remove') 
     523        wx.EVT_COMBOBOX(param_cbox, wx.ID_ANY, self._on_select_param) 
     524        self.ctl2 = wx.TextCtrl(self, wx.ID_ANY) 
     525        egal_txt = wx.StaticText(self, wx.ID_ANY, " = ") 
     526        self.btRemove = wx.Button(self, self.ID_REMOVE, 'Remove') 
    524527        self.btRemove.Bind(wx.EVT_BUTTON, self.onRemove, 
    525528                           id=self.btRemove.GetId()) 
     
    536539        self.model_cbox = model_cbox 
    537540 
    538         wx.EVT_COMBOBOX(model_cbox, -1, self._on_select_model) 
    539         sizer_constraint.Add((5, -1)) 
     541        wx.EVT_COMBOBOX(model_cbox, wx.ID_ANY, self._on_select_model) 
     542        sizer_constraint.Add((5, wx.ID_ANY)) 
    540543        sizer_constraint.Add(model_cbox, flag=wx.RIGHT | wx.EXPAND, border=10) 
    541544        sizer_constraint.Add(param_cbox, flag=wx.RIGHT | wx.EXPAND, border=5) 
     
    672675        """ 
    673676        self.sizer3.Clear(True) 
    674         box_description = wx.StaticBox(self, -1, "Fit ") 
     677        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit ") 
    675678        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    676679        sizer_button = wx.BoxSizer(wx.HORIZONTAL) 
    677680 
    678         self.btFit = wx.Button(self, wx.NewId(), 'Fit', size=wx.DefaultSize) 
     681        self.btFit = wx.Button(self, self.ID_FIT, 'Fit', size=wx.DefaultSize) 
    679682        self.btFit.Bind(wx.EVT_BUTTON, self.onFit, id=self.btFit.GetId()) 
    680683        self.btFit.SetToolTipString("Perform fit.") 
     
    684687            text = " This page requires at least one FitPage with a data\n" 
    685688            text = " and a model for fitting." 
    686         text_hint = wx.StaticText(self, -1, text) 
     689        text_hint = wx.StaticText(self, wx.ID_ANY, text) 
    687690 
    688691        sizer_button.Add(text_hint, wx.RIGHT | wx.EXPAND, 10) 
     
    705708                self.sizer2.Show(False) 
    706709            return 
    707         box_description = wx.StaticBox(self, -1, "Fit Constraints") 
     710        box_description = wx.StaticBox(self, wx.ID_ANY, "Fit Constraints") 
    708711        boxsizer1 = wx.StaticBoxSizer(box_description, wx.VERTICAL) 
    709712        sizer_title = wx.BoxSizer(wx.HORIZONTAL) 
     
    712715        sizer_button = wx.BoxSizer(wx.HORIZONTAL) 
    713716 
    714         self.hide_constraint = wx.RadioButton(self, -1, 'No', (10, 10), 
     717        self.hide_constraint = wx.RadioButton(self, wx.ID_ANY, 'No', (10, 10), 
    715718                                              style=wx.RB_GROUP) 
    716         self.show_constraint = wx.RadioButton(self, -1, 'Yes', (10, 30)) 
     719        self.show_constraint = wx.RadioButton(self, wx.ID_ANY, 'Yes', (10, 30)) 
    717720        self.Bind(wx.EVT_RADIOBUTTON, self._display_constraint, 
    718721                  id=self.hide_constraint.GetId()) 
     
    725728        self.show_constraint.SetValue(False) 
    726729 
    727         sizer_title.Add(wx.StaticText(self, -1, " Model")) 
     730        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Model")) 
    728731        sizer_title.Add((10, 10)) 
    729         sizer_title.Add(wx.StaticText(self, -1, " Parameter")) 
     732        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Parameter")) 
    730733        sizer_title.Add((10, 10)) 
    731         sizer_title.Add(wx.StaticText(self, -1, " Add Constraint?")) 
     734        sizer_title.Add(wx.StaticText(self, wx.ID_ANY, " Add Constraint?")) 
    732735        sizer_title.Add((10, 10)) 
    733736        sizer_title.Add(self.show_constraint) 
     
    735738        sizer_title.Add((10, 10)) 
    736739 
    737         self.btAdd = wx.Button(self, wx.NewId(), 'Add') 
     740        self.btAdd = wx.Button(self, self.ID_ADD, 'Add') 
    738741        self.btAdd.Bind(wx.EVT_BUTTON, self._onAdd_constraint, 
    739742                        id=self.btAdd.GetId()) 
     
    741744        self.btAdd.Hide() 
    742745 
    743         text_hint = wx.StaticText(self, -1, 
     746        text_hint = wx.StaticText(self, wx.ID_ANY, 
    744747                                  "Example: [M0][paramter] = M1.parameter") 
    745748        sizer_button.Add(text_hint, 0 , wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 10) 
     
    821824        sizer.Clear(True) 
    822825 
    823         new_name = wx.StaticText(self, -1, '  Model Title ', 
     826        new_name = wx.StaticText(self, wx.ID_ANY, '  Model Title ', 
    824827                                 style=wx.ALIGN_CENTER) 
    825828        new_name.SetBackgroundColour('orange') 
     
    828831                            wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15) 
    829832        ix += 2 
    830         model_type = wx.StaticText(self, -1, '  Model ') 
     833        model_type = wx.StaticText(self, wx.ID_ANY, '  Model ') 
    831834        model_type.SetBackgroundColour('grey') 
    832835        model_type.SetForegroundColour(wx.WHITE) 
     
    834837                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    835838        ix += 1 
    836         data_used = wx.StaticText(self, -1, '  Data ') 
     839        data_used = wx.StaticText(self, wx.ID_ANY, '  Data ') 
    837840        data_used.SetBackgroundColour('grey') 
    838841        data_used.SetForegroundColour(wx.WHITE) 
     
    840843                            wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    841844        ix += 1 
    842         tab_used = wx.StaticText(self, -1, '  FitPage ') 
     845        tab_used = wx.StaticText(self, wx.ID_ANY, '  FitPage ') 
    843846        tab_used.SetBackgroundColour('grey') 
    844847        tab_used.SetForegroundColour(wx.WHITE) 
     
    879882            if model is not None: 
    880883                name = str(model.name) 
    881             cb = wx.CheckBox(self, -1, name) 
     884            cb = wx.CheckBox(self, wx.ID_ANY, name) 
    882885            cb.SetValue(False) 
    883886            cb.Enable(model is not None and data.is_data) 
     
    887890            ix += 2 
    888891            type = model.__class__.__name__ 
    889             model_type = wx.StaticText(self, -1, str(type)) 
     892            model_type = wx.StaticText(self, wx.ID_ANY, str(type)) 
    890893            sizer.Add(model_type, (iy, ix), (1, 1), 
    891894                      wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
    892895            if self.batch_on: 
    893                 data_used = wx.ComboBox(self, -1, style=wx.CB_READONLY) 
     896                data_used = wx.ComboBox(self, wx.ID_ANY, style=wx.CB_READONLY) 
    894897                data_used.AppendItems(data_list) 
    895898                data_used.SetSelection(0) 
    896899            else: 
    897                 data_used = wx.StaticText(self, -1, data_list[0]) 
     900                data_used = wx.StaticText(self, wx.ID_ANY, data_list[0]) 
    898901 
    899902            ix += 1 
     
    902905            ix += 1 
    903906            caption = value.get_fit_tab_caption() 
    904             tab_caption_used = wx.StaticText(self, -1, str(caption)) 
     907            tab_caption_used = wx.StaticText(self, wx.ID_ANY, str(caption)) 
    905908            sizer.Add(tab_caption_used, (iy, ix), (1, 1), 
    906909                      wx.EXPAND | wx.ADJUST_MINSIZE, 0) 
Note: See TracChangeset for help on using the changeset viewer.