Ignore:
Timestamp:
Jun 25, 2012 12:37:13 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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:
acc254f
Parents:
33c671e
Message:

better layout for MAC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • calculatorview/src/sans/perspectives/calculator/data_operator.py

    r33c671e r5a5bb29  
    8888        data2_hori_sizer = wx.BoxSizer(wx.HORIZONTAL) 
    8989        data_name = wx.StaticText(self, -1, 'Output Data Name')   
    90         equal_name = wx.StaticText(self, -1, ' =',  size=(50, 23))  
     90        equal_name = wx.StaticText(self, -1, ' =', size=(50, 25))  
    9191        data1_name = wx.StaticText(self, -1, 'Data1') 
    9292        operator_name = wx.StaticText(self, -1, 'Operator') 
     
    109109                                       style=wx.CB_READONLY) 
    110110 
    111         self.out_pic = SmallPanel(self, -1, True, size=(_BOX_WIDTH, _BOX_WIDTH),  
    112                              style=wx.NO_BORDER) 
    113         self.equal_pic = SmallPanel(self, -1, True, '=',  size=(50, _BOX_WIDTH),  
    114                               style=wx.NO_BORDER) 
     111        self.out_pic = SmallPanel(self, -1, True,  
     112                                    size=(_BOX_WIDTH, _BOX_WIDTH),  
     113                                    style=wx.NO_BORDER) 
     114        self.equal_pic = SmallPanel(self, -1, True, '=',   
     115                                    size=(50, _BOX_WIDTH),  
     116                                    style=wx.NO_BORDER) 
    115117        self.data1_pic = SmallPanel(self, -1, True,  
    116118                                    size=(_BOX_WIDTH, _BOX_WIDTH),  
    117                              style=wx.NO_BORDER) 
    118         self.operator_pic = SmallPanel(self, -1, True,  
    119                                        '+', size=(70, _BOX_WIDTH),  
    120                                        style=wx.NO_BORDER) 
     119                                    style=wx.NO_BORDER) 
     120        self.operator_pic = SmallPanel(self, -1, True, '+', 
     121                                    size=(70, _BOX_WIDTH),  
     122                                    style=wx.NO_BORDER) 
    121123        self.data2_pic = SmallPanel(self, -1, True,  
    122124                                    size=(_BOX_WIDTH, _BOX_WIDTH),  
    123                              style=wx.NO_BORDER) 
     125                                    style=wx.NO_BORDER) 
    124126        for ax in self.equal_pic.axes: 
    125127            ax.set_frame_on(False) 
     
    130132                                       (self.data_namectr, 0, wx.LEFT, 3), 
    131133                                       (self.out_pic, 0, wx.LEFT, 3)]) 
    132         equal_sizer.AddMany([(13, 15), (equal_name, 0, wx.LEFT, 3), 
     134        equal_sizer.AddMany([(13, 13), (equal_name, 0, wx.LEFT, 3), 
    133135                                       (self.equal_pic, 0, wx.LEFT, 3)]) 
    134136        old_data1_sizer.AddMany([(data1_name, 0, wx.LEFT, 3), 
     
    165167        if ON_MAC: 
    166168            ctrl.Enable(enable) 
    167             ctrl.GetChildren()[0].SetBackGroundColor(self.GetBackGroundColor()) 
    168         else: 
     169            chidren = ctrl.GetChildren() 
     170            if len(children) > 0: 
     171                ctrl.GetChildren()[0].SetBackGroundColour(\ 
     172                                                self.GetBackGroundColour()) 
     173        else: 
     174            if not ctrl.IsEnabled(): 
     175                ctrl.Enable(True) 
    169176            ctrl.Show(enable) 
    170177             
     
    180187        else: 
    181188            self._set_textctrl_color(item, self.GetBackgroundColour()) 
    182         text = item.GetLabel().strip() 
     189        text = item.GetValue().strip() 
    183190        self._check_newname(text) 
    184191     
     
    190197        msg = '' 
    191198        if name == None: 
    192             text = self.data_namectr.GetLabel().strip() 
     199            text = self.data_namectr.GetValue().strip() 
    193200        else: 
    194201            text = name 
     
    210217        """ 
    211218        if ON_MAC: 
    212             ctrl.GetChildren()[0].SetBackgroundColour(color)   
     219            chidren = ctrl.GetChildren() 
     220            if len(children) > 0: 
     221                ctrl.GetChildren()[0].SetBackgroundColour(color)   
    213222        else: 
    214223            ctrl.SetBackgroundColour(color)   
     
    228237 
    229238        item = event.GetEventObject() 
    230         text = item.GetLabel().strip() 
     239        text = item.GetValue().strip() 
    231240        try: 
    232241            val = float(text) 
     
    287296        self.send_warnings('') 
    288297        item = event.GetEventObject() 
    289         text = item.GetLabel().strip().lower() 
     298        text = item.GetValue().strip().lower() 
    290299        self._show_numctrl(self.numberctr, text=='number') 
    291300         
     
    316325            self.output.name = str(self.data_namectr.GetValue()) 
    317326        self.draw_output(self.output) 
    318      
     327         
    319328    def put_text_pic(self, pic=None, content=''):   
    320329        """ 
     
    350359            try: 
    351360                float(data2) 
    352                 if self.operator_cbox.GetLabel().strip() == '|': 
     361                if self.operator_cbox.GetValue().strip() == '|': 
    353362                    msg = "DataOperation: This operation can not accept " 
    354363                    msg += "a float number." 
     
    466475        pos_pre1 = self.data1_cbox.GetCurrentSelection() 
    467476        pos_pre2 = self.data2_cbox.GetCurrentSelection() 
    468         current1 = self.data1_cbox.GetLabel() 
    469         current2 = self.data2_cbox.GetLabel() 
     477        current1 = self.data1_cbox.GetValue() 
     478        current2 = self.data2_cbox.GetValue() 
    470479        if pos_pre1 < 0: 
    471480            pos_pre1 = 0 
Note: See TracChangeset for help on using the changeset viewer.