Index: sansguiframe/src/sans/guiframe/data_panel.py
===================================================================
--- sansguiframe/src/sans/guiframe/data_panel.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
+++ sansguiframe/src/sans/guiframe/data_panel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -142,6 +142,7 @@
         self._default_save_location = None  
         self.all_data1d = True
-        self.parent = parent
-        self.manager = manager
+        self.parent = parent.parent
+        self._manager = manager
+        self.frame = None
         if list is None:
             list = []
@@ -1008,5 +1009,11 @@
         self.enable_append()
         self.enable_remove_plot()
-       
+    
+    def set_plot_unfocus(self):
+        """
+        Unfocus plot
+        """
+        return
+    
     def _on_perspective_selection(self, event=None):
         """
@@ -1047,4 +1054,20 @@
                                           action="delete"))
         self.enable_remove_plot()
+    
+    def set_frame(self, frame):
+        """
+        """
+        self.frame = frame
+    
+    def get_frame(self):
+        """
+        """
+        return self.frame 
+
+    def set_schedule_full_draw(self, panel=None, func='del'):
+        """
+        Send full draw to guimanager
+        """
+        self.parent.set_schedule_full_draw(panel, func)
         
     def enable_remove_plot(self):
@@ -1261,5 +1284,5 @@
                 temp.append(data)
         return temp
-            
+               
 class DataFrame(wx.Frame):
     """
@@ -1282,7 +1305,7 @@
         self.parent = parent
         self.owner = owner
-        self.manager = manager
+        self._manager = manager
         self.panel = DataPanel(parent=self, 
-                               #size=size,
+                               manager=manager,
                                list_of_perspective=list_of_perspective)
      
Index: sansguiframe/src/sans/guiframe/gui_manager.py
===================================================================
--- sansguiframe/src/sans/guiframe/gui_manager.py	(revision 592cd6788ed9932bdcdfc244cd25c0c6c2a3cb7c)
+++ sansguiframe/src/sans/guiframe/gui_manager.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -7,5 +7,5 @@
 #project funded by the US National Science Foundation. 
 #
-#See the license text in license.txt
+#See the license text in license.txtz
 #
 #copyright 2008, University of Tennessee
@@ -192,5 +192,5 @@
 IS_WIN = True
 CLOSE_SHOW = True
-TIME_FACTOR = 1
+TIME_FACTOR = 2
 NOT_SO_GRAPH_LIST = ["BoxSum"]
 if sys.platform.count("win32")==0:
@@ -201,5 +201,5 @@
             CLOSE_SHOW = False
     
-class ViewerFrame(wx.Frame):
+class ViewerFrame(wx.MDIParentFrame):
     """
     Main application frame
@@ -215,9 +215,7 @@
         """
 
-        wx.Frame.__init__(self, parent=parent, title=title, pos=pos, size=size)
+        wx.MDIParentFrame.__init__(self, parent=parent, title=title, pos=pos, size=size)
         # title
         self.title = title
-        # Preferred window size
-        self._window_width, self._window_height = size
         self.__gui_style = gui_style       
         path = os.path.dirname(__file__)
@@ -292,4 +290,5 @@
         #control_panel on focus
         self.cpanel_on_focus = None
+
         self.loader = Loader()   
         #data manager
@@ -297,5 +296,5 @@
         from sans.guiframe.data_manager import DataManager
         self._data_manager = DataManager()
