Changeset 18ec684 in sasview
- Timestamp:
- Feb 14, 2011 5:10:37 PM (14 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:
- 9590db6
- Parents:
- 4e4d3bb
- Location:
- guiframe
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_panel.py
rd828481 r18ec684 83 83 self.sizer3 = wx.GridBagSizer(5,5) 84 84 self.sizer4 = wx.BoxSizer(wx.HORIZONTAL) 85 self.sizer5 = wx.BoxSizer(wx.HORIZONTAL) 86 #self.sizer3.SetMinSize((w-60, -1)) 87 85 self.sizer5 = wx.BoxSizer(wx.VERTICAL) 86 88 87 self.vbox.Add(self.sizer5, 0,wx.EXPAND|wx.ALL,10) 89 88 self.vbox.Add(self.sizer1, 0,wx.EXPAND|wx.ALL,0) … … 107 106 for option in list_of_options: 108 107 self.selection_cbox.Append(str(option)) 109 self.selection_cbox.SetValue(' None')108 self.selection_cbox.SetValue('Select all Data') 110 109 wx.EVT_COMBOBOX(self.selection_cbox,-1, self._on_selection_type) 111 110 self.sizer5.AddMany([(select_txt,0, wx.ALL,5), … … 165 164 Select data according to patterns 166 165 """ 166 167 list_of_options = ['Select all Data', 168 'Unselect all Data', 169 'Select all Data 1D', 170 'Unselect all Data 1D', 171 'Select all Data 2D', 172 'Unselect all Data 2D' ] 167 173 option = self.selection_cbox.GetValue() 168 if option == 'Select all Data': 169 print "on select" 170 174 175 pos = self.selection_cbox.GetSelection() 176 if pos == wx.NOT_FOUND: 177 return 178 option = self.selection_cbox.GetString(pos) 179 for item in self.list_cb_data: 180 data_id, data_class = self.tree_ctrl.GetItemPyData(item) 181 if option == 'Select all Data': 182 self.tree_ctrl.CheckItem(item, True) 183 elif option == 'Unselect all Data': 184 self.tree_ctrl.CheckItem(item, False) 185 elif option == 'Select all Data 1D': 186 if data_class == 'Data1D': 187 self.tree_ctrl.CheckItem(item, True) 188 elif option == 'Unselect all Data 1D': 189 if data_class in ['Data1D', 'Theory1D']: 190 self.tree_ctrl.CheckItem(item, False) 191 elif option == 'Select all Data 1D': 192 if data_class == ['Data1D', 'Theory1D']: 193 self.tree_ctrl.CheckItem(item, True) 194 elif option == 'Select all Data 2D': 195 if data_class == 'Data2D': 196 self.tree_ctrl.CheckItem(item, True) 197 elif option == 'Unselect all Data 2D': 198 if data_class == 'Data2D': 199 self.tree_ctrl.CheckItem(item, False) 200 171 201 def on_set_active_perspective(self, event): 172 202 """ … … 199 229 self.tctrl_plotpanel = wx.StaticText(self, -1, 'No Plot panel on focus') 200 230 self.tctrl_plotpanel.SetToolTipString("Active Plot Panel") 201 #self.sizer3.AddMany([(self.bt_import,0, wx.ALL,5), 202 # (self.bt_append_plot,0, wx.ALL,5), 203 # (self.bt_plot, 0, wx.ALL,5), 204 # (self.bt_remove,0, wx.ALL,5)]) 231 205 232 ix = 0 206 233 iy = 0 … … 226 253 wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 227 254 255 228 256 229 257 def layout_batch(self): … … 309 337 for process in data.process: 310 338 theory_child = self.tree_ctrl.FindItem(data_child, 311 "Available Theories") #,339 "Available Theories"), 312 340 if theory is not None: 313 341 av_theory_child =self.tree_ctrl.AppendItem(theory_child, … … 323 351 if data_child is None: 324 352 data_child =self.tree_ctrl.InsertItem(self.tree_ctrl.root,0, 325 data_name,ct_type=1, data= data.id)353 data_name,ct_type=1, data=(data.id, data_class)) 326 354 cb_data = self.tree_ctrl.GetFirstChild(self.tree_ctrl.root) 327 355 item, id = cb_data … … 356 384 for item in self.list_cb_data: 357 385 if item.IsChecked(): 358 359 data_to_plot.append(self.tree_ctrl.GetItemPyData( item))386 data_id, data_class = self.tree_ctrl.GetItemPyData(item) 387 data_to_plot.append(self.tree_ctrl.GetItemPyData(data_id)) 360 388 theory_to_plot = [] 361 389 for item in self.list_cb_theory: 362 390 if item.IsChecked(): 363 theory_to_plot.append(self.tree_ctrl.GetItemPyData(item)) 391 data_id, data_class = self.tree_ctrl.GetItemPyData(item) 392 theory_to_plot.append(self.tree_ctrl.GetItemPyData(data_id)) 364 393 return data_to_plot, theory_to_plot 365 394 366 395 def on_remove(self, event): 396 """ 397 remove data from application 398 """ 367 399 data_to_remove, theory_to_remove = self.set_data_helper() 368 400 for item in self.list_cb_data: … … 377 409 if data_to_remove: 378 410 delete_all = True 379 self.parent. delete_data(data_id=data_to_remove,411 self.parent.remove_data(data_id=data_to_remove, 380 412 theory_id=theory_to_remove, 381 413 delete_all=delete_all) -
guiframe/gui_manager.py
r4e4d3bb r18ec684 341 341 style = self.__gui_style & (GUIFRAME.MANAGER_ON) 342 342 if self._data_panel is not None and (p == self._data_panel): 343 panel_width_min = self._window_width * 2/25343 panel_width_min = self._window_width * 5/25 344 344 return panel_width_min, panel_height_min 345 345 if hasattr(p, "CENTER_PANE") and p.CENTER_PANE: 346 346 style = self.__gui_style & (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON) 347 347 if style == (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON): 348 panel_width_min = self._window_width * 1 7/25348 panel_width_min = self._window_width * 15/25 349 349 return panel_width_min, panel_height_min 350 350 return panel_width_min, panel_height_min … … 386 386 Left(). 387 387 MinimizeButton(). 388 MinSize(wx.Size(w, h)). 388 TopDockable(False). 389 BottomDockable(False). 390 LeftDockable(True). 391 RightDockable(False). 392 BestSize(wx.Size(w, h)). 389 393 Hide()) 390 394 style = self.__gui_style & GUIFRAME.MANAGER_ON … … 1311 1315 self._data_panel.load_data_list(data_state) 1312 1316 1313 def delete_data(self, data_id, theory_id=None, delete_all=True):1317 def remove_data(self, data_id, theory_id=None, delete_all=True): 1314 1318 """ 1315 1319 Delete data state if data_id is provide -
guiframe/gui_toolbar.py
r4e4d3bb r18ec684 76 76 disable_reset_bmp = wx.NullBitmap 77 77 self.AddLabelTool(GUIFRAME_ID.RESET_ID, 'Reset', reset_bmp, 78 disable_reset_bmp, button_type,'Reset In')78 disable_reset_bmp, button_type,'Reset') 79 79 self.AddSeparator() 80 80 drag_im = GUIFRAME_ICON.DRAG_ICON
Note: See TracChangeset
for help on using the changeset viewer.