Changeset df22224 in sasview for guiframe/local_perspectives
- Timestamp:
- Mar 15, 2011 12:43:43 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:
- 665c083
- Parents:
- 504dd9f5
- Location:
- guiframe/local_perspectives/plotting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
guiframe/local_perspectives/plotting/Plotter1D.py
re6a93df rdf22224 138 138 self.graph.delete(data) 139 139 data_manager = self._manager.parent.get_data_manager() 140 data_list = data_manager.get_by_id(id_list=[id]) 141 data = data_list.values()[0].data 142 data.group_id.remove(self.group_id) 140 data_list, theory_list = data_manager.get_by_id(id_list=[id]) 141 142 if id in data_list.keys(): 143 data = data_list[id] 144 else: 145 data = theory_list[id] 146 143 147 del self.plots[id] 144 145 148 self.graph.render(self) 146 149 self.subplot.figure.canvas.draw_idle() 150 event = RemoveDataEvent(data=data) 151 wx.PostEvent(self.parent, event) 147 152 if len(self.graph.plottables) == 0: 148 print "_onRemove: graph is empty must be destroyed"149 153 #onRemove: graph is empty must be the panel must be destroyed 154 self.parent.delete_panel(self.uid) 150 155 else: 151 156 msg = "Attempt to remove an unexisting plot with ID %s " % str(id) … … 217 222 selected_plot = self.plots[self.graph.selected_plottable] 218 223 id = self.graph.selected_plottable 219 self.remove_data_by_id( id) 220 event = RemoveDataEvent(data=selected_plot) 221 wx.PostEvent(self.parent, event) 222 self.graph.delete(selected_plot) 223 del selected_plot 224 224 self.remove_data_by_id(id) 225 225 226 def onContextMenu(self, event): 226 227 """ … … 276 277 self._slicerpop.Append(id, '&Freeze', 'Freeze') 277 278 wx.EVT_MENU(self, id, self.onFreeze) 279 #else: 280 id = wx.NewId() 281 self._slicerpop.Append(id, '&Linear Fit') 282 wx.EVT_MENU(self, id, self.onFitting) 278 283 id = wx.NewId() 279 284 name = plot.name … … 297 302 # Option to hide 298 303 #TODO: implement functionality to hide a plottable (legend click) 299 id = wx.NewId() 300 self._slicerpop.Append(id, '&Linear Fit') 301 wx.EVT_MENU(self, id, self.onFitting) 304 302 305 303 306 id = wx.NewId() -
guiframe/local_perspectives/plotting/plotting.py
re88ebfd rdf22224 180 180 self.parent.show_panel(panel.uid) 181 181 182 def delete_menu_item(self, name, uid): 183 """ 184 """ 185 #remove menu item 186 pos = self.menu.FindItem(name) 187 if pos != -1: 188 self.menu.Delete(uid) 189 if self.menu.GetMenuItemCount() == 0: 190 self.menu.Append(DEFAULT_MENU_ITEM_ID, DEFAULT_MENU_ITEM_LABEL, 191 "No plot available") 192 self.menu.FindItemByPosition(0).Enable(False) 193 182 194 def delete_panel(self, group_id): 183 195 """ … … 186 198 panel = self.plot_panels[group_id] 187 199 #remove menu item 188 self.menu.Delete(panel.uid) 189 self.parent.delete_panel(panel.uid) 200 self.delete_menu_item(panel.window_caption, panel.uid) 190 201 del self.plot_panels[group_id] 191 202 return True
Note: See TracChangeset
for help on using the changeset viewer.