-        self._data_panel = DataPanel(parent=self)
+        self._data_panel = None#DataPanel(parent=self)
         if self.panel_on_focus is not None:
             self._data_panel.set_panel_on_focus(
@@ -312,4 +311,5 @@
         self.on_batch_selection(event=None)
         self.add_icon()
+        
         # Register the close event so it calls our own method
         wx.EVT_CLOSE(self, self.WindowClose)
@@ -324,4 +324,6 @@
         self.Bind(EVT_CATEGORY, self.on_change_categories)
         self.setup_custom_conf()
+        # Preferred window size
+        self._window_width, self._window_height = size
         
     def add_icon(self):
@@ -345,5 +347,18 @@
                 except:
                     pass  
-        
+                
+    def get_client_size(self):
+        """
+        return client size tuple
+        """
+        width, height = self.GetClientSizeTuple()
+        height -= 45
+        # Adjust toolbar height
+        toolbar = self.GetToolBar()
+        if toolbar != None:
+            _, tb_h = toolbar.GetSizeTuple()
+            height -= tb_h 
+        return width, height
+    
     def on_change_categories(self, evt):
         # ILL
@@ -597,6 +612,11 @@
                     
                     plugin.on_perspective(event=None)
+                    frame = plugin.get_frame()
+                    frame.Show(True)
                     #self._check_applications_menu()
-                    break
+                    #break
+                else:
+                    frame = plugin.get_frame()
+                    frame.Show(False) 
             except:
                 pass  
@@ -651,5 +671,6 @@
             #Disable save application if the current panel is in batch mode
             flag = self.panel_on_focus.get_save_flag()
-            self._save_appl_menu.Enable(flag)
+            if self._save_appl_menu != None:
+                self._save_appl_menu.Enable(flag)
 
             if self.panel_on_focus not in self.plot_panels.values():
@@ -665,28 +686,10 @@
                 #update edit menu
                 self.enable_edit_menu()
-    
+
     def disable_app_menu(self, p_panel=None):  
         """
         Disables all menus in the menubar
         """
-        if p_panel == None:
-            return
-        p_name = p_panel.window_name
-        enable = not self._mgr.GetPane(p_name).IsMaximized()
-        if self._data_panel is not None:
-            self._data_panel.disable_app_combo(enable)
-        if self._menubar is not None:
-            for menu, _ in self._menubar.GetMenus():
-                for items in menu.GetMenuItems():
-                    items.Enable(enable)
-        c_panel = self.cpanel_on_focus
-        # disable depending on the save_app flag
-        self._save_appl_menu.Enable(c_panel.get_save_flag())
-        if not enable:
-            if self._toolbar is not None:
-                self._toolbar.update_toolbar(None)
-            p_panel.on_set_focus(None)
-        else:
-            self._toolbar.update_toolbar(c_panel)
+        return
         
     def set_panel_on_focus_helper(self):
@@ -695,5 +698,6 @@
         """
         ID = self.panel_on_focus.uid
-        self._data_panel.set_panel_on_focus(ID)
+        if self._data_panel != None:
+            self._data_panel.set_panel_on_focus(ID)
         #update combo
         if self.panel_on_focus in self.plot_panels.values():
@@ -707,5 +711,5 @@
                 cpanel.on_tap_focus()
                 self.cpanel_on_focus = self.panel_on_focus
-                
+      
     def reset_bookmark_menu(self, panel):
         """
@@ -758,5 +762,5 @@
         self._setup_extra_custom()
         self._check_update(None)
-    
+
     def _setup_extra_custom(self):  
         """
@@ -781,11 +785,11 @@
         self.SetStatusBar(self.sb)
         # Add panel
-        default_flag = wx.aui.AUI_MGR_DEFAULT#| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE
-        self._mgr = wx.aui.AuiManager(self, flags=default_flag)
-        self._mgr.SetDockSizeConstraint(0.5, 0.5)
+        #default_flag = wx.aui.AUI_MGR_DEFAULT#| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE
+        #self._mgr = wx.aui.AuiManager(self, flags=default_flag)
+        #self._mgr.SetDockSizeConstraint(0.5, 0.5)
         # Load panels
         self._load_panels()
         self.set_default_perspective()
-        self._mgr.Update()
+        #self._mgr.Update()
         
     def SetStatusText(self, *args, **kwds):
@@ -906,5 +910,4 @@
                     except:
                         msg = "ViewerFrame._find_plugins: %s" % sys.exc_value
-                        #print msg
                         logging.error(msg)
                     finally:
@@ -925,5 +928,10 @@
         
         """
-        self.defaultPanel = panel_class(self, -1, style=wx.RAISED_BORDER)
+        win = MDIFrame(self, None, 'None', (100, 200))
+        self.defaultPanel = panel_class(win, -1, style=wx.RAISED_BORDER)
+        win.set_panel(self.defaultPanel)
+        self.defaultPanel.set_frame(win)
+        #win.EnableCloseButton(False)
+        win.Show(False)
         
     def _get_panels_size(self, p):
@@ -932,18 +940,22 @@
         get the proper panel width and height
         """
-        ## Check and set the size
+        self._window_width, self._window_height = self.get_client_size()
+        ## Default size
         if DATAPANEL_WIDTH < 0:
-            panel_width = int(self._window_width * 0.22)
+            panel_width = int(self._window_width * 0.25)
         else:
             panel_width = DATAPANEL_WIDTH
-        panel_height = int(self._window_height * 0.9)
+        panel_height = int(self._window_height)
         style = self.__gui_style & (GUIFRAME.MANAGER_ON)
         if self._data_panel is not None  and (p == self._data_panel):
             return panel_width, panel_height
         if hasattr(p, "CENTER_PANE") and p.CENTER_PANE:
-            style = self.__gui_style & (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON)
-            if style == (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON):
-                panel_width = self._window_width - panel_width
+            #style = self.__gui_style & (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON)
+            #if style == (GUIFRAME.PLOTTING_ON|GUIFRAME.MANAGER_ON):
+            panel_width = self._window_width * 0.45
             return panel_width, panel_height
+        elif p == self.defaultPanel:
+            return self._window_width, panel_height
+        #total_width = panel_width + self._window_width - 2.3 * panel_width
         return panel_width, panel_height
     
@@ -952,5 +964,4 @@
         Load all panels in the panels directory
         """
-        
         # Look for plug-in panels
         panels = []    
@@ -963,8 +974,17 @@
         # It also sets the size of the application windows
         #TODO: Use this for splash screen
-        if self.defaultPanel is None:
-            self.defaultPanel = DefaultPanel(self, -1, style=wx.RAISED_BORDER)
+        #if self.defaultPanel is None:
+        #    self.defaultPanel = DefaultPanel(self, -1, style=wx.RAISED_BORDER)
         # add a blank default panel always present 
         self.panels["default"] = self.defaultPanel
+        w, h = self._get_panels_size(self.defaultPanel)
+        #win = MDIFrame(self, DefaultPanel, "default", 
+        #               (self._window_width, self._window_height))
+        #win.set_panel(self.defaultPanel)
+        #self.defaultPanel.set_frame(win)
+        frame = self.defaultPanel.get_frame()
+        frame.SetSize((self._window_width, self._window_height))
+        frame.Show(True)
+        """
         self._mgr.AddPane(self.defaultPanel, wx.aui.AuiPaneInfo().
                               Name("default").
@@ -975,37 +995,37 @@
                                                self._window_height)).
                               Show())
-
+        """
         #add data panel 
+        
+        w, h = self._get_panels_size(self._data_panel)
+        win = MDIFrame(self, None, 'None', (w,h))
+        self._data_panel = DataPanel(parent=win)
+        win.set_panel(self._data_panel)
+        win.EnableCloseButton(False)
         self.panels["data_panel"] = self._data_panel
-        w, h = self._get_panels_size(self._data_panel)
-        self._mgr.AddPane(self._data_panel, wx.aui.AuiPaneInfo().
-                              Name(self._data_panel.window_name).
-                              Caption(self._data_panel.window_caption).
-                              Left().
-                              CloseButton(CLOSE_SHOW).
-                              TopDockable(False).
-                              BottomDockable(False).
-                              LeftDockable(True).
-                              RightDockable(False).
-                              BestSize(wx.Size(w, h)).
-                              Hide())
-
+        self._data_panel.set_frame(win)
         style = self.__gui_style & GUIFRAME.MANAGER_ON
-        data_pane = self._mgr.GetPane(self.panels["data_panel"].window_name)
         if style != GUIFRAME.MANAGER_ON:
-            data_pane.Hide()
+            flag = False
         else:
-            data_pane.Show()
-            
+            flag = True
+        win.Show(flag)
+        d_panel_width = w
         # Add the panels to the AUI manager
         for panel_class in panels:
-            p = panel_class
+            frame = panel_class.get_frame()
             id = wx.NewId()
             # Check whether we need to put this panel
             # in the center pane
-            if hasattr(p, "CENTER_PANE") and p.CENTER_PANE:
-                w, h = self._get_panels_size(p)
-                if p.CENTER_PANE:
-                    self.panels[str(id)] = p
+            
+            if hasattr(panel_class, "CENTER_PANE") and panel_class.CENTER_PANE:
+                w, h = self._get_panels_size(panel_class)
+                if panel_class.CENTER_PANE:
+                    self.panels[str(id)] = panel_class
+                    _, pos_y = frame.GetPositionTuple()
+                    frame.SetPosition((d_panel_width, pos_y))
+                    frame.SetSize((w, h))
+                    frame.Show(False)
+                    """
                     self._mgr.AddPane(p, wx.aui.AuiPaneInfo().
                                           Name(p.window_name).
@@ -1014,6 +1034,12 @@
                                           CloseButton(False).
                                           Hide())
+                    """
             else:
-                self.panels[str(id)] = p
+                self.panels[str(id)] = panel_class
+                frame.SetSize((w, h))
+                frame.Show(False)
+                #win = MDIFrame(self, p, p.window_name, (w, h))
+                #win.set_panel(p)
+                """
                 self._mgr.AddPane(p, wx.aui.AuiPaneInfo().
                                   Name(p.window_name).Caption(p.window_caption).
@@ -1026,5 +1052,8 @@
                                   MinimizeButton().
                                   Hide())        
-      
+                """
+        #if frame != None:
+        #    frame.EnableCloseButton(False)
+        
     def update_data(self, prev_data, new_data):
         """
@@ -1108,9 +1137,10 @@
         delete it.
         """
-        panel = event.GetPane()
-        if panel.IsMaximized():
-            self._mgr.RestoreMaximizedPane()
+        frame = event.GetEventObject()
+        #panel = frame.panel
+        #if panel.IsMaximized():
+        #    self._mgr.RestoreMaximizedPane()
         for ID in self.plot_panels.keys():
-            if self.plot_panels[ID].window_name == panel.name:
+            if self.plot_panels[ID].window_name == frame.name:
                 self.disable_app_menu(self.plot_panels[ID])
                 self.delete_panel(ID)
@@ -1130,4 +1160,17 @@
         ID = wx.NewId()
         self.panels[str(ID)] = p
+        ## Check and set the size
+        if PLOPANEL_WIDTH < 0:
+            p_panel_width = int(self._window_width * 0.45)
+        else:
+            p_panel_width = PLOPANEL_WIDTH
+        p_panel_height = int(p_panel_width * 0.76)
+        p.frame.SetSize((p_panel_width, p_panel_height))
+        """
+        dw, dh = self._get_panels_size(self._data_panel)
+        dw += p_panel_width
+        _, dh = self.GetToolBar().GetSizeTuple()
+        p.frame.SetPosition((dw, -dh))
+        """
         self.graph_num += 1
         if p.window_caption.split()[0] in NOT_SO_GRAPH_LIST:
@@ -1154,11 +1197,10 @@
         style2 = self.__gui_style & GUIFRAME.FLOATING_PANEL
         
-        ## Check and set the size
-        if PLOPANEL_WIDTH < 0:
-            p_panel_width = int(self._window_width * 0.36)
-        else:
-            p_panel_width = PLOPANEL_WIDTH
-        p_panel_height = int(p_panel_width * 0.75)
-        
+        p.frame.SetTitle(p.window_caption)
+        p.frame.name = p.window_name
+        p.frame.Show(True)
+        #if p not in self.schedule_full_draw_list:
+        #    self.schedule_full_draw_list.append(p)
+        """
         if style1 == GUIFRAME.FIXED_PANEL:
             self._mgr.AddPane(p, wx.aui.AuiPaneInfo().
@@ -1176,5 +1218,4 @@
                                                p_panel_height)))
             self._popup_fixed_panel(p)
-    
         elif style2 == GUIFRAME.FLOATING_PANEL:
             self._mgr.AddPane(p, wx.aui.AuiPaneInfo().
@@ -1188,6 +1229,7 @@
             
             self._popup_floating_panel(p)
+        """
         # Register for closing of panels
-        self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_panel_close)
+        #self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_panel_close)
         # Register for showing/hiding the panel
         wx.EVT_MENU(self, ID, self.on_view)
