Пример #1
0
    def onBoxSum(self, event):
        """
        """
        from sas.sasgui.guiframe.gui_manager import MDIFrame
        from boxSum import BoxSum
        self.onClearSlicer(event)
        self.slicer_z += 1
        self.slicer = BoxSum(self, self.subplot, zorder=self.slicer_z)
        self.subplot.set_ylim(self.data2D.ymin, self.data2D.ymax)
        self.subplot.set_xlim(self.data2D.xmin, self.data2D.xmax)
        self.update()
        self.slicer.update()
        ## Value used to initially set the slicer panel
        params = self.slicer.get_params()
        ## Create a new panel to display results of summation of Data2D
        from parameters_panel_boxsum import SlicerPanel
        win = MDIFrame(self.parent, None, 'None', (100, 200))
        new_panel = SlicerPanel(parent=win,
                                id=-1,
                                base=self,
                                type=self.slicer.__class__.__name__,
                                params=params,
                                style=wx.RAISED_BORDER)

        new_panel.window_caption = self.slicer.__class__.__name__ + " " + \
                                    str(self.data2D.name)
        new_panel.window_name = self.slicer.__class__.__name__ + " " + \
                                    str(self.data2D.name)
        ## Store a reference of the new created panel

        ## save the window_caption of the new panel in the current slicer
        self.slicer.set_panel_name(name=new_panel.window_caption)
        ## post slicer panel to guiframe to display it
        from sas.sasgui.guiframe.events import SlicerPanelEvent

        win.set_panel(new_panel)
        new_panel.frame = win
        wx.PostEvent(self.parent,
                     SlicerPanelEvent(panel=new_panel, main_panel=self))
        wx.CallAfter(new_panel.frame.Show)
        self.panel_slicer = new_panel