Changeset 0d21ac1 in sasview for prview


Ignore:
Timestamp:
Aug 4, 2010 11:44:49 AM (14 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:
9e2cfee
Parents:
5b03122
Message:

reverse inversion_panel.py to revision 3059

File:
1 edited

Legend:

Unmodified
Added
Removed
  • prview/perspectives/pr/inversion_panel.py

    r55f5a77 r0d21ac1  
    292292        return state 
    293293     
    294     def set_data(self, list=[], state=None): 
    295         """ 
    296         Receive  a list of data from gui_manager to compute pr 
    297         """ 
    298         msg = "Could not load: \n" 
    299         for data, path in list: 
    300             if data.__class__.__name__ != "Data2D": 
    301                 name = os.path.basename(path) 
    302                 if name not in self.data_cbbox.GetItems(): 
    303                     self.data_cbbox.Insert(item=name,pos=0,clientData=(data, path)) 
    304             else: 
    305                 message = "Prview cannot load Data2D" 
    306                 wx.PostEvent(self.manager.parent, StatusEvent(status=message,  
    307                                                               type="error")) 
    308         if list: 
    309             self.data_cbbox.Enable() 
    310             self.data_cbbox.SetSelection(0) 
    311             self.on_select_data(event=None) 
    312                  
    313     def on_select_data(self, event=None): 
    314         """ 
    315         Select data from combobox 
    316         """ 
    317         position = self.data_cbbox.GetCurrentSelection() 
    318         #For MAC 
    319         data, path = None, None 
    320         if position >= 0: 
    321             data, path = self.data_cbbox.GetClientData(position) 
    322             self._change_file(evt=None, filepath=path) 
    323      
    324294    def set_state(self, state): 
    325295        """ 
     
    394364        boxsizer1.SetMinSize((self._default_width,50)) 
    395365        pars_sizer = wx.GridBagSizer(5,5) 
    396          
    397         self.data_txt = wx.StaticText(self, -1,"Loaded Data: ") 
    398         self.data_cbbox = wx.ComboBox(self, -1, size=(260,20)) 
    399         self.data_cbbox.Disable() 
    400         wx.EVT_COMBOBOX(self.data_cbbox ,-1, self.on_select_data)  
    401          
     366 
    402367        iy = 0 
    403         pars_sizer.Add(self.data_txt, (iy,0), (1,1),  
    404                        wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
    405         pars_sizer.Add(self.data_cbbox , (iy,1), (1,1), 
    406                         wx.EXPAND|wx.LEFT|wx.RIGHT|wx.ADJUST_MINSIZE, 15) 
    407          
    408         iy = 1 
    409368        self.file_radio = wx.StaticText(self, -1, "Data:") 
    410369        pars_sizer.Add(self.file_radio, (iy,0), (1,1), wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
     
    824783            if npts>0 and nfunc>npts: 
    825784                message = "Number of function terms should be smaller than the number of points" 
    826                 wx.PostEvent(self.manager.parent, StatusEvent(status=message,  
    827                                                               type="warning")) 
     785                wx.PostEvent(self.manager.parent, StatusEvent(status=message)) 
    828786                raise ValueError, message 
    829787            self.nfunc_ctl.SetBackgroundColour(wx.WHITE) 
Note: See TracChangeset for help on using the changeset viewer.