@@ -1231,5 +1273,5 @@
         self._add_menu_tool()
         self._add_current_plugin_menu()
-        self._add_menu_window()
+        #self._add_menu_window()
         self._add_help_menu()
         self.SetMenuBar(self._menubar)
@@ -1251,5 +1293,5 @@
         application_name = 'No Selected Analysis'
         panel_name = 'No Panel on Focus'
-        c_panel = self.cpanel_on_focus
+        c_panel = self.cpanel_on_focus        
         if self._toolbar is  None:
             return
@@ -1445,91 +1487,4 @@
         self.panel = ConfDialog(parent=self, gui=self.__gui_style)
         self.panel.ShowModal()
-        #wx.PostEvent(self.parent, event)
-        
-
-    def _add_menu_window(self):
-        """
-        add a menu window to the menu bar
-        Window menu
-        Attach a menu item for each panel in our
-        panel list that also appears in a plug-in.
-        
-        Only add the panel menu if there is only one perspective and
-        it has more than two panels.
-        Note: the first plug-in is always the plotting plug-in. 
-        The first application
-        #plug-in is always the second one in the list.
-        """
-        self._window_menu = wx.Menu()
-        if self._plotting_plugin is not None:
-            for (menu, name) in self._plotting_plugin.populate_menu(self):
-                self._window_menu.AppendSubMenu(menu, name)
-        self._menubar.Append(self._window_menu, '&Graph')
-
-        style = self.__gui_style & GUIFRAME.PLOTTING_ON
-        if style == GUIFRAME.PLOTTING_ON:
-            
-            self._window_menu.AppendSeparator()
-            id = wx.NewId()
-            hint = "Hide all the graph panels"
-            self._window_menu.Append(id, '&Hide  All', hint)
-            wx.EVT_MENU(self, id, self.hide_all_plotpanels)
-            id = wx.NewId()
-            hint = "Show all the graph panels"
-            self._window_menu.Append(id, '&Show All', hint)
-            wx.EVT_MENU(self, id, self.show_all_plotpanels)
-            
-            self._window_menu.AppendSeparator()
-            id = wx.NewId()
-            preferences_menu = wx.Menu()
-            hint = "All plot panels will floating"
-            preferences_menu.AppendRadioItem(id, '&Float All', hint)
-            wx.EVT_MENU(self, id, self.set_plotpanel_floating)
-            style = self.__gui_style & GUIFRAME.FLOATING_PANEL
-            f_menu = preferences_menu.FindItemById(id)
-            if style == GUIFRAME.FLOATING_PANEL: 
-                f_checked = True
-            else:
-                f_checked = False
-            f_menu.Check(f_checked)
-
-            id = wx.NewId()
-            hint = "All plot panels will displayed within the frame"
-            preferences_menu.AppendRadioItem(id, '&Dock All', hint)
-            wx.EVT_MENU(self, id, self.set_plotpanel_fixed) 
-            if not f_checked:
-                d_menu = preferences_menu.FindItemById(id)
-                d_menu.Check(True)
-            preferences_menu.AppendSeparator()
-            id = wx.NewId()
-            hint = "Clean up the dock area for plots on new-plot"
-            preferences_menu.AppendCheckItem(id, '&CleanUp Dock on NewPlot', 
-                                             hint)
-            wx.EVT_MENU(self, id, self.on_cleanup_dock)
-            flag = self.cleanup_plots
-            if self.cleanup_plots:
-                c_menu = preferences_menu.FindItemById(id)
-                c_menu.Check(True)  
-            self._window_menu.AppendSubMenu(preferences_menu,'&Preferences')
-        if self._window_menu.GetMenuItemCount() == 0:
-            pos = self._menubar.FindMenu('Graph')
-            self._menubar.Remove(pos)
-        #wx.EVT_MENU(self, id, self.show_preferences_panel)   
-        #if len(self.plugins) == 2:
-        #    plug = self.plugins[1]
-        #    pers = plug.get_perspective()
-        #
-        #    if len(pers) > 1:
-        #        self._window_menu = wx.Menu()
-        #        for item in self.panels:
-        #            if item == 'default':
-        #                continue
-        #            panel = self.panels[item]
-        #            if panel.window_name in pers:
-        #                self._window_menu.Append(int(item),
-        #                                          panel.window_caption,
-        #                                "Show %s window" % panel.window_caption)
-        #                wx.EVT_MENU(self, int(item), self.on_view)
-        #        self._menubar.Append(self._window_menu, '&Window')
 
                 
@@ -1562,4 +1517,5 @@
                                       "Switch to analysis: %s" % plug.sub_menu)
                     wx.EVT_MENU(self, id, plug.on_perspective)
+
             #self._applications_menu.
             if (not plug_data_count or not plug_no_data_count):
@@ -1653,7 +1609,5 @@
                                'Preview current panel')
         wx.EVT_MENU(self, GUIFRAME_ID.PREVIEW_ID, self.on_preview_panel)
-        #self._edit_menu.Append(GUIFRAME_ID.PRINT_ID, '&Print',
-        #                       'Print current panel')
-        #wx.EVT_MENU(self, GUIFRAME_ID.PRINT_ID, self.on_print_panel)
+
         self._edit_menu.Append(GUIFRAME_ID.RESET_ID, '&Reset Page', 
                                'Reset current panel')
@@ -1716,23 +1670,5 @@
         wx.CallLater(5*TIME_FACTOR, self.set_schedule(True))
         self.set_plot_unfocus()
