Index: src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py	(revision b2b3693291d8e49fd33718753161206c1964548c)
+++ src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter2D.py	(revision 39f0bf40d4c6ac22a3a4e2a133263a5da2bfe588)
@@ -128,4 +128,5 @@
         self.title_font = None
         self.title_color = 'black'
+        self.batch_slicer = None
         ## Graph
         self.graph = Graph()
@@ -359,5 +360,6 @@
                 if self.slicer.__class__.__name__ != "BoxSum":
                     wx_id = ids.next()
-                    slicerpop.Append(wx_id, '&Edit Slicer Parameters')
+                    name = '&Edit Slicer Parameters and Batch Slicing'
+                    slicerpop.Append(wx_id, name)
                     wx.EVT_MENU(self, wx_id, self._onEditSlicer)
             slicerpop.AppendSeparator()
@@ -558,5 +560,4 @@
         """
         self.onCircular(event, True)
-
     def onCircular(self, event, ismask=False):
         """
@@ -628,5 +629,5 @@
         """
         if self.slicer != None:
-            from SlicerParameters import SlicerParameterPanel
+            from parameters_panel_slicer import SlicerParameterPanel
             dialog = SlicerParameterPanel(self, -1, "Slicer Parameters")
             dialog.set_slicer(self.slicer.__class__.__name__,
@@ -666,5 +667,5 @@
         params = self.slicer.get_params()
         ## Create a new panel to display results of summation of Data2D
-        from slicerpanel import SlicerPanel
+        from parameters_panel_boxsum import SlicerPanel
         win = MDIFrame(self.parent, None, 'None', (100, 200))
         new_panel = SlicerPanel(parent=win, id=-1,
Index: src/sas/sasgui/guiframe/local_perspectives/plotting/SlicerParameters.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/SlicerParameters.py	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ 	(revision )
@@ -1,146 +1,0 @@
-
-
-import wx
-import wx.lib.newevent
-#from copy import deepcopy
-from sas.sasgui.guiframe.events import EVT_SLICER_PARS
-from sas.sasgui.guiframe.utils import format_number
-from sas.sasgui.guiframe.events import EVT_SLICER
-from sas.sasgui.guiframe.events import SlicerParameterEvent
-
-
-class SlicerParameterPanel(wx.Dialog):
-    """
-    Panel class to show the slicer parameters
-    """
-    #TODO: show units
-    #TODO: order parameters properly
-
-    def __init__(self, parent, *args, **kwargs):
-        """
-        Dialog window that allow to edit parameters slicer
-        by entering new values
-        """
-        wx.Dialog.__init__(self, parent, *args, **kwargs)
-        self.params = {}
-        self.parent = parent
-        self.type = None
-        self.listeners = []
-        self.parameters = []
-        self.bck = wx.GridBagSizer(5, 5)
-        self.SetSizer(self.bck)
-        label = "Right-click on 2D plot for slicer options"
-        title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
-        self.bck.Add(title, (0, 0), (1, 2),
-                     flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-        # Bindings
-        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
-        self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
-
-    def onEVT_SLICER(self, event):
-        """
-        Process EVT_SLICER events
-        When the slicer changes, update the panel
-
-        :param event: EVT_SLICER event
-        """
-        event.Skip()
-        if event.obj_class == None:
-            self.set_slicer(None, None)
-        else:
-            self.set_slicer(event.type, event.params)
-
-    def set_slicer(self, type, params):
-        """
-        Rebuild the panel
-        """
-        self.bck.Clear(True)
-        self.type = type
-        if type == None:
-            label = "Right-click on 2D plot for slicer options"
-            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
-            self.bck.Add(title, (0, 0), (1, 2),
-                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-        else:
-            title = wx.StaticText(self, -1,
-                                  "Slicer Parameters", style=wx.ALIGN_LEFT)
-            self.bck.Add(title, (0, 0), (1, 2),
-                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-            ix = 0
-            iy = 0
-            self.parameters = []
-            keys = params.keys()
-            keys.sort()
-            for item in keys:
-                iy += 1
-                ix = 0
-                if not item in ["count", "errors"]:
-                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT)
-                    self.bck.Add(text, (iy, ix), (1, 1),
-                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
-                    ctl = wx.TextCtrl(self, -1, size=(80, 20),
-                                      style=wx.TE_PROCESS_ENTER)
-                    hint_msg = "Modify the value of %s to change" % item
-                    hint_msg += " the 2D slicer"
-                    ctl.SetToolTipString(hint_msg)
-                    ix = 1
-                    ctl.SetValue(format_number(str(params[item])))
-                    self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter)
-                    self.parameters.append([item, ctl])
-                    self.bck.Add(ctl, (iy, ix), (1, 1),
-                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-                    ix = 3
-                    self.bck.Add((20, 20), (iy, ix), (1, 1),
-                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-                else:
-                    text = wx.StaticText(self, -1, item + " : ",
-                                         style=wx.ALIGN_LEFT)
-                    self.bck.Add(text, (iy, ix), (1, 1),
-                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
-                    ctl = wx.StaticText(self, -1,
-                                        format_number(str(params[item])),
-                                        style=wx.ALIGN_LEFT)
-                    ix = 1
-                    self.bck.Add(ctl, (iy, ix), (1, 1),
-                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
-            iy += 1
-            ix = 1
-            self.bck.Add((20, 20), (iy, ix), (1, 1),
-                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
-        self.bck.Layout()
-        self.bck.Fit(self)
-        self.parent.GetSizer().Layout()
-
-    def onParamChange(self, evt):
-        """
-        receive an event end reset value text fields
-        inside self.parameters
-        """
-        evt.Skip()
-        if evt.type == "UPDATE":
-            for item in self.parameters:
-                if item[0] in evt.params:
-                    item[1].SetValue("%-5.3g" % evt.params[item[0]])
-                    item[1].Refresh()
-
-    def onTextEnter(self, evt):
-        """
-        Parameters have changed
-        """
-        params = {}
-        has_error = False
-        for item in self.parameters:
-            try:
-                params[item[0]] = float(item[1].GetValue())
-                item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
-                item[1].Refresh()
-            except:
-                has_error = True
-                item[1].SetBackgroundColour("pink")
-                item[1].Refresh()
-
-        if has_error == False:
-            # Post parameter event
-            ##parent hier is plotter2D
-            event = SlicerParameterEvent(type=self.type, params=params)
-            wx.PostEvent(self.parent, event)
Index: src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_boxsum.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_boxsum.py	(revision 39f0bf40d4c6ac22a3a4e2a133263a5da2bfe588)
+++ src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_boxsum.py	(revision 39f0bf40d4c6ac22a3a4e2a133263a5da2bfe588)
@@ -0,0 +1,170 @@
+import wx
+import wx.lib.newevent
+#from copy import deepcopy
+from sas.sasgui.guiframe.utils import format_number
+from sas.sasgui.guiframe.events import SlicerParameterEvent
+from sas.sasgui.guiframe.events import EVT_SLICER_PARS
+from sas.sasgui.guiframe.events import EVT_SLICER
+
+from sas.sasgui.guiframe.panel_base import PanelBase
+
+class SlicerPanel(wx.Panel, PanelBase):
+    """
+    Panel class to show the slicer parameters
+    """
+    #TODO: show units
+    #TODO: order parameters properly
+    ## Internal name for the AUI manager
+    window_name = "Slicer panel"
+    ## Title to appear on top of the window
+    window_caption = "Slicer Panel"
+    CENTER_PANE = False
+
+    def __init__(self, parent, id=-1, type=None, base=None,
+                 params=None, *args, **kwargs):
+        wx.Panel.__init__(self, parent, id, *args, **kwargs)
+        PanelBase.__init__(self)
+        ##  Initialization of the class
+        self.base = base
+        if params is None:
+            params = {}
+        self.params = params
+        self.parent = base.parent
+        self.frame = None
+        self.type = type
+        self.listeners = []
+        self.parameters = []
+        self.bck = wx.GridBagSizer(5, 5)
+        self.SetSizer(self.bck)
+        if type == None and params == None:
+            label = "Right-click on 2D plot for slicer options"
+            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
+            self.bck.Add(title, (0, 0), (1, 2),
+                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+        else:
+            self.set_slicer(type, params)
+        ## Bindings
+        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
+        self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
+
+    def onEVT_SLICER(self, event):
+        """
+        Process EVT_SLICER events
+        When the slicer changes, update the panel
+
+        :param event: EVT_SLICER event
+
+        """
+        event.Skip()
+        if event.obj_class == None:
+            self.set_slicer(None, None)
+        else:
+            self.set_slicer(event.type, event.params)
+
+    def set_slicer(self, type, params):
+        """
+        Rebuild the panel
+        """
+        self.bck.Clear(True)
+        self.type = type
+        if type == None:
+            label = "Right-click on 2D plot for slicer options"
+            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
+            self.bck.Add(title, (0, 0), (1, 2),
+                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+        else:
+            title_text = str(type) + "Parameters"
+            title = wx.StaticText(self, -1, title_text,
+                                  style=wx.ALIGN_LEFT)
+            self.bck.Add(title, (0, 0), (1, 2),
+                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+            n = 1
+            self.parameters = []
+            keys = params.keys()
+            keys.sort()
+            for item in keys:
+                if not item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]:
+                    n += 1
+                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT)
+                    self.bck.Add(text, (n - 1, 0),
+                                 flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+                    ctl = wx.TextCtrl(self, -1, size=(80, 20),
+                                      style=wx.TE_PROCESS_ENTER)
+                    hint_msg = "Modify the value of %s to change " % item
+                    hint_msg += "the 2D slicer"
+                    ctl.SetToolTipString(hint_msg)
+                    ctl.SetValue(str(format_number(params[item])))
+                    self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter)
+                    ctl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
+                    ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter)
+                    self.parameters.append([item, ctl])
+                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0)
+            for item in keys:
+                if  item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]:
+                    n += 1
+                    text = wx.StaticText(self, -1, item + ": ", style=wx.ALIGN_LEFT)
+                    self.bck.Add(text, (n - 1, 0), flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL,
+                                 border=15)
+                    ctl = wx.StaticText(self, -1,
+                                        str(format_number(params[item])),
+                                        style=wx.ALIGN_LEFT)
+                    ctl.SetToolTipString("Result %s" % item)
+                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0)
+        self.bck.Layout()
+        self.Layout()
+        psizer = self.parent.GetSizer()
+        if psizer != None:
+            psizer.Layout()
+
+    def onSetFocus(self, evt):
+        """
+        Highlight the txtcrtl
+        """
+        evt.Skip()
+        # Get a handle to the TextCtrl
+        widget = evt.GetEventObject()
+        # Select the whole control, after this event resolves
+        wx.CallAfter(widget.SetSelection, -1, -1)
+        return
+
+    def onParamChange(self, evt):
+        """
+        Receive and event and reset the text field contained in self.parameters
+
+        """
+        evt.Skip()
+        for item in self.parameters:
+            if item[0] in evt.params:
+                item[1].SetValue(format_number(evt.params[item[0]]))
+                item[1].Refresh()
+
+    def onTextEnter(self, evt):
+        """
+        Parameters have changed
+        """
+        evt.Skip()
+        params = {}
+        has_error = False
+        for item in self.parameters:
+            try:
+                params[item[0]] = float(item[1].GetValue())
+                item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+                item[1].Refresh()
+            except:
+                has_error = True
+                item[1].SetBackgroundColour("pink")
+                item[1].Refresh()
+
+        if has_error == False:
+            # Post parameter event
+            ## base is guiframe is this case
+            event = SlicerParameterEvent(type=self.type, params=params)
+            wx.PostEvent(self.base, event)
+
+    def on_close(self, event):
+        """
+        On Close Event
+        """
+        ID = self.uid
+        self.parent.delete_panel(ID)
+        self.frame.Destroy()
Index: src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py	(revision 39f0bf40d4c6ac22a3a4e2a133263a5da2bfe588)
+++ src/sas/sasgui/guiframe/local_perspectives/plotting/parameters_panel_slicer.py	(revision 39f0bf40d4c6ac22a3a4e2a133263a5da2bfe588)
@@ -0,0 +1,203 @@
+
+
+import wx
+import wx.lib.newevent
+#from copy import deepcopy
+from sas.sasgui.guiframe.events import EVT_SLICER_PARS
+from sas.sasgui.guiframe.utils import format_number
+from sas.sasgui.guiframe.events import EVT_SLICER
+from sas.sasgui.guiframe.events import SlicerParameterEvent, SlicerEvent
+
+
+class SlicerParameterPanel(wx.Dialog):
+    """
+    Panel class to show the slicer parameters
+    """
+    #TODO: show units
+    #TODO: order parameters properly
+
+    def __init__(self, parent, *args, **kwargs):
+        """
+        Dialog window that allow to edit parameters slicer
+        by entering new values
+        """
+        wx.Dialog.__init__(self, parent, *args, **kwargs)
+        self.params = {}
+        self.parent = parent
+        self.type = None
+        self.listeners = []
+        self.parameters = []
+        self.bck = wx.GridBagSizer(5, 5)
+        self.SetSizer(self.bck)
+        label = "Right-click on 2D plot for slicer options"
+        title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
+        self.bck.Add(title, (0, 0), (1, 2),
+                     flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+        # Bindings
+        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
+        self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
+
+    def onEVT_SLICER(self, event):
+        """
+        Process EVT_SLICER events
+        When the slicer changes, update the panel
+
+        :param event: EVT_SLICER event
+        """
+        event.Skip()
+        if event.obj_class == None:
+            self.set_slicer(None, None)
+        else:
+            self.set_slicer(event.type, event.params)
+
+    def set_slicer(self, type, params):
+        """
+        Rebuild the panel
+        """
+        self.bck.Clear(True)
+        self.bck.Add((5, 5), (0, 0), (1, 1),
+                     wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5)
+        self.type = type
+        if type == None:
+            label = "Right-click on 2D plot for slicer options"
+            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
+            self.bck.Add(title, (1, 0), (1, 2),
+                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+        else:
+            title = wx.StaticText(self, -1,
+                                  "Slicer Parameters", style=wx.ALIGN_LEFT)
+            self.bck.Add(title, (1, 0), (1, 2),
+                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
+            ix = 0
+            iy = 1
+            self.parameters = []
+            keys = params.keys()
+            keys.sort()
+            for item in keys:
+                iy += 1
+                ix = 0
+                if not item in ["count", "errors"]:
+                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT)
+                    self.bck.Add(text, (iy, ix), (1, 1),
+                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+                    ctl = wx.TextCtrl(self, -1, size=(80, 20),
+                                      style=wx.TE_PROCESS_ENTER)
+                    hint_msg = "Modify the value of %s to change" % item
+                    hint_msg += " the 2D slicer"
+                    ctl.SetToolTipString(hint_msg)
+                    ix = 1
+                    ctl.SetValue(format_number(str(params[item])))
+                    self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter)
+                    self.parameters.append([item, ctl])
+                    self.bck.Add(ctl, (iy, ix), (1, 1),
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+                    ix = 3
+                    self.bck.Add((20, 20), (iy, ix), (1, 1),
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+                else:
+                    text = wx.StaticText(self, -1, item + " : ",
+                                         style=wx.ALIGN_LEFT)
+                    self.bck.Add(text, (iy, ix), (1, 1),
+                                 wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+                    ctl = wx.StaticText(self, -1,
+                                        format_number(str(params[item])),
+                                        style=wx.ALIGN_LEFT)
+                    ix = 1
+                    self.bck.Add(ctl, (iy, ix), (1, 1),
+                                 wx.EXPAND | wx.ADJUST_MINSIZE, 0)
+            ix = 0
+            iy += 1
+
+            # Change slicer within the window
+            txt = "Slicer"
+            text = wx.StaticText(self, -1, txt, style=wx.ALIGN_LEFT)
+            self.bck.Add(text, (iy, ix), (1, 1),
+                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+            type_list = ["SectorInteractor", "AnnulusInteractor",
+                         "BoxInteractorX", "BoxInteractorY"]
+            self.type_select = wx.ComboBox(parent=self, choices=type_list)
+            self.Bind(wx.EVT_COMBOBOX, self.onChangeSlicer)
+            index = self.type_select.FindString(self.type)
+            self.type_select.SetSelection(index)
+            self.bck.Add(self.type_select, (iy, 1), (1, 1),
+                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+
+            # batch slicing parameters
+            iy += 1
+            button_label = "Batch Slicing"
+            self.batch_slicer_button = wx.Button(parent=self, label=button_label)
+            self.Bind(wx.EVT_BUTTON, self.onToggleBatchSlicing)
+            self.bck.Add(self.batch_slicer_button, (iy, ix), (1, 1),
+                             wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+            self.batch_slice_params = wx.GridBagSizer(5, 5)
+            self.bck.Hide(item=self.batch_slice_params, recursive=True)
+            iy += 1
+            self.bck.Add(self.batch_slice_params, (iy, ix), (1, 1),
+                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+            iy += 1
+            ix = 1
+            self.bck.Add((5, 5), (iy, ix), (1, 1),
+                         wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 5)
+        self.bck.Layout()
+        self.bck.Fit(self)
+        self.parent.GetSizer().Layout()
+
+    def onParamChange(self, evt):
+        """
+        receive an event end reset value text fields
+        inside self.parameters
+        """
+        evt.Skip()
+        if evt.type == "UPDATE":
+            for item in self.parameters:
+                if item[0] in evt.params:
+                    item[1].SetValue("%-5.3g" % evt.params[item[0]])
+                    item[1].Refresh()
+
+    def onTextEnter(self, evt):
+        """
+        Parameters have changed
+        """
+        params = {}
+        has_error = False
+        for item in self.parameters:
+            try:
+                params[item[0]] = float(item[1].GetValue())
+                item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
+                item[1].Refresh()
+            except:
+                has_error = True
+                item[1].SetBackgroundColour("pink")
+                item[1].Refresh()
+
+        if has_error == False:
+            # Post parameter event
+            ##parent hier is plotter2D
+            event = SlicerParameterEvent(type=self.type, params=params)
+            wx.PostEvent(self.parent, event)
+
+    def onToggleBatchSlicing(self, evt=None):
+        """
+        Batch slicing parameters button is pushed
+        :param evt: Event triggering hide/show of the batch slicer parameters
+        """
+        if self.bck.IsShown(item=self.batch_slice_params):
+            self.bck.Hide(item=self.batch_slice_params, recursive=True)
+        else:
+            self.bck.Show(item=self.batch_slice_params, recursive=True)
+
+    def onChangeSlicer(self, evt):
+        """
+        Change the slicer type when changed in the dropdown
+        :param evt: Event triggering this change
+        """
+        type = self.type_select.GetStringSelection()
+        if self.type != type:
+            if type == "SectorInteractor":
+                self.parent.onSectorQ(None)
+            elif type == "AnnulusInteractor":
+                self.parent.onSectorPhi(None)
+            elif type == "BoxInteractorX":
+                self.parent.onBoxavgX(None)
+            elif type == "BoxInteractorY":
+                self.parent.onBoxavgY(None)
Index: src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/plotting/slicerpanel.py	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ 	(revision )
@@ -1,170 +1,0 @@
-import wx
-import wx.lib.newevent
-#from copy import deepcopy
-from sas.sasgui.guiframe.utils import format_number
-from sas.sasgui.guiframe.events import SlicerParameterEvent
-from sas.sasgui.guiframe.events import EVT_SLICER_PARS
-from sas.sasgui.guiframe.events import EVT_SLICER
-
-from sas.sasgui.guiframe.panel_base import PanelBase
-
-class SlicerPanel(wx.Panel, PanelBase):
-    """
-    Panel class to show the slicer parameters
-    """
-    #TODO: show units
-    #TODO: order parameters properly
-    ## Internal name for the AUI manager
-    window_name = "Slicer panel"
-    ## Title to appear on top of the window
-    window_caption = "Slicer Panel"
-    CENTER_PANE = False
-
-    def __init__(self, parent, id=-1, type=None, base=None,
-                 params=None, *args, **kwargs):
-        wx.Panel.__init__(self, parent, id, *args, **kwargs)
-        PanelBase.__init__(self)
-        ##  Initialization of the class
-        self.base = base
-        if params is None:
-            params = {}
-        self.params = params
-        self.parent = base.parent
-        self.frame = None
-        self.type = type
-        self.listeners = []
-        self.parameters = []
-        self.bck = wx.GridBagSizer(5, 5)
-        self.SetSizer(self.bck)
-        if type == None and params == None:
-            label = "Right-click on 2D plot for slicer options"
-            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
-            self.bck.Add(title, (0, 0), (1, 2),
-                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-        else:
-            self.set_slicer(type, params)
-        ## Bindings
-        self.parent.Bind(EVT_SLICER, self.onEVT_SLICER)
-        self.parent.Bind(EVT_SLICER_PARS, self.onParamChange)
-
-    def onEVT_SLICER(self, event):
-        """
-        Process EVT_SLICER events
-        When the slicer changes, update the panel
-
-        :param event: EVT_SLICER event
-
-        """
-        event.Skip()
-        if event.obj_class == None:
-            self.set_slicer(None, None)
-        else:
-            self.set_slicer(event.type, event.params)
-
-    def set_slicer(self, type, params):
-        """
-        Rebuild the panel
-        """
-        self.bck.Clear(True)
-        self.type = type
-        if type == None:
-            label = "Right-click on 2D plot for slicer options"
-            title = wx.StaticText(self, -1, label, style=wx.ALIGN_LEFT)
-            self.bck.Add(title, (0, 0), (1, 2),
-                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-        else:
-            title_text = str(type) + "Parameters"
-            title = wx.StaticText(self, -1, title_text,
-                                  style=wx.ALIGN_LEFT)
-            self.bck.Add(title, (0, 0), (1, 2),
-                         flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-            n = 1
-            self.parameters = []
-            keys = params.keys()
-            keys.sort()
-            for item in keys:
-                if not item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]:
-                    n += 1
-                    text = wx.StaticText(self, -1, item, style=wx.ALIGN_LEFT)
-                    self.bck.Add(text, (n - 1, 0),
-                                 flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL, border=15)
-                    ctl = wx.TextCtrl(self, -1, size=(80, 20),
-                                      style=wx.TE_PROCESS_ENTER)
-                    hint_msg = "Modify the value of %s to change " % item
-                    hint_msg += "the 2D slicer"
-                    ctl.SetToolTipString(hint_msg)
-                    ctl.SetValue(str(format_number(params[item])))
-                    self.Bind(wx.EVT_TEXT_ENTER, self.onTextEnter)
-                    ctl.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
-                    ctl.Bind(wx.EVT_KILL_FOCUS, self.onTextEnter)
-                    self.parameters.append([item, ctl])
-                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0)
-            for item in keys:
-                if  item.lower() in ["num_points", "avg", "avg_error", "sum", "sum_error"]:
-                    n += 1
-                    text = wx.StaticText(self, -1, item + ": ", style=wx.ALIGN_LEFT)
-                    self.bck.Add(text, (n - 1, 0), flag=wx.LEFT | wx.ALIGN_CENTER_VERTICAL,
-                                 border=15)
-                    ctl = wx.StaticText(self, -1,
-                                        str(format_number(params[item])),
-                                        style=wx.ALIGN_LEFT)
-                    ctl.SetToolTipString("Result %s" % item)
-                    self.bck.Add(ctl, (n - 1, 1), flag=wx.TOP | wx.BOTTOM, border=0)
-        self.bck.Layout()
-        self.Layout()
-        psizer = self.parent.GetSizer()
-        if psizer != None:
-            psizer.Layout()
-
-    def onSetFocus(self, evt):
-        """
-        Highlight the txtcrtl
-        """
-        evt.Skip()
-        # Get a handle to the TextCtrl
-        widget = evt.GetEventObject()
-        # Select the whole control, after this event resolves
-        wx.CallAfter(widget.SetSelection, -1, -1)
-        return
-
-    def onParamChange(self, evt):
-        """
-        Receive and event and reset the text field contained in self.parameters
-
-        """
-        evt.Skip()
-        for item in self.parameters:
-            if item[0] in evt.params:
-                item[1].SetValue(format_number(evt.params[item[0]]))
-                item[1].Refresh()
-
-    def onTextEnter(self, evt):
-        """
-        Parameters have changed
-        """
-        evt.Skip()
-        params = {}
-        has_error = False
-        for item in self.parameters:
-            try:
-                params[item[0]] = float(item[1].GetValue())
-                item[1].SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOW))
-                item[1].Refresh()
-            except:
-                has_error = True
-                item[1].SetBackgroundColour("pink")
-                item[1].Refresh()
-
-        if has_error == False:
-            # Post parameter event
-            ## base is guiframe is this case
-            event = SlicerParameterEvent(type=self.type, params=params)
-            wx.PostEvent(self.base, event)
-
-    def on_close(self, event):
-        """
-        On Close Event
-        """
-        ID = self.uid
-        self.parent.delete_panel(ID)
-        self.frame.Destroy()
