Changeset 6605880 in sasview
- Timestamp:
- Apr 18, 2012 10:26:45 AM (13 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:
- d47c349
- Parents:
- bc2db41
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansguiframe/src/sans/guiframe/data_panel.py
rdc0cfa4 r6605880 69 69 Check list control to be used for Data Panel 70 70 """ 71 def __init__(self, parent, *args, **kwds):71 def __init__(self, parent, *args, **kwds): 72 72 #agwstyle is introduced in wx.2.8.11 but is not working for mac 73 73 if IS_MAC and wx_version < 812: … … 79 79 CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds) 80 80 else: 81 #agwstyle is introduced in wx.2.8.11 .argument working only for windows 81 # agwstyle is introduced in wx.2.8.11 82 # argument working only for windows 82 83 try: 83 84 kwds['agwStyle'] = STYLE_FLAG … … 127 128 size=(PANEL_WIDTH, PANEL_HEIGHT), 128 129 list_of_perspective=None, manager=None, *args, **kwds): 129 kwds['size'] = size130 kwds['size'] = size 130 131 kwds['style'] = STYLE_FLAG 131 132 ScrolledPanel.__init__(self, parent=parent, *args, **kwds) … … 146 147 list_of_perspective = [] 147 148 self.list_of_perspective = list_of_perspective 148 self.list_rb_perspectives = []149 self.list_rb_perspectives = [] 149 150 self.list_cb_data = {} 150 151 self.list_cb_theory = {} … … 165 166 def do_layout(self): 166 167 """ 168 Create the panel layout 167 169 """ 168 170 self.define_panel_structure() … … 171 173 self.layout_batch() 172 174 self.layout_button() 173 174 175 175 176 def define_panel_structure(self): … … 187 188 self.sizer5 = wx.BoxSizer(wx.VERTICAL) 188 189 189 self.vbox.Add(self.sizer5, 0, wx.EXPAND|wx.ALL, 1)190 self.vbox.Add(self.sizer1, 1, wx.EXPAND|wx.ALL, 0)191 self.vbox.Add(self.sizer2, 0, wx.EXPAND|wx.ALL, 1)192 self.vbox.Add(self.sizer3, 0, wx.EXPAND|wx.ALL, 10)190 self.vbox.Add(self.sizer5, 0, wx.EXPAND|wx.ALL, 1) 191 self.vbox.Add(self.sizer1, 1, wx.EXPAND|wx.ALL, 0) 192 self.vbox.Add(self.sizer2, 0, wx.EXPAND|wx.ALL, 1) 193 self.vbox.Add(self.sizer3, 0, wx.EXPAND|wx.ALL, 10) 193 194 #self.vbox.Add(self.sizer4, 0, wx.EXPAND|wx.ALL,5) 194 195 … … 197 198 def layout_selection(self): 198 199 """ 200 Create selection option combo box 199 201 """ 200 202 select_txt = wx.StaticText(self, -1, 'Selection Options') … … 218 220 def _on_selection_type(self, event): 219 221 """ 220 Select data according to patterns 221 """ 222 223 list_of_options = ['Select all Data', 224 'Unselect all Data', 225 'Select all Data 1D', 226 'Unselect all Data 1D', 227 'Select all Data 2D', 228 'Unselect all Data 2D' ] 222 Select data according to patterns 223 :param event: UI event 224 """ 229 225 option = self.selection_cbox.GetValue() 230 226 … … 234 230 option = self.selection_cbox.GetString(pos) 235 231 for item in self.list_cb_data.values(): 236 data_ctrl, _, _, _, _, _,_,_= item232 data_ctrl, _, _, _, _, _, _, _= item 237 233 data_id, data_class, _ = self.tree_ctrl.GetItemPyData(data_ctrl) 238 234 if option == 'Select all Data': … … 283 279 if not IS_MAC: 284 280 self.perspective_cbox.SetMinSize((BUTTON_WIDTH*1.6, -1)) 285 wx.EVT_COMBOBOX(self.perspective_cbox, -1,281 wx.EVT_COMBOBOX(self.perspective_cbox, -1, 286 282 self._on_perspective_selection) 287 283 … … 303 299 self.bt_freeze.SetToolTipString(freeze_tip) 304 300 wx.EVT_BUTTON(self, self.bt_freeze.GetId(), self.on_freeze) 305 #hide plot306 #self.bt_close_plot = wx.Button(self, wx.NewId(), "Delete Plot",307 # size=(BUTTON_WIDTH, -1))308 #self.bt_close_plot.SetToolTipString("Delete the plot panel on focus")309 #wx.EVT_BUTTON(self, self.bt_close_plot.GetId(), self.on_close_plot)310 301 311 302 if sys.platform == 'darwin' and build_options.WXPORT == 'osx_cocoa': … … 315 306 self.cb_plotpanel = wx.ComboBox(self, -1, 316 307 style=wx.CB_READONLY|wx.CB_SORT) 317 #self.cb_plotpanel.SetMinSize((BUTTON_WIDTH*2, -1))318 308 wx.EVT_COMBOBOX(self.cb_plotpanel,-1, self._on_plot_selection) 319 309 self.cb_plotpanel.Disable() … … 349 339 def layout_batch(self): 350 340 """ 341 Set up batch mode options 351 342 """ 352 343 self.rb_single_mode = wx.RadioButton(self, -1, 'Single Mode', … … 360 351 self.rb_single_mode.SetValue(not self.parent.batch_on) 361 352 self.rb_batch_mode.SetValue(self.parent.batch_on) 362 self.sizer4.AddMany([(self.rb_single_mode, 0, wx.ALL, 4),363 (self.rb_batch_mode, 0, wx.ALL, 4)])353 self.sizer4.AddMany([(self.rb_single_mode, 0, wx.ALL, 4), 354 (self.rb_batch_mode, 0, wx.ALL, 4)]) 364 355 365 356 def on_single_mode(self, event): 366 357 """ 367 change guiframe to its single mode 358 Change to single mode 359 :param event: UI event 368 360 """ 369 361 if self.parent is not None: … … 373 365 def on_batch_mode(self, event): 374 366 """ 375 change guiframe to its batch mode 367 Change to batch mode 368 :param event: UI event 376 369 """ 377 370 if self.parent is not None: 378 379 371 wx.PostEvent(self.parent, 372 NewBatchEvent(enable=True)) 380 373 381 374 def _get_data_selection(self, event): 382 375 """ 383 Get data selection from the right click 376 Get data selection from the right click 377 :param event: UI event 384 378 """ 385 379 data = None … … 404 398 panel = MaskDialog(parent=self.parent, base=self, 405 399 data=data, id=wx.NewId()) 406 #self.panel.Bind(wx.EVT_CLOSE, self._draw_masked_model)407 400 panel.ShowModal() 408 401
Note: See TracChangeset
for help on using the changeset viewer.