-        
-    def on_close_welcome_panel(self):
-        """
-        Close the welcome panel
-        """
-        if self.defaultPanel is None:
-            return 
-        default_panel = self._mgr.GetPane(self.panels["default"].window_name)
-        if default_panel.IsShown():
-            default_panel.Hide()
-            # Recover current perspective
-            perspective = self._current_perspective
-            perspective.on_perspective(event=None)
-            self._mgr.Update()
-            # Show toolbar
-            #style = self.__gui_style & GUIFRAME.TOOLBAR_ON
-            #if (style == GUIFRAME.TOOLBAR_ON) & (not self._toolbar.IsShown()):
-            #    self._on_toggle_toolbar()
-            
+ 
     def show_welcome_panel(self, event):
         """    
@@ -1741,130 +1677,20 @@
         if self.defaultPanel is None:
             return 
-        for id, panel in self.panels.iteritems():
-            if id  ==  'default':
-                # Show default panel
-                if not self._mgr.GetPane(self.panels["default"].window_name).IsShown():
-                    self._mgr.GetPane(self.panels["default"].window_name).Show(True)
-            elif id == "data_panel":
-                flag = self._mgr.GetPane(self.panels["data_panel"].window_name).IsShown()
-                self._mgr.GetPane(self.panels["data_panel"].window_name).Show(flag)
-            elif panel not in self.plot_panels.values() :
-                self._mgr.GetPane(self.panels[id].window_name).IsShown()
-                self._mgr.GetPane(self.panels[id].window_name).Hide()
-        #style = self.__gui_style & GUIFRAME.TOOLBAR_ON
-        #if (style == GUIFRAME.TOOLBAR_ON) & (self._toolbar.IsShown()):
-        #    #    self._toolbar.Show(True)
-        #    self._on_toggle_toolbar()
-
-        self._mgr.Update()
-       
-    def show_panel(self, uid, show=None):
-        """
-        Shows the panel with the given id
-        
-        :param uid: unique ID number of the panel to show
-        
-        """
-        ID = str(uid)
-        config.printEVT("show_panel: %s" % ID)
-        if ID in self.panels.keys():
-            if not self._mgr.GetPane(self.panels[ID].window_name).IsShown(): 
-                if show == 'on':
-                    self._mgr.GetPane(self.panels[ID].window_name).Show()   
-                elif self.panels[ID].window_caption.split(" ")[0] == \
-                                                            "Residuals":
-                    self._mgr.GetPane(self.panels[ID].window_name).Hide()
-                else:
-                    self._mgr.GetPane(self.panels[ID].window_name).Show()
-                # Hide default panel
-                self._mgr.GetPane(self.panels["default"].window_name).Hide()
-        self._mgr.Update()     
-        self._redraw_idle()
-
-    def show_all_plotpanels(self, event):
-        """
-        Show all plotpanels shown
-        
-        :param event: menu event
-        """
-        #event.Skip()
-        any_hidden = False
-        for id in self.plot_panels.keys():
-            if self._mgr.GetPane(self.plot_panels[id].window_name).IsShown():
-                continue
-            else:
-                any_hidden = True
-                self.show_panel(id)
-        if not any_hidden:
-            msg = "No hidden graph panel exists."
-        else:
-            # Make sure the Checkmenuitem checked: Need this for-loop \
-            # because the check menu is not responding on floating panel 
-            if IS_WIN:
-                try:
-                    for item in self._plotting_plugin.menu.GetMenuItems():
-                        item.Check(True)
-                except:
-                    # MAC is not using checkmenuitem
-                    pass
-            msg = "All graph panels are shown."
-        wx.PostEvent(self, StatusEvent(status=msg))
-            
-    def hide_all_plotpanels(self, event):
-        """
-        Hide all plotpanels shown
-        
-        :param event: menu event
-        """
-        #event.Skip()
-        any_shown = False
-        for ID in self.plot_panels.keys():
-            if self._mgr.GetPane(self.plot_panels[ID].window_name).IsShown():
-                any_shown = True
-                try:
-                    self.hide_panel(ID)
-                except:
-                    print "hide_panel: No such plot id %s" % ID
-            else:
-                continue
-        if not any_shown:
-            msg = "No shown graph panel exists."
-        else:
-            # Make sure the Checkmenuitem unchecked: Need this for-loop 
-            # because the check menu is not responding on floating panel 
-            if IS_WIN:
-                try:
-                    for item in self._plotting_plugin.menu.GetMenuItems():
-                        item.Check(False)
-                except:
-                    # MAC is not using checkmenuitem
-                    pass
-            msg = "All graph panels are hidden."
-        wx.PostEvent(self, StatusEvent(status=msg))
-                    
-    def hide_panel(self, uid):
-        """
-        hide panel except default panel
-        """
-        ID = str(uid)
-        caption = self.panels[ID].window_caption
-        config.printEVT("hide_panel: %s" % ID)
-        if ID in self.panels.keys():
-            pane = self._mgr.GetPane(self.panels[ID].window_name)
-            if pane.IsMaximized():
-                self._mgr.RestoreMaximizedPane()
-                self.disable_app_menu(self.panels[ID])
-            if pane.IsShown():
-                pane.Hide()
-                item = self._plotting_plugin.menu.FindItemById(uid)
-                item.Check(False)
-                if self._data_panel is not None and \
-                            ID in self.plot_panels.keys():
-                    self._data_panel.cb_plotpanel.Append(str(caption), 
-                                                         self.panels[ID])
-                # Do not Hide default panel here...
-                #self._mgr.GetPane(self.panels["default"].window_name).Hide()
-            wx.CallAfter(self._mgr.Update)
-            self.cpanel_on_focus.SetFocus()
+        frame = self.panels['default'].get_frame()
+        if frame == None:
+            return
+        # Show default panel
+        if not frame.IsShown():
+            frame.Show(True)
+            
+    def on_close_welcome_panel(self):
+        """
+        Close the welcome panel
+        """
+        if self.defaultPanel is None:
+            return 
+        default_panel = self.panels["default"].frame
+        if default_panel.IsShown():
+            default_panel.Show(False) 
                 
     def delete_panel(self, uid):
@@ -1882,9 +1708,11 @@
             self.panel_on_focus = None
             panel = self.panels[ID]
-            self._mgr.DetachPane(panel)
+            #self._mgr.DetachPane(panel)
+            if hasattr(panel, "connect"):
+                panel.connect.disconnect()
             self._plotting_plugin.delete_panel(panel.group_id)
-            panel.Hide()
-            panel.clear()
-            panel.Close()
+            #panel.Hide()
+            #panel.clear()
+            #panel.Close()
             if panel in self.schedule_full_draw_list:
                 self.schedule_full_draw_list.remove(panel) 
@@ -1895,17 +1723,5 @@
             if ID in self.panels.keys():
                 del self.panels[ID]
-            #CallAfter: make sure panel is clear before updating mgr
-            wx.CallAfter(self._mgr.Update)
             return 
-      
-    def clear_panel(self):
-        """
-        Clear the panel
-        """
-        for item in self.panels:
-            try:
-                self.panels[item].clear_panel()
-            except:
-                pass
             
     def create_gui_data(self, data, path=None):
@@ -1954,7 +1770,5 @@
         if style == GUIFRAME.MANAGER_ON:
             if self._data_panel is not None:
-                #data_state = self._data_manager.get_selected_data()
-                #self._data_panel.load_data_list(data_state)
-                self._mgr.GetPane(self._data_panel.window_name).Show(True)
+                self._data_panel.frame.Show(True)
       
     def load_from_cmd(self,  path):   
@@ -1981,6 +1795,29 @@
 
         self._default_save_location = os.path.dirname(path)
-
-    def load_state(self, path):   
+        
+    def show_panel(self, uid, show=None):
+        """
+        Shows the panel with the given id
+        
+        :param uid: unique ID number of the panel to show
+        
+        """
+        ID = str(uid)
+        config.printEVT("show_panel: %s" % ID)
+        if ID in self.panels.keys():
+            if not self.panels[ID].frame.IsShown(): 
+                if show == 'on':
+                    self.panels[ID].frame.Show()   
+                elif self.panels[ID].window_caption.split(" ")[0] == \
+                                                            "Residuals":
+                    self._mgr.GetPane(self.panels[ID].window_name).Hide()
+                else:
+                    self._mgr.GetPane(self.panels[ID].window_name).Show()
+                # Hide default panel
+                self._mgr.GetPane(self.panels["default"].window_name).Hide()
+        self._mgr.Update()     
+        self._redraw_idle()
+        
+    def load_state(self, path, is_project=False):   
         """
         load data from command line or application
@@ -1990,16 +1827,15 @@
             if APPLICATION_STATE_EXTENSION is not None \
                 and basename.endswith(APPLICATION_STATE_EXTENSION):
-                #Hide current plot_panels i
-                for ID in self.plot_panels.keys():
-                    panel = self._mgr.GetPane(self.plot_panels[ID].window_name)
-                    if panel.IsShown():
-                        panel.Hide()
+                if is_project:
+                    for ID in self.plot_panels.keys():
+                        panel = self.plot_panels[ID]
+                        panel.on_close(None)
             self.get_data(path)
             wx.PostEvent(self, StatusEvent(status="Completed loading."))
         else:
             wx.PostEvent(self, StatusEvent(status=" "))
-        if self.defaultPanel is not None and \
-            self._mgr.GetPane(self.panels["default"].window_name).IsShown():
-            self.on_close_welcome_panel()
+        #if self.defaultPanel is not None and \
+        #    self._mgr.GetPane(self.panels["default"].window_name).IsShown():
+        #    self.on_close_welcome_panel()
             
     def load_data(self, path):
@@ -2132,5 +1968,5 @@
         #except:
         
-        self.load_state(path=path)
+        self.load_state(path=path, is_project=True)
         
     def _on_save_application(self, event):
