- Timestamp:
- Jan 31, 2011 11:30:11 AM (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:
- 8994b6b
- Parents:
- 0663dfb1
- Location:
- guiframe
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/data_manager.py
r213892bc r6db811e 88 88 """ 89 89 """ 90 #for id in 90 if data_id in self.stored_data: 91 del self.stored_data[data_id] 92 if data_id in self._selected_data: 93 del self._selected_data 94 91 95 def delete_by_id(self, id_list=None): 92 96 """ -
guiframe/data_panel.py
r213892bc r6db811e 25 25 Check list control to be used for Data Panel 26 26 """ 27 def __init__(self, parent, size=(PANEL_WIDTH, 200),*args, **kwds):27 def __init__(self, parent,*args, **kwds): 28 28 kwds['style']= wx.SUNKEN_BORDER|CT.TR_HAS_BUTTONS| CT.TR_HIDE_ROOT| \ 29 29 CT.TR_HAS_VARIABLE_ROW_HEIGHT|wx.WANTS_CHARS 30 kwds['size'] = size31 30 CT.CustomTreeCtrl.__init__(self, parent, *args, **kwds) 32 31 self.root = self.AddRoot("Available Data") … … 61 60 self.owner = None 62 61 self.do_layout() 63 #self._default_data1d = Data1D() 64 #self._default_data1d.set_default_data() 65 #self._default_data2d = Data2D() 66 #self._default_data2d.set_default_data() 67 #data_list =[] 68 #data_list.append((self._default_data1d, None,None, None)) 69 #data_list.append((self._default_data2d, None,None, None)) 70 #if self.manager is not None: 71 # self.manager.set_loaded_data(data_list) 72 # list = self.manager.get_selected_data() 73 # self.load_data_list(list) 62 74 63 def do_layout(self): 64 """ 65 """ 75 66 self.define_panel_structure() 76 67 self.layout_selection() … … 83 74 Define the skeleton of the panel 84 75 """ 85 print self.parent.GetSize(), self.GetSize()86 76 w, h = self.parent.GetSize() 87 77 self.vbox = wx.BoxSizer(wx.VERTICAL) 88 78 self.sizer1 = wx.BoxSizer(wx.VERTICAL) 79 self.sizer1.SetMinSize((w/12, h/2)) 89 80 self.sizer2 = wx.BoxSizer(wx.VERTICAL) 90 81 self.sizer3 = wx.GridBagSizer(5,5) 91 82 self.sizer4 = wx.BoxSizer(wx.HORIZONTAL) 92 83 self.sizer5 = wx.BoxSizer(wx.HORIZONTAL) 93 self.sizer3.SetMinSize((w-60, -1))84 #self.sizer3.SetMinSize((w-60, -1)) 94 85 95 86 self.vbox.Add(self.sizer5, 0,wx.EXPAND|wx.ALL,10) … … 127 118 box_description_2= wx.StaticBox(self, -1, "Set Active Perspective") 128 119 self.boxsizer_2 = wx.StaticBoxSizer(box_description_2, wx.HORIZONTAL) 129 self.boxsizer_2.SetMinSize((w-60, -1))130 120 self.sizer_perspective = wx.GridBagSizer(5,5) 131 121 self.boxsizer_2.Add(self.sizer_perspective) … … 175 165 option = self.selection_cbox.GetValue() 176 166 if option == 'Select all Data': 177 #for item in self.tree_ctrl.178 print "_on_selection_type"167 print "on select" 168 179 169 def on_set_active_perspective(self, event): 180 170 """ … … 252 242 Add a listcrtl in the panel 253 243 """ 254 w, h = self.GetSize() 255 self.tree_ctrl = DataTreeCtrl(parent=self, size=(w-10, -1)) 244 self.tree_ctrl = DataTreeCtrl(parent=self) 256 245 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_CHECKED, self.on_check_item) 257 246 self.tree_ctrl.Bind(CT.EVT_TREE_ITEM_RIGHT_CLICK, self.on_right_click) 258 self.sizer1.Add(self.tree_ctrl, 0, wx.EXPAND|wx.ALL, 20)247 self.sizer1.Add(self.tree_ctrl,1, wx.EXPAND|wx.ALL, 20) 259 248 260 249 def on_right_click(self, event): -
guiframe/gui_manager.py
r0663dfb1 r6db811e 129 129 self._data_panel = DataPanel(parent=self) 130 130 if self.panel_on_focus is not None: 131 self._data_panel.set_panel_on_focus(self.panel_on_focus.window_ name)131 self._data_panel.set_panel_on_focus(self.panel_on_focus.window_caption) 132 132 # Check for update 133 133 #self._check_update(None) … … 314 314 style = self.__gui_style & (GUIFRAME.MANAGER_ON) 315 315 if self._data_panel is not None and (p == self._data_panel): 316 panel_width_min = self._window_width * 4/25316 panel_width_min = self._window_width * 2/25 317 317 return panel_width_min, panel_height_min 318 318 if hasattr(p, "CENTER_PANE") and p.CENTER_PANE: 319 319 style = self.__gui_style & (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON) 320 320 if style == (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON): 321 panel_width_min = self._window_width * 1 3/25321 panel_width_min = self._window_width * 17/25 322 322 return panel_width_min, panel_height_min 323 323 return panel_width_min, panel_height_min … … 678 678 if plug.can_load_data(): 679 679 plug.load_data(event) 680 self.show_data_panel(event=None) 681 print "_load_data" 682 680 style = self.__gui_style & GUIFRAME.MANAGER_ON 681 if style == GUIFRAME.MANAGER_ON: 682 self.show_data_panel(event=None) 683 683 684 def _load_folder(self, event): 684 685 """ … … 689 690 if plug.can_load_data(): 690 691 plug.load_folder(event) 691 self.show_data_panel(event=None) 692 style = self.__gui_style & GUIFRAME.MANAGER_ON 693 if style == GUIFRAME.MANAGER_ON: 694 self.show_data_panel(event=None) 692 695 693 696 def _on_status_event(self, evt): … … 1089 1092 for new_plot in data_list: 1090 1093 if append: 1091 if self.panel_on_focus is None: 1094 if self.panel_on_focus is None or \ 1095 not self.enable_add_data(new_plot): 1092 1096 message = "cannot append plot. No plot panel on focus!" 1093 1097 message += "please click on any available plot to set focus" … … 1121 1125 theory_id=theory_id, 1122 1126 delete_all=delete_all) 1127 for plug in self.plugins: 1128 plug.delete_data(data_id) 1129 1123 1130 1124 1131 def set_current_perspective(self, perspective): -
guiframe/plugin_base.py
r52b8b74 r6db811e 58 58 return True 59 59 60 def delete_data(self, data_id): 61 """ 62 Delete all references of data which id are in data_list. 63 """ 64 60 65 def load_data(self, event): 61 66 """
Note: See TracChangeset
for help on using the changeset viewer.