Changeset 13a63ab in sasview


Ignore:
Timestamp:
May 13, 2011 3:26:08 PM (14 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
a03d419
Parents:
f22e626
Message:

working on delete data

Location:
guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • guiframe/data_panel.py

    r248b918 r13a63ab  
    1515import sys 
    1616import warnings 
     17import logging 
    1718from wx.lib.scrolledpanel import ScrolledPanel 
    1819import  wx.lib.agw.customtreectrl as CT 
     
    2122from sans.guiframe.panel_base import PanelBase 
    2223from sans.guiframe.events import StatusEvent 
     24from sans.guiframe.events import EVT_DELETE_PLOTPANEL 
    2325from DataLoader.loader import Loader 
    24 import logging 
    2526 
    2627try: 
     
    129130        self.fill_cbox_analysis(self.list_of_perspective) 
    130131        self.Bind(wx.EVT_SHOW, self.on_close_page) 
     132        if self.parent is not None: 
     133            self.parent.Bind(EVT_DELETE_PLOTPANEL, self._on_delete_plot_panel) 
    131134        
    132135         
     
    765768        self.perspective_cbox.SetStringSelection(name) 
    766769        self.enable_import() 
     770         
     771    def _on_delete_plot_panel(self, event): 
     772        """ 
     773        get an event with attribute name and caption to delete existing name  
     774        from the combobox of the current panel 
     775        """ 
     776        name = event.name 
     777        caption = event.caption 
     778        if self.cb_plotpanel is not None: 
     779            pos = self.cb_plotpanel.FindString(str(caption))  
     780            if pos != wx.NOT_FOUND: 
     781                self.cb_plotpanel.Delete(pos) 
     782        self.enable_append() 
    767783         
    768784    def set_panel_on_focus(self, name=None): 
  • guiframe/events.py

    r450ae05 r13a63ab  
    1616#slicer event 
    1717(SlicerEvent, EVT_SLICER)   = wx.lib.newevent.NewEvent() 
     18## event that that destroy panel name in the datapanel combobox 
     19(DeletePlotPanelEvent, EVT_DELETE_PLOTPANEL)   = wx.lib.newevent.NewEvent() 
    1820##event that allow to add more that to the same plot 
    1921(AddManyDataEvent, EVT_ADD_MANY_DATA)   = wx.lib.newevent.NewEvent() 
  • guiframe/local_perspectives/plotting/plotting.py

    rdf8a13e r13a63ab  
    1616from sans.guiframe.events import EVT_NEW_PLOT 
    1717from sans.guiframe.events import StatusEvent  
     18from sans.guiframe.events import DeletePlotPanelEvent 
    1819from sans.guiframe.plugin_base import PluginBase 
    1920from sans.guiframe.dataFitting import Data1D 
     
    244245        if group_id in self.plot_panels.keys(): 
    245246            panel = self.plot_panels[group_id] 
     247            wx.PostEvent(self.parent,  
     248                         DeletePlotPanelEvent(name=panel.window_caption, 
     249                                    caption=panel.window_caption)) 
    246250            #remove menu item 
    247251            self.delete_menu_item(panel.window_caption, panel.uid) 
Note: See TracChangeset for help on using the changeset viewer.