Changeset 5a5bb29 in sasview for calculatorview/src/sans
- Timestamp:
- Jun 25, 2012 2:37:13 PM (12 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
calculatorview/src/sans/perspectives/calculator/data_operator.py
r33c671e r5a5bb29 88 88 data2_hori_sizer = wx.BoxSizer(wx.HORIZONTAL) 89 89 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)) 91 91 data1_name = wx.StaticText(self, -1, 'Data1') 92 92 operator_name = wx.StaticText(self, -1, 'Operator') … … 109 109 style=wx.CB_READONLY) 110 110 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) 115 117 self.data1_pic = SmallPanel(self, -1, True, 116 118 size=(_BOX_WIDTH, _BOX_WIDTH), 117 style=wx.NO_BORDER)118 self.operator_pic = SmallPanel(self, -1, True, 119 '+',size=(70, _BOX_WIDTH),120 119 style=wx.NO_BORDER) 120 self.operator_pic = SmallPanel(self, -1, True, '+', 121 size=(70, _BOX_WIDTH), 122 style=wx.NO_BORDER) 121 123 self.data2_pic = SmallPanel(self, -1, True, 122 124 size=(_BOX_WIDTH, _BOX_WIDTH), 123 style=wx.NO_BORDER)125 style=wx.NO_BORDER) 124 126 for ax in self.equal_pic.axes: 125 127 ax.set_frame_on(False) … … 130 132 (self.data_namectr, 0, wx.LEFT, 3), 131 133 (self.out_pic, 0, wx.LEFT, 3)]) 132 equal_sizer.AddMany([(13, 1 5), (equal_name, 0, wx.LEFT, 3),134 equal_sizer.AddMany([(13, 13), (equal_name, 0, wx.LEFT, 3), 133 135 (self.equal_pic, 0, wx.LEFT, 3)]) 134 136 old_data1_sizer.AddMany([(data1_name, 0, wx.LEFT, 3), … … 165 167 if ON_MAC: 166 168 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) 169 176 ctrl.Show(enable) 170 177 … … 180 187 else: 181 188 self._set_textctrl_color(item, self.GetBackgroundColour()) 182 text = item.Get Label().strip()189 text = item.GetValue().strip() 183 190 self._check_newname(text) 184 191 … … 190 197 msg = '' 191 198 if name == None: 192 text = self.data_namectr.Get Label().strip()199 text = self.data_namectr.GetValue().strip() 193 200 else: 194 201 text = name … … 210 217 """ 211 218 if ON_MAC: 212 ctrl.GetChildren()[0].SetBackgroundColour(color) 219 chidren = ctrl.GetChildren() 220 if len(children) > 0: 221 ctrl.GetChildren()[0].SetBackgroundColour(color) 213 222 else: 214 223 ctrl.SetBackgroundColour(color) … … 228 237 229 238 item = event.GetEventObject() 230 text = item.Get Label().strip()239 text = item.GetValue().strip() 231 240 try: 232 241 val = float(text) … … 287 296 self.send_warnings('') 288 297 item = event.GetEventObject() 289 text = item.Get Label().strip().lower()298 text = item.GetValue().strip().lower() 290 299 self._show_numctrl(self.numberctr, text=='number') 291 300 … … 316 325 self.output.name = str(self.data_namectr.GetValue()) 317 326 self.draw_output(self.output) 318 327 319 328 def put_text_pic(self, pic=None, content=''): 320 329 """ … … 350 359 try: 351 360 float(data2) 352 if self.operator_cbox.Get Label().strip() == '|':361 if self.operator_cbox.GetValue().strip() == '|': 353 362 msg = "DataOperation: This operation can not accept " 354 363 msg += "a float number." … … 466 475 pos_pre1 = self.data1_cbox.GetCurrentSelection() 467 476 pos_pre2 = self.data2_cbox.GetCurrentSelection() 468 current1 = self.data1_cbox.Get Label()469 current2 = self.data2_cbox.Get Label()477 current1 = self.data1_cbox.GetValue() 478 current2 = self.data2_cbox.GetValue() 470 479 if pos_pre1 < 0: 471 480 pos_pre1 = 0
Note: See TracChangeset
for help on using the changeset viewer.