Changeset 3641881 in sasview for invariantview


Ignore:
Timestamp:
Jul 27, 2010 11:24:22 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:
aa5617d
Parents:
9c1f463
Message:

working on combobbox of data

File:
1 edited

Legend:

Unmodified
Added
Removed
  • invariantview/perspectives/invariant/invariant_panel.py

    rcb274d9e r3641881  
    167167            data_qmin = min (self._data.x) 
    168168            data_qmax = max (self._data.x) 
    169             self.data_name_tcl.SetValue(str(data_name))       
     169            if data.name not in self.data_cbbox.GetItems(): 
     170                self.data_cbbox.Insert(pos=0, clientData=(data, None),  
     171                                       item=data.name) 
     172            else: 
     173                pos = self.data_cbbox.FindString(data.name) 
     174                print "pos", pos 
     175                self.data_cbbox.SetSelection(pos) 
    170176            self.data_min_tcl.SetLabel(str(data_qmin)) 
    171177            self.data_max_tcl.SetLabel(str(data_qmax)) 
     
    679685            current_compute_num = str(current_state['compute_num']) 
    680686        except : 
    681             raise ValueError,  "No such state exists in history" 
     687            raise 
     688            #raise ValueError,  "No such state exists in history" 
    682689         
    683690        # get the state at pre_compute_num 
     
    11791186        self.hint_msg_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    11801187        self.loaded_data_name_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    1181         self.data_name_sizer = wx.BoxSizer(wx.HORIZONTAL) 
     1188        
    11821189        self.data_range_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    11831190        #Sizer related to background and scale 
     
    12251232        self.hint_msg_sizer.Add(self.hint_msg_txt) 
    12261233         
    1227         self.data_txt = wx.StaticText(self, -1,"Loaded Data: ") 
    1228         self.data_cbbox = wx.ComboBox(self, -1, size=(260,20)) 
     1234        self.data_txt = wx.StaticText(self, -1,"Data: ") 
     1235        self.data_cbbox = wx.ComboBox(self, -1, size=(260,20), 
     1236                                      style=wx.CB_READONLY) 
    12291237        self.data_cbbox.Disable() 
    12301238        wx.EVT_COMBOBOX(self.data_cbbox ,-1, self.on_select_data)  
    1231          
    1232  
    1233         #Data name [string] 
    1234         data_name_txt = wx.StaticText(self, -1, 'Data : ')   
    1235         
    1236         self.data_name_tcl = OutputTextCtrl(self, -1,size=(260,20), style=0, name='data_name_tcl')  
    1237         self.data_name_tcl.SetToolTipString("Data's name.") 
     1239     
    12381240        self.loaded_data_name_sizer.AddMany([(self.data_txt, 0, 
    12391241                                               wx.LEFT|wx.RIGHT, 10), 
    12401242                                      (self.data_cbbox, 0, wx.EXPAND)]) 
    1241         self.data_name_sizer.AddMany([(data_name_txt, 0, wx.LEFT|wx.RIGHT, 10), 
    1242                                        (self.data_name_tcl, 0, wx.EXPAND|wx.LEFT,35)]) 
    1243      
    12441243        #Data range [string] 
    12451244        data_range_txt = wx.StaticText(self, -1, 'Total Q Range (1/A): ')  
     
    12571256        self.data_name_boxsizer.AddMany([(self.hint_msg_sizer, 0 , wx.ALL, 5), 
    12581257                            (self.loaded_data_name_sizer, 0 , wx.ALL, 10), 
    1259                                     (self.data_name_sizer, 0 , wx.LEFT|wx.RIGHT, 10), 
    12601258                                     (self.data_range_sizer, 0 , wx.ALL, 10)]) 
    12611259     
Note: See TracChangeset for help on using the changeset viewer.