@@ -2416,16 +2252,15 @@
         :param panels: list of panels
         """
-        #style = self.__gui_style & GUIFRAME.TOOLBAR_ON
-        #if (style == GUIFRAME.TOOLBAR_ON) & (not self._toolbar.IsShown()):
-        #    self._on_toggle_toolbar()
-        for item in self.panels:
+        for item in self.panels.keys():
             # Check whether this is a sticky panel
             if hasattr(self.panels[item], "ALWAYS_ON"):
                 if self.panels[item].ALWAYS_ON:
                     continue 
-            
+            if self.panels[item] == None:
+                continue
             if self.panels[item].window_name in panels:
-                if not self._mgr.GetPane(self.panels[item].window_name).IsShown():
-                    self._mgr.GetPane(self.panels[item].window_name).Show()
+                frame = self.panels[item].get_frame()
+                if not frame.IsShown():
+                    frame.Show(True)
             else:
                 # always show the data panel if enable
@@ -2433,11 +2268,16 @@
                 if (style == GUIFRAME.MANAGER_ON) and self.panels[item] == self._data_panel:
                     if 'data_panel' in self.panels.keys():
-                        flag = self._mgr.GetPane(self.panels['data_panel'].window_name).IsShown()
-                        self._mgr.GetPane(self.panels['data_panel'].window_name).Show(flag)
+                        frame = self.panels['data_panel'].get_frame()
+                        if frame == None:
+                            continue
+                        flag = frame.IsShown()
+                        frame.Show(flag)
                 else:
-                    if self._mgr.GetPane(self.panels[item].window_name).IsShown():
-                        self._mgr.GetPane(self.panels[item].window_name).Hide()
-                
-        self._mgr.Update()
+                    frame = self.panels[item].get_frame()
+                    if frame == None:
+                        continue
+
+                    if frame.IsShown():
+                        frame.Show(False)
         
     def show_data_panel(self, event=None, action=True):
@@ -2448,22 +2288,18 @@
             return
         label = self._data_panel_menu.GetText()
+        pane = self.panels["data_panel"]
+        frame = pane.get_frame()
         if label == 'Show Data Explorer':
-            pane = self._mgr.GetPane(self.panels["data_panel"].window_name)
             #if not pane.IsShown():
             if action: 
-                pane.Show(True)
-                self._mgr.Update()
+                frame.Show(True)
             self.__gui_style = self.__gui_style | GUIFRAME.MANAGER_ON
-            
             self._data_panel_menu.SetText('Hide Data Explorer')
         else:
-            pane = self._mgr.GetPane(self.panels["data_panel"].window_name)
-            #if not pane.IsShown():
             if action:
-                pane.Show(False)
-                self._mgr.Update()
+                frame.Show(False)
             self.__gui_style = self.__gui_style & (~GUIFRAME.MANAGER_ON)
             self._data_panel_menu.SetText('Show Data Explorer')
-    
+
     def add_data_helper(self, data_list):
         """
@@ -2493,10 +2329,8 @@
             #wait for button press from the data panel to set_data 
             if self._data_panel is not None:
-                self._mgr.GetPane(self._data_panel.window_name).Show(True)
-                self._mgr.Update() 
+                self._data_panel.frame.Show(True)
         else:
             #automatically send that to the current perspective
             self.set_data(data_id=data_list.keys())
-            self.on_close_welcome_panel()
        
     def set_data(self, data_id, theory_id=None): 
@@ -2506,13 +2340,6 @@
         list_data, _ = self._data_manager.get_by_id(data_id)
         if self._current_perspective is not None:
-            if self.cleanup_plots:
-                for uid, panel in self.plot_panels.iteritems():
-                    #panel = self.plot_panels[uid]
-                    window = self._mgr.GetPane(panel.window_name)
-                    # To hide all docked plot panels when set the data
-                    if not window.IsFloating():
-                        self.hide_panel(uid)
             self._current_perspective.set_data(list_data.values())
-            self.on_close_welcome_panel()
+
         else:
             msg = "Guiframe does not have a current perspective"
@@ -2566,10 +2393,4 @@
                                                    info='warning'))
             else:
-                if self.cleanup_plots:
-                    for id, panel in self.plot_panels.iteritems():
-                        window = self._mgr.GetPane(panel.window_name)
-                        # To hide all docked plot panels when set the data
-                        if not window.IsFloating():
-                            self.hide_panel(id)
                 #if not append then new plot
                 from sans.guiframe.dataFitting import Data2D
@@ -2593,15 +2414,4 @@
         """
         temp = data_id + theory_id
-        """
-        value = [plug.is_in_use(temp) for plug in self.plugins]
-        if len(value) > 0:
-            print "value"
-            return
-            from data_panel import DataDialog
-            dlg = DataDialog(data_list=data_list, nb_data=MAX_NBR_DATA)
-            if dlg.ShowModal() == wx.ID_OK:
-                selected_data_list = dlg.get_data()
-            dlg.Destroy()
-        """
         for plug in self.plugins:
             plug.delete_data(temp)
@@ -2892,7 +2702,12 @@
                 if hasattr(panel, 'CENTER_PANE') and panel.CENTER_PANE:
                     for name in self._current_perspective.get_perspective():
-                        if name == panel.window_name:
-                            panel.on_set_focus(event=None)
-                            break               
+                        frame = panel.get_frame()
+                        if frame != None:
+                            if name == panel.window_name:
+                                panel.on_set_focus(event=None)
+                                frame.Show(True)
+                            else:
+                                frame.Show(False)
+                            #break               
             name = self._current_perspective.sub_menu
             if self._data_panel is not None:
@@ -2901,5 +2716,4 @@
             #Set the SasView title
             self._set_title_name(name)
-          
             
     def _set_title_name(self, name):
@@ -2926,81 +2740,4 @@
                         else:
                             menu.Check(False) 
-           
-    def set_plotpanel_floating(self, event=None):
-        """
-        make the plot panel floatable
-        """
-        
-        self.__gui_style &= (~GUIFRAME.FIXED_PANEL)
-        self.__gui_style |= GUIFRAME.FLOATING_PANEL
-        plot_panel = []
-        id = event.GetId()
-        menu = self._window_menu.FindItemById(id)
-        if self._plotting_plugin is not None:
-            plot_panel = self.plot_panels.values()
-            for p in plot_panel:
-                self._popup_floating_panel(p)
-            menu.Check(True)
-            
-    def set_plotpanel_fixed(self, event=None):
-        """
-        make the plot panel fixed
-        """
-        self.__gui_style &= (~GUIFRAME.FLOATING_PANEL)
-        self.__gui_style |= GUIFRAME.FIXED_PANEL
-        plot_panel = []
-        id = event.GetId()
-        menu = self._window_menu.FindItemById(id)
-        if self._plotting_plugin is not None:
-            plot_panel = self.plot_panels.values()
-            for p in plot_panel:
-                self._popup_fixed_panel(p)
-            menu.Check(True)
-            
-    def on_cleanup_dock(self, event=None):     
-        """
-        Set Cleanup Dock option
-        """
-        if event == None:
-            return
-        id = event.GetId()
-        menu = self._window_menu.FindItemById(id)
-        Flag = self.cleanup_plots
-        if not Flag:
-            menu.Check(True)
-            self.cleanup_plots = True
-            msg = "Cleanup-Dock option set to 'ON'."
-        else:
-            menu.Check(False)
-            self.cleanup_plots = False
-            msg = "Cleanup-Dock option set to 'OFF'."
-
-        wx.PostEvent(self, StatusEvent(status= msg))
-         
-    def _popup_fixed_panel(self, p):
-        """
-        """
-        style = self.__gui_style & GUIFRAME.FIXED_PANEL
-        if style == GUIFRAME.FIXED_PANEL:
-            pane = self._mgr.GetPane(p.window_name)
-            pane.Dock()
-            pane.Floatable()
-            pane.Right()
-            pane.TopDockable(False)
-            pane.BottomDockable(False)
-            pane.LeftDockable(False)
-            pane.RightDockable(True)
-            self._mgr.Update()
-            
-    def _popup_floating_panel(self, p):
-        """
-        """
-        style = self.__gui_style &  GUIFRAME.FLOATING_PANEL
-        if style == GUIFRAME.FLOATING_PANEL: 
-            pane = self._mgr.GetPane(p.window_name)
-            pane.Floatable(True)
-            pane.Float()
-            pane.Dockable(False)
-            self._mgr.Update()
             
     def enable_add_data(self, new_plot):
@@ -3233,5 +2970,5 @@
         : return: AuiPaneInfo of the name
         """
-        return self._mgr.GetPane(name) 
+        return None#self._mgr.GetPane(name) 
     
     def enable_undo(self):
@@ -3325,5 +3062,13 @@
         if self.cpanel_on_focus is not None:
             self._toolbar.enable_reset(self.panel_on_focus)
-
+            
+    def get_toolbar_height(self):
+        """
+        """
+        size_y = 0
+        if self.GetToolBar() != None and self.GetToolBar().IsShown():
+            _, size_y = self.GetToolBar().GetSizeTuple()
+        return size_y
+    
     def set_schedule_full_draw(self, panel=None, func='del'):
         """
@@ -3354,4 +3099,5 @@
         Draw the panels with axes in the schedule to full dwar list
         """
+        
         count = len(self.schedule_full_draw_list)
         #if not self.schedule:
@@ -3359,4 +3105,5 @@
             self.set_schedule(False)
             return
+
         else:
             ind = 0
@@ -3364,10 +3111,9 @@
             for panel in self.schedule_full_draw_list:
                 ind += 1
-                if self._mgr.GetPane(panel.window_name).IsShown():
+                if panel.frame.IsShown():
                     break
                 # otherwise, return
                 if ind == count:
                     return
-
         #Simple redraw only for a panel shown
         def f_draw(panel):
@@ -3378,21 +3124,21 @@
                 # This checking of GetCapture is to stop redrawing
                 # while any panel is capture.
-                if self.GetCapture() == None:
+                frame = panel.frame
+                
+                if not frame.GetCapture():
                     # draw if possible
                     panel.set_resizing(False)
-                    panel.Show(False)
+                    #panel.Show(True)
                     panel.draw_plot()
-                    
-                    # Check if the panel is not shown
-                    if not self._mgr.GetPane(panel.window_name).IsShown():
-                        self._mgr.GetPane(panel.window_name).Hide()
-                    else:
-                        panel.Show(True)
+                # Check if the panel is not shown
+                flag = frame.IsShown()
+                frame.Show(flag)
+                   
             except:
-                pass
-        
+                raise
+     
         # Draw all panels        
-        map(f_draw, self.schedule_full_draw_list)
-        
+        #map(f_draw, self.schedule_full_draw_list)
+        f_draw(self.schedule_full_draw_list[0])
         # Reset the attr  
         if len(self.schedule_full_draw_list) == 0:
@@ -3400,6 +3146,4 @@
         else:
             self.set_schedule(True)
-        # do not update mgr
-        #self._mgr.Update()
         
     def set_schedule(self, schedule=False):  
@@ -3703,5 +3447,5 @@
                                  style=(wx.SIMPLE_BORDER|
                                         wx.FRAME_NO_TASKBAR|
-                                        wx.STAY_ON_TOP),
+                                        wx.FRAME_FLOAT_ON_PARENT),
                                         
                         milliseconds=SS_MAX_DISPLAY_TIME,
@@ -3724,4 +3468,66 @@
         self.maximize_win()
 
+
+class MDIFrame(wx.MDIChildFrame):
+    """
+    Frame for panels
+    """
+    def __init__(self, parent, panel, title="Untitled",
+                size=(300,200), *args, **kwds):
+        """
+        comment
+        :param parent: parent panel/container
+        """
+        kwds['size']= size
+        kwds['title']= title
+        # Initialize the Frame object
+        wx.MDIChildFrame.__init__(self, parent, *args, **kwds)
+        self.parent = parent
+        self.name = "Untitled"
+        self.batch_on = self.parent.batch_on
+        self.panel = panel
+        if panel != None:
+            self.set_panel(panel)
+        self.Show(False)
+    
+    def show_data_panel(self, action):
+        """
+        """
+        self.parent.show_data_panel(action)
+        
+    def set_panel(self, panel):
+        """
+        """
+        self.panel = panel
+        self.name = panel.window_name
+        self.SetTitle(panel.window_caption)
+        self.SetHelpText(panel.help_string)
+        width, height = self.parent._get_panels_size(panel)
+        if hasattr(panel, "CENTER_PANE") and panel.CENTER_PANE:
+            width *= 0.6  
+        self.SetSize((width, height))
+        self.parent.put_icon(self)
+        self.Bind(wx.EVT_SET_FOCUS, self.set_panel_focus)
+        self.Bind(wx.EVT_CLOSE, self.OnClose)
+        self.Show(False)
+    
+    def set_panel_focus(self, event):
+        """
+        """
+        self.panel.SetFocus()
+        self.parent.panel_on_focus = self.panel
+        #self.parent.set_panel_on_focus_helper()
+        
+    def OnClose(self, event):
+        """
+        On Close event
+        """
+        #event.Skip()
+        self.panel.on_close(event)
+        #self.parent.delete_panel(event)
+        #self.DestroyChildren()
+        #self.panel = None
+        #wx.CallAfter(self.Destroy)
+        
 if __name__ == "__main__": 
     app = ViewApp(0)
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py	(revision 3e001f98892a6dd98b2b904148628e4df8c63238)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -73,6 +73,9 @@
         ## Reference to the parent window
         self.parent = parent
+        if hasattr(parent, "parent"):
+            self.parent = self.parent.parent
         ## Plottables
         self.plots = {}
+        self.frame = None
         #context menu
         self._slicerpop = None
@@ -335,11 +338,12 @@
         """  
         ax = event.inaxes
-        dclick = event.action == 'dclick'
-        if ax == None or dclick:
-            # remove the vline
-            self._check_zoom_plot()
-            self.canvas.draw()
-            self.q_ctrl = None
-            return 
+        if hasattr(event, "action"):
+            dclick = event.action == 'dclick'
+            if ax == None or dclick:
+                # remove the vline
+                self._check_zoom_plot()
+                self.canvas.draw()
+                self.q_ctrl = None
+                return 
         if self.ly != None and event.xdata != None:
             # Selecting a new line if cursor lines are displayed already
@@ -442,5 +446,5 @@
                 data = theory_list[id]
             # Update Graph menu and help string        
-            h_id = self.parent._window_menu.FindItem(self.window_caption)
+            #h_id = self.parent._window_menu.FindItem(self.window_caption)
             if data != None:
                 if data.__class__.__name__ == 'list':
@@ -450,8 +454,8 @@
             else:
                 label = '???'
-            helpString = self.parent._window_menu.GetHelpString(h_id) 
+            #helpString = self.parent._window_menu.GetHelpString(h_id) 
             d_string = (' ' + str(label) +';')
-            new_tip = helpString.replace(d_string, '')
-            self.parent._window_menu.SetHelpString(h_id, new_tip)  
+            #new_tip = helpString.replace(d_string, '')
+            #self.parent._window_menu.SetHelpString(h_id, new_tip)  
 
             del self.plots[id]
@@ -518,10 +522,10 @@
                 self.is_zoomed = False
             # Update Graph menu and help string        
-            pos = self.parent._window_menu.FindItem(self.window_caption)
+            #pos = self.parent._window_menu.FindItem(self.window_caption)
             helpString = 'Show/Hide Graph: '
             for plot in  self.plots.itervalues():
                 helpString += (' ' + str(plot.label) +';')
-            self.parent._window_menu.SetHelpString(pos, helpString)      
-          
+            #self.parent._window_menu.SetHelpString(pos, helpString)  
+                
     def draw_plot(self):
         """
@@ -801,4 +805,5 @@
         Add refresh, add/hide button in the tool bar
         """
+        return
         if self.parent.__class__.__name__ != 'ViewerFrame':
             return
@@ -817,4 +822,11 @@
             self.parent.hide_panel(self.uid)
 
+    def on_close(self, event):
+        """
+        On Close Event
+        """
+        ID = self.uid
+        self.parent.delete_panel(ID)
+    
     def createAppDialog(self, event):
         """
@@ -859,10 +871,10 @@
             self.appearance_selected_plot.label = str(info[3])
 
-            pos = self.parent._window_menu.FindItem(self.window_caption)
-            helpString = 'Show/Hide Graph: '
-            for plot in  self.plots.itervalues():
-                helpString += (' ' + str(plot.label) + ';')
-                self.parent._window_menu.SetHelpString(pos, helpString)
-                self._is_changed_legend_label = True
+            #pos = self.parent._window_menu.FindItem(self.window_caption)
+            #helpString = 'Show/Hide Graph: '
+            #for plot in  self.plots.itervalues():
+            #    helpString += (' ' + str(plot.label) + ';')
+            #    self.parent._window_menu.SetHelpString(pos, helpString)
+            #    self._is_changed_legend_label = True
                 
         self.appD.Destroy()
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py	(revision 3e001f98892a6dd98b2b904148628e4df8c63238)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter2D.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -106,7 +106,8 @@
         """
         ModelPanel1D.__init__(self, parent, id=id, style=style, **kwargs)
-        
+        self.parent = parent
         ## Reference to the parent window
-        self.parent = parent
+        if hasattr(parent, "parent"):
+            self.parent = self.parent.parent
         ## Dictionary containing Plottables
         self.plots = {}
@@ -247,8 +248,8 @@
             self.subplot.figure.canvas.draw_idle()    
         # Update Graph menu and help string        
-        pos = self.parent._window_menu.FindItem(self.window_caption)
+        #pos = self.parent._window_menu.FindItem(self.window_caption)
         helpString = 'Show/Hide Graph: '
         helpString += (' ' + str(data.label) +';')
-        self.parent._window_menu.SetHelpString(pos, helpString)
+        #self.parent._window_menu.SetHelpString(pos, helpString)
         ## store default value of zmin and zmax 
         self.default_zmin_ctl = self.zmin_2D
@@ -467,8 +468,8 @@
         # Update Graph menu and help string 
         if self.title_label != None:     
-            pos = self.parent._window_menu.FindItem(self.window_caption)
+            #pos = self.parent._window_menu.FindItem(self.window_caption)
             helpString = 'Show/Hide Graph: '
             helpString += (' ' + str(self.title_label) +';')
-            self.parent._window_menu.SetHelpString(pos, helpString)
+            #self.parent._window_menu.SetHelpString(pos, helpString)
 
         
@@ -691,4 +692,5 @@
         """
         """
+        from sans.guiframe.gui_manager import MDIFrame
         from boxSum import BoxSum
         self.onClearSlicer(event)
@@ -704,5 +706,6 @@
         ## Create a new panel to display results of summation of Data2D
         from slicerpanel import SlicerPanel
-        new_panel = SlicerPanel(parent=self.parent, id=-1,
+        win = MDIFrame(self.parent, None, 'None', (100, 200))
+        new_panel = SlicerPanel(parent=win, id=-1,
                                     base=self, type=type,
                                     params=params, style=wx.RAISED_BORDER)
@@ -713,12 +716,17 @@
                                     str(self.data2D.name)
         ## Store a reference of the new created panel
-        self.panel_slicer = new_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 sans.guiframe.events import SlicerPanelEvent
-        wx.PostEvent(self.parent, SlicerPanelEvent(panel=self.panel_slicer,
+        
+        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
+        
     def onBoxavgX(self,event):
         """
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/SimplePlot.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/SimplePlot.py	(revision 9e9e9a5140a409f9b7a01b8ced70e12308ef64a6)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/SimplePlot.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -21,4 +21,5 @@
         """
         PlotPanel.__init__(self, parent, id=id, style=style, **kwargs)
+
         self.SetColor(wx.WHITE)
         
@@ -198,6 +199,5 @@
         """
         # Initialize the Frame object
-        wx.Frame.__init__(self, parent, id, title,
-                          wx.DefaultPosition, size)
+        wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, size)
         
         # Panel for 1D plot
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py	(revision 3e001f98892a6dd98b2b904148628e4df8c63238)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/plotting.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -21,5 +21,5 @@
 from sans.guiframe.dataFitting import Data1D
 from sans.guiframe.dataFitting import Data2D
-
+from sans.guiframe.gui_manager import MDIFrame
 DEFAULT_MENU_ITEM_LABEL = "No graph available"
 DEFAULT_MENU_ITEM_ID = wx.NewId()
@@ -69,4 +69,6 @@
         
         """
+        return []
+        """
         self.menu = wx.Menu()
         self.menu.Append(DEFAULT_MENU_ITEM_ID, DEFAULT_MENU_ITEM_LABEL, 
@@ -74,4 +76,5 @@
         self.menu.FindItemByPosition(0).Enable(False)
         return [(self.menu, "Show")]
+        """
     
     def get_panels(self, parent):
@@ -126,12 +129,4 @@
             self.hide_panel(group_id)
         self.plot_panels = {}
-        item = self.menu.FindItemByPosition(0)
-        while item != None:
-            self.menu.DeleteItem(item) 
-            try:
-                item = self.menu.FindItemByPosition(0)
-            except:
-                item = None
-               
     
     def clear_panel_by_id(self, group_id):
@@ -151,8 +146,5 @@
         hide panel with group ID = group_id
         """
-        if group_id in self.plot_panels.keys():
-            panel = self.plot_panels[group_id]
-            self.parent.hide_panel(panel.uid)
-            return True
+        # Not implemeted
         return False
     
@@ -171,23 +163,20 @@
         new_panel.window_name = data.title
         event_id = self.parent.popup_panel(new_panel)
-        #remove the default item in the menu
-        if len(self.plot_panels) == 0:
-            pos = self.menu.FindItem(DEFAULT_MENU_ITEM_LABEL)
-            if pos != -1:
-                self.menu.Delete(DEFAULT_MENU_ITEM_ID)
+
         # Set UID to allow us to reference the panel later
         new_panel.uid = event_id
         # Ship the plottable to its panel
         wx.CallAfter(new_panel.plot_data, data) 
+        #new_panel.canvas.set_resizing(new_panel.resizing)
         self.plot_panels[new_panel.group_id] = new_panel
         
         # Set Graph menu and help string        
-        helpString = 'Show/Hide Graph: '
+        self.help_string = ' Graph: '
         for plot in  new_panel.plots.itervalues():
-            helpString += (' ' + plot.label + ';')
-        self.menu.AppendCheckItem(event_id, new_panel.window_caption, 
-                                  helpString)
-        self.menu.Check(event_id, IS_WIN)
-        wx.EVT_MENU(self.parent, event_id, self._on_check_menu)
+            help_string += (' ' + plot.label + ';')
+        #self.menu.AppendCheckItem(event_id, new_panel.window_caption, 
+        #                          helpString)
+        #self.menu.Check(event_id, IS_WIN)
+        #wx.EVT_MENU(self.parent, event_id, self._on_check_menu)
 
         
@@ -203,6 +192,11 @@
             ytransform = data.ytransform
             ## create a plotpanel for 1D Data
-            new_panel = ModelPanel1D(self.parent, -1, xtransform=xtransform,
+            win = MDIFrame(self.parent, None, 'None', (100, 200))
+            new_panel = ModelPanel1D(win, -1, xtransform=xtransform,
                      ytransform=ytransform, style=wx.RAISED_BORDER)
+            win.set_panel(new_panel)
+            win.Show(False)
+            new_panel.frame = win
+            #win.Show(True)
             return  new_panel
         
@@ -217,7 +211,12 @@
             from Plotter2D import ModelPanel2D
             scale = data.scale
-            new_panel = ModelPanel2D(self.parent, id = -1,
+            win = MDIFrame(self.parent, None, 'None', (200, 150))
+            win.Show(False)
+            new_panel = ModelPanel2D(win, id = -1,
                                 data2d=data, scale = scale, 
                                 style=wx.RAISED_BORDER)
+            win.set_panel(new_panel)
+            new_panel.frame = win
+            #win.Show(True)
             return new_panel
         msg = "2D Panel of group ID %s could not be created" % str(group_id)
@@ -247,22 +246,5 @@
                 data.list_group_id.append(panel.group_id)
             wx.CallAfter(panel.plot_data, data)
-            #Do not show residual plot when it is hidden
-            #ToDo: find better way
-            if str(panel.group_id)[0:3] == 'res' and not panel.IsShown():
-                return
-            self.parent.show_panel(panel.uid)   
-    
-    def delete_menu_item(self, name, uid):
-        """
-        """
-        #remove menu item
-        pos = self.menu.FindItem(name) 
-        if pos != -1:
-            self.menu.Delete(uid)
-        if self.menu.GetMenuItemCount() == 0:
-            self.menu.Append(DEFAULT_MENU_ITEM_ID, DEFAULT_MENU_ITEM_LABEL, 
-                             "No graph available")
-            self.menu.FindItemByPosition(0).Enable(False)
-        
+
     def delete_panel(self, group_id):
         """
@@ -275,8 +257,9 @@
                                     caption=panel.window_caption))
             #remove menu item
-            self.delete_menu_item(panel.window_caption, panel.uid)
+            #self.delete_menu_item(panel.window_caption, panel.uid)
             del self.plot_panels[group_id]
             if uid in self.parent.plot_panels.keys():
                 del self.parent.plot_panels[uid]
+                panel.frame.Destroy()
             return True
 
@@ -352,19 +335,5 @@
             self.create_panel_helper(new_panel, data, group_id, title) 
         return
-
-    def _on_check_menu(self, event):
-        """
-        Check mark on menu
-        """
-        #event.Skip()
-        event_id = event.GetId()
-
-        if self.menu.IsChecked(event_id):
-            self.parent.on_view(event)
-            self.menu.Check(event_id, IS_WIN)
-        else:
-            self.parent.hide_panel(event_id)
-            self.menu.Check(event_id, False)
-        
+       
     def help(self, evt):
         """
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/profile_dialog.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/profile_dialog.py	(revision 657e52c6e801e630d2fc6f1722a752b701d20771)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/profile_dialog.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -195,5 +195,5 @@
         Show data dialog
         """   
-        self.parent.parent.parent.show_data1d(data, name)
+        self.parent._manager.parent.show_data1d(data, name)
         
 class SLDplotpanel(PlotPanel):
@@ -300,5 +300,5 @@
             # What an ancestor!
             fit_panel = self.parent.parent.parent
-            fit_panel.parent.save_data1d(data, default_name)
+            fit_panel._manager.parent.save_data1d(data, default_name)
              
 class ViewerFrame(wx.Frame):
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/slicerpanel.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/slicerpanel.py	(revision d555416ffc3f04e93e25869cea9c492369943d93)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/slicerpanel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -32,5 +32,6 @@
             params = {}
         self.params = params
-        self.parent = parent
+        self.parent = base.parent
+        self.frame = None
         self.type = type
         self.listeners = []
@@ -118,5 +119,7 @@
         #self.bck.Fit(self)
         self.Layout()
-        self.parent.GetSizer().Layout()
+        psizer = self.parent.GetSizer()
+        if psizer != None:
+            psizer.Layout()
         
     def onSetFocus(self, evt):
@@ -163,4 +166,10 @@
             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: sansguiframe/src/sans/guiframe/panel_base.py
===================================================================
--- sansguiframe/src/sans/guiframe/panel_base.py	(revision 225ed2d59d0a2ac1c277516ff3c7323d21d5604f)
+++ sansguiframe/src/sans/guiframe/panel_base.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -57,4 +57,5 @@
        
         self.group_id = None
+        self.help_string = ''
 
     def on_batch_selection(self, event):
@@ -426,3 +427,18 @@
         """
         """
-        return self._manager
+        return self._manager  
+      
+    def get_frame(self):
+        """
+        """
+        if self._manager == None:
+            return None
+        return self._manager.frame
+    
+    def on_close(self, event):
+        """
+        On Close Event
+        """
+        if self.frame != None:
+            self.frame.Destroy()
+            
Index: sansguiframe/src/sans/guiframe/plugin_base.py
===================================================================
--- sansguiframe/src/sans/guiframe/plugin_base.py	(revision da7cacbad65586b3477aff237fce28d47e726ffe)
+++ sansguiframe/src/sans/guiframe/plugin_base.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -41,4 +41,5 @@
         ## Reference to the parent window. Filled by get_panels() below.
         self.parent = None
+        self.frame = None
         #plugin state reader
         self.state_reader = None 
@@ -145,4 +146,18 @@
         return []
     
+    def get_frame(self):
+        """
+        Returns MDIChildFrame
+        """
+        return self.frame
+
+    def _frame_set_helper(self):
+        """
+        Sets default frame config
+        """
+        if self.frame != None:
+            self.frame.EnableCloseButton(False)
+            self.frame.Show(False)
+    
     def get_panels(self, parent):
         """
@@ -212,7 +227,19 @@
         
         """
+        old_frame = None
+        tool_height = self.parent.get_toolbar_height()
+        old_persp = self.parent.get_current_perspective()
+        if old_persp != None:
+            old_frame = old_persp.get_frame()
         self.parent.check_multimode(self)
         self.parent.set_current_perspective(self)
         self.parent.set_perspective(self.perspective)
+        
+        if self.frame != None:
+            if old_frame != None:
+                pos_x, pos_y = old_frame.GetPositionTuple()
+                self.frame.SetPosition((pos_x, pos_y - tool_height))
+            if not self.frame.IsShown():
+                self.frame.Show(True)
         
         
Index: sansguiframe/src/sans/guiframe/startup_configuration.py
===================================================================
--- sansguiframe/src/sans/guiframe/startup_configuration.py	(revision 657e52c6e801e630d2fc6f1722a752b701d20771)
+++ sansguiframe/src/sans/guiframe/startup_configuration.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -126,13 +126,14 @@
             p_size = None
             for panel in self.parent.plot_panels.values():
-                p_panel = self.parent._mgr.GetPane(panel.window_name)
-                if p_panel.IsShown():
-                    if p_size == None or panel.size > p_size:
-                        p_size = panel.size
+                #p_panel = self.parent._mgr.GetPane(panel.window_name)
+                width, _ = panel.frame.GetSizeTuple()
+                if panel.frame.IsShown():
+                    if p_size == None or width > p_size:
+                        p_size = width
             if p_size == None:
                 p_size = CURRENT_STRINGS['PLOPANEL_WIDTH']
             self.current_string['PLOPANEL_WIDTH'] = p_size
             
-            data_pw, _ = self.parent.panels["data_panel"].GetSizeTuple()
+            data_pw, _ = self.parent.panels["data_panel"].frame.GetSizeTuple()
             if data_pw == None:
                 data_pw = CURRENT_STRINGS['DATAPANEL_WIDTH']
@@ -140,6 +141,5 @@
             
             #label = self.parent._data_panel_menu.GetText()
-            label = self.parent._mgr.GetPane(\
-                        self.parent.panels['data_panel'].window_name).IsShown()
+            label = self.parent.panels['data_panel'].frame.IsShown()
             if label:# == 'Hide Data Explorer':
                 self.current_string['DATALOADER_SHOW'] = True
@@ -158,5 +158,5 @@
                 self.current_string['FIXED_PANEL'] = True
                 
-            if self.parent._mgr.GetPane(self.parent.panels['default'].window_name).IsShown():
+            if self.parent.panels['default'].frame.IsShown():
                 self.current_string['WELCOME_PANEL_SHOW'] = True
             else:
@@ -197,5 +197,4 @@
         fname = os.path.join(self.path, 'custom_config.py')
         self.write_string(fname, self.return_string)
-    
         self.Destroy()
 
