Ignore:
Timestamp:
Jul 6, 2009 12:03:08 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
4331b05e
Parents:
ceb89ac
Message:

put the same width for txtcrtl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/models.py

    r7a69683 re7b1ccf  
    11#TODO: add comments to document this module 
    22#TODO: clean-up the exception handling. 
    3 #TODO: clean-up existing comments/documentation.  
    4 #      For example, the _getModelList method advertises  
    5 #      an 'id' parameter that is not part of the method's signature. 
    6 #      It also advertises an ID as return value but it always returns zero. 
     3 
    74#TODO: clean-up the FractalAbsModel and PowerLawAbsModel menu items. Those 
    85#      model definitions do not belong here. They belong with the rest of the 
     
    1613 
    1714(ModelEvent, EVT_MODEL) = wx.lib.newevent.NewEvent() 
    18  
     15from sans.guicomm.events import StatusEvent   
    1916# Time is needed by the log method 
    2017import time 
     
    114111            List of models we want to make available by default 
    115112            for this application 
    116              
    117             @param id: first event ID to register the menu events with 
     113         
    118114            @return: the next free event ID following the new menu events 
    119115        """ 
     
    287283        if len(list1)>0: 
    288284            self.model_combobox.set_list(menuinfo[0],list1) 
    289                
     285             
    290286            for item in list1: 
    291                 id = wx.NewId()  
    292                 struct_factor=item() 
    293                 struct_name = struct_factor.__class__.__name__ 
    294                 if hasattr(struct_factor, "name"): 
    295                     struct_name = struct_factor.name 
    296                      
    297                 menuinfo[1].Append(int(id),struct_name,struct_name) 
    298                 if not  item in self.struct_factor_dict.itervalues(): 
    299                     self.struct_factor_dict[str(id)]= item 
    300                 wx.EVT_MENU(self.event_owner, int(id), self._on_model) 
     287                try: 
     288                    id = wx.NewId()  
     289                    struct_factor=item() 
     290                    struct_name = struct_factor.__class__.__name__ 
     291                    if hasattr(struct_factor, "name"): 
     292                        struct_name = struct_factor.name 
     293                         
     294                    menuinfo[1].Append(int(id),struct_name,struct_name) 
     295                    if not  item in self.struct_factor_dict.itervalues(): 
     296                        self.struct_factor_dict[str(id)]= item 
     297                    wx.EVT_MENU(self.event_owner, int(id), self._on_model) 
     298                except: 
     299                    msg= "Error Occured: %s"%sys.exc_value 
     300                    wx.PostEvent(self.event_owner, StatusEvent(status=msg)) 
    301301                 
    302302        id = wx.NewId()          
Note: See TracChangeset for help on using the changeset viewer.