Index: fittingview/src/sans/perspectives/fitting/basepage.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/basepage.py	(revision cb270ad27e17b8390da5c566dbcff97450db0c7d)
+++ fittingview/src/sans/perspectives/fitting/basepage.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -713,5 +713,5 @@
         msg = menu.GetHelpString(event.GetId())
         msg += " reloaded"
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         self.Show(False)
         name = menu.GetLabel(event.GetId())
@@ -746,5 +746,5 @@
         if self.parent != None:
             self._default_save_location = \
-                        self.parent.parent._default_save_location
+                        self._manager.parent._default_save_location
         dlg = wx.FileDialog(self, "Choose a file", self._default_save_location,
                                         self.window_caption, "*.fitv", wx.SAVE)
@@ -753,5 +753,5 @@
             path = dlg.GetPath()
             self._default_save_location = os.path.dirname(path)
-            self.parent.parent._default_save_location =\
+            self._manager.parent._default_save_location =\
                                  self._default_save_location
         else:
@@ -803,9 +803,9 @@
             msg += ": No valid parameter values to paste from the clipboard..."
             infor = "error"
-            wx.PostEvent(self.parent.parent,
+            wx.PostEvent(self._manager.parent,
                     StatusEvent(status=msg, info=infor))
             raise
         # inform msg to wx
-        wx.PostEvent(self.parent.parent,
+        wx.PostEvent(self._manager.parent,
                     StatusEvent(status=msg, info=infor))
         
@@ -843,10 +843,10 @@
         ## post help message for the selected model
         msg += " Saved! right click on this page to retrieve this model"
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         
         id = wx.NewId()
         self.popUpMenu.Append(id, name, str(msg))
         wx.EVT_MENU(self, id, self.onResetModel)
-        wx.PostEvent(self.parent.parent,
+        wx.PostEvent(self._manager.parent,
                      AppendBookmarkEvent(title=name,
                                          hint=str(msg),
@@ -877,5 +877,5 @@
         try:
             if path == None:
-                wx.PostEvent(self.parent.parent,
+                wx.PostEvent(self._manager.parent,
                             StatusEvent(status= \
                             " Selected Distribution was not loaded: %s" % path))
@@ -1490,5 +1490,5 @@
         if self.parent != None:
             self._default_save_location = \
-                        self.parent.parent.get_save_location()
+                        self._manager.parent.get_save_location()
         dlg = wx.FileDialog(self, "Choose a weight file",
                                 self._default_save_location, "",
@@ -1702,5 +1702,5 @@
             msg = "Cannot Plot or Fit :Must select a "
             msg += " model or Fitting range is not valid!!!  "
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         
         try:
@@ -2081,5 +2081,5 @@
         except:
             msg = "%s\n" % (sys.exc_value)
-            wx.PostEvent(self.parent.parent,
+            wx.PostEvent(self._manager.parent,
                          StatusEvent(status=msg, info="error"))
         self._populate_box(self.formfactorbox, m_list)
@@ -2188,5 +2188,5 @@
         #Clear msg if previously shown.
         msg = ""
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         # Flag to register when a parameter has changed.
         is_modified = False
@@ -2223,9 +2223,9 @@
                 else:
                     msg = "Cannot Plot :No npts in that Qrange!!!  "
-                    wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                    wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         else:
             tcrtl.SetBackgroundColour("pink")
             msg = "Model Error:wrong value entered!!!"
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         self.save_current_state()
         event = PageInfoEvent(page=self)
@@ -2367,5 +2367,5 @@
                 qmax_ctrl.Refresh()
                 msg = "Invalid Q range: Q min must be smaller than Q max"
-                wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return False
         return True
@@ -2399,5 +2399,5 @@
                 msg = "Npts of Data Error :"
                 msg += "No or too little npts of %s." % data.name
-                wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 self.fitrange = False
                 flag = False
@@ -2434,5 +2434,5 @@
                 msg = "Npts of Data Error :"
                 msg += "No or too little npts of %s." % data.name
-                wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 self.fitrange = False
                 flag = False
@@ -2485,5 +2485,5 @@
                         except:
                             msg = "Wrong Fit parameter range entered "
-                            wx.PostEvent(self.parent.parent,
+                            wx.PostEvent(self._manager.parent,
                                          StatusEvent(status=msg))
                             raise ValueError, msg
@@ -2502,5 +2502,5 @@
                         except:
                             msg = "Wrong Fit parameter range entered "
-                            wx.PostEvent(self.parent.parent,
+                            wx.PostEvent(self._manager.parent,
                                          StatusEvent(status=msg))
                             raise ValueError, msg
@@ -2511,5 +2511,5 @@
                         msg = "Wrong Fit range entered for parameter "
                         msg += "name %s of model %s " % (name, self.model.name)
-                        wx.PostEvent(self.parent.parent,
+                        wx.PostEvent(self._manager.parent,
                                      StatusEvent(status=msg))
                 
@@ -2533,5 +2533,5 @@
                 item[2].SetBackgroundColour("pink")
                 msg = "Wrong Fit parameter value entered "
-                wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 
         return is_modified
@@ -2763,5 +2763,5 @@
             # Focus on Fit button so that users can see the pinky box
             self.btFit.SetFocus()
-            wx.PostEvent(self.parent.parent,
+            wx.PostEvent(self._manager.parent,
                          StatusEvent(status=msg, info="error"))
         
@@ -2785,6 +2785,6 @@
             return
         self._default_save_location = os.path.dirname(path)
-        if self.parent != None:
-            self.parent.parent._default_save_location =\
+        if self._manager != None:
+            self._manager.parent._default_save_location =\
                              self._default_save_location
 
@@ -2800,5 +2800,5 @@
         # Tell the user that we are about to apply the distribution
         msg = "Applying loaded %s distribution: %s" % (name, path)
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         self._set_array_disp_model(name=name, disp=disp,
                                     values=values, weights=weights)
@@ -2947,5 +2947,5 @@
         if flag == False:
             msg = "Cannot Plot :Must enter a number!!!  "
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         else:
             # set relative text ctrs.
@@ -2983,5 +2983,5 @@
         res_item = None
         # call gui_manager
-        gui_manager = self.parent.parent
+        gui_manager = self._manager.parent
         # loops through the panels [dic]
         for _, item2 in gui_manager.plot_panels.iteritems():
Index: fittingview/src/sans/perspectives/fitting/fitpage.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitpage.py	(revision 3e001f98892a6dd98b2b904148628e4df8c63238)
+++ fittingview/src/sans/perspectives/fitting/fitpage.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -68,4 +68,5 @@
         #create a default data for an empty panel
         self.create_default_data()
+        #self._manager.frame.Bind(wx.EVT_SET_FOCUS, self.on_set_focus)
     
     def enable_fit_button(self):
@@ -985,5 +986,5 @@
         if not flag:
             msg = "The parameters are invalid"
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
             return
         
@@ -1000,6 +1001,6 @@
             return
 
-        if len(self.parent._manager.fit_thread_list) > 0 and\
-                    self.parent._manager._fit_engine != "park" and\
+        if len(self._manager.fit_thread_list) > 0 and\
+                    self._manager._fit_engine != "park" and\
                     self._manager.sim_page != None and \
                     self._manager.sim_page.uid == self.uid:
@@ -1036,5 +1037,5 @@
         if not flag:
             msg = "Fitting range or parameters are invalid"
-            wx.PostEvent(self.parent.parent,
+            wx.PostEvent(self._manager.parent,
                          StatusEvent(status=msg, type="stop"))
             return
@@ -1259,5 +1260,5 @@
         #Clear msg if previously shown.
         msg = ""
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
 
         if check_float(tcrtl):
@@ -1301,5 +1302,5 @@
             self.save_current_state()
             msg = "Cannot Plot :Must enter a number!!!  "
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
              
         self.save_current_state()
@@ -1313,5 +1314,5 @@
         #Clear msg if previously shown.
         msg = ""
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         # Flag to register when a parameter has changed.
         is_modified = False
@@ -1324,5 +1325,5 @@
                 tcrtl.SetBackgroundColour("pink")
                 msg = "Model Error:wrong value entered : %s" % sys.exc_value
-                wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
         else:
@@ -1357,5 +1358,5 @@
             d_group_id = self.data.group_id
             act_ctrl = event.GetEventObject()
-            wx.PostEvent(self.parent.parent, 
+            wx.PostEvent(self._manager.parent, 
                          PlotQrangeEvent(ctrl=[self.qmin, self.qmax], id=d_id, 
                                      group_id=d_group_id, leftdown=is_click,
@@ -1373,5 +1374,5 @@
         d_id = self.data.id
         d_group_id = self.data.group_id
-        wx.PostEvent(self.parent.parent, 
+        wx.PostEvent(self._manager.parent, 
                      PlotQrangeEvent(ctrl=[self.qmin, self.qmax], id=d_id, 
                                      group_id=d_group_id, leftdown=False, 
@@ -1415,5 +1416,5 @@
         #Clear msg if previously shown.
         msg = ""
-        wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+        wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         # For theory mode
         if not self.data.is_data:
@@ -1436,10 +1437,10 @@
                     tcrtl.SetBackgroundColour("pink")
                     msg = "Model Error:wrong value entered : %s" % sys.exc_value
-                    wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                    wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                     return
             except:
                 tcrtl.SetBackgroundColour("pink")
                 msg = "Model Error:wrong value entered : %s" % sys.exc_value
-                wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+                wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
                 return
             #Check if # of points for theory model are valid(>0).
@@ -1457,5 +1458,5 @@
                     msg = "Cannot Plot :No or too little npts in"
                     msg += " that data range!!!  "
-                    wx.PostEvent(self.parent.parent,
+                    wx.PostEvent(self._manager.parent,
                                  StatusEvent(status=msg))
                     return
@@ -1475,5 +1476,5 @@
             tcrtl.SetBackgroundColour("pink")
             msg = "Model Error:wrong value entered!!!"
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         
         self._draw_model()
@@ -1767,5 +1768,5 @@
             self.set_npts2fit()
             msg = "No model is found on updating MASK in the model plot... "
-            wx.PostEvent(self.parent.parent, StatusEvent(status=msg))
+            wx.PostEvent(self._manager.parent, StatusEvent(status=msg))
         else:
             event.Skip()
@@ -1983,5 +1984,5 @@
             try:
                 wx.PostEvent(self._manager.parent,
-                             NewPlotEvent(action="remove",
+                             NewPlotEvent(action="delete",
                                           group_id=old_group_id, id=old_id))
             except:
@@ -2015,5 +2016,5 @@
             msg += "information.\n"
             msg += "%s"% (sys.exc_value)
-            wx.PostEvent(self.parent.parent,
+            wx.PostEvent(self._manager.parent,
                          StatusEvent(status=msg, info="error"))
         self._lay_out()
@@ -2680,5 +2681,5 @@
             if item[0] and item[0].IsShown():
                 param2fit.append(item[1])
-        self.parent._manager.set_param2fit(self.uid, param2fit)
+        self._manager.set_param2fit(self.uid, param2fit)
                 
     def select_all_param(self, event):
@@ -2812,5 +2813,5 @@
             if item[0] and item[0].IsShown():
                 param2fit.append(item[1])
-        self.parent._manager.set_param2fit(self.uid, param2fit)
+        self._manager.set_param2fit(self.uid, param2fit)
         
     def set_model_param_sizer(self, model):
@@ -3237,5 +3238,5 @@
             infor = 'warning'
             # inform msg to wx
-            wx.PostEvent(self.parent.parent,
+            wx.PostEvent(self._manager.parent,
                         StatusEvent(status=msg, info=infor))
         
Index: fittingview/src/sans/perspectives/fitting/fitpanel.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitpanel.py	(revision 3b148c314b0c4e6b040d87b742641316879ead12)
+++ fittingview/src/sans/perspectives/fitting/fitpanel.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -71,5 +71,5 @@
         self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.on_page_changing)
         self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSED, self.on_closed)
-
+        
     def on_closed(self, event):
         """
@@ -161,5 +161,6 @@
         if pos != -1:
             selected_page = self.GetPage(pos)
-            wx.PostEvent(self.parent, PanelOnFocusEvent(panel=selected_page))
+            wx.PostEvent(self._manager.parent, 
+                         PanelOnFocusEvent(panel=selected_page))
         self.enable_close_button()
        
@@ -170,5 +171,6 @@
         if pos != -1:
             selected_page = self.GetPage(pos)
-            wx.PostEvent(self.parent, PanelOnFocusEvent(panel=selected_page))
+            wx.PostEvent(self._manager.parent, 
+                         PanelOnFocusEvent(panel=selected_page))
         
     def get_data(self):
Index: fittingview/src/sans/perspectives/fitting/fitting.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitting.py	(revision bca2cb97f0dadbbd24cf00e5c75de2635055dc50)
+++ fittingview/src/sans/perspectives/fitting/fitting.py	(revision ae84427fb413d3ecd63bda31ee6158118adebce0)
@@ -41,4 +41,5 @@
 from sans.perspectives.calculator.model_editor import TextDialog
 from sans.perspectives.calculator.model_editor import EditorWindow
+from sans.guiframe.gui_manager import MDIFrame
 
 MAX_NBR_DATA = 4
@@ -427,5 +428,5 @@
             page.Refresh()
             page.SetFocus()
-            self.parent._mgr.Update()
+            #self.parent._mgr.Update()
             msg = "%s already opened\n" % str(page.window_caption)
             wx.PostEvent(self.parent, StatusEvent(status=msg))
@@ -500,5 +501,8 @@
         #self.parent.Bind(EVT_FITSTATE_UPDATE, self.on_set_state_helper)
         # Creation of the fit panel
-        self.fit_panel = FitPanel(parent=self.parent, manager=self)
+        self.frame = MDIFrame(self.parent, None, 'None', (100, 200))
+        self.fit_panel = FitPanel(parent=self.frame, manager=self)
+        self.frame.set_panel(self.fit_panel)
+        self._frame_set_helper()
         self.on_add_new_page(event=None)
         #Set the manager for the main panel
@@ -513,5 +517,5 @@
         self.parent.Bind(EVT_SLICER_PANEL, self._on_slicer_event)
         self.parent.Bind(EVT_SLICER_PARS_UPDATE, self._onEVT_SLICER_PANEL)
-        self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer)
+        #self.parent._mgr.Bind(wx.aui.EVT_AUI_PANE_CLOSE,self._onclearslicer)
         #Create reader when fitting panel are created
         self.state_reader = Reader(self.set_state)
@@ -577,12 +581,4 @@
                 wx.PostEvent(self.parent, StatusEvent(status=msg, info="error"))
     
-    def set_top_panel(self):
-        """
-        Close default (welcome) panel
-        """
-        if 'default' in self.parent.panels:
-            self.parent.on_close_welcome_panel()
-
-        
     def set_theory(self, theory_list=None):
         """
@@ -1168,5 +1164,4 @@
                 wx.PostEvent(self.parent, StatusEvent(status=msg,
                                                        info="warning"))
-            self.set_top_panel()
         except:
             msg = "Creating Fit page: %s"%sys.exc_value
@@ -1224,4 +1219,5 @@
             the panel and panel_name to find the slicer 's panel concerned.
         """
+        event.panel_name
         for item in self.parent.panels:
             name = event.panel_name
@@ -1229,5 +1225,5 @@
                 self.parent.panels[item].set_slicer(event.type, event.params)
                 
-        self.parent._mgr.Update()
+        #self.parent._mgr.Update()
    
     def _closed_fitpage(self, event):
@@ -1308,5 +1304,4 @@
                 data = plottable
                 self.add_fit_page(data=[data])
-        self.set_top_panel()
             
     def update_fit(self, result=None, msg=""):
@@ -1689,7 +1684,7 @@
             self.slicer_panels.append(event.panel)
             # Set group ID if available
-            event_id = self.parent.popup_panel(new_panel)
-            new_panel.uid = event_id
-            self.mypanels.append(new_panel)
+            event_id = self.parent.popup_panel(event.panel)
+            event.panel.uid = event_id
+            self.mypanels.append(event.panel)
        
     def _onclearslicer(self, event):
@@ -1697,6 +1692,6 @@
         Clear the boxslicer when close the panel associate with this slicer
         """
-        name = event.GetPane().caption
-    
+        name = event.GetEventObject().frame.GetTitle()
+        print "name", name
         for panel in self.slicer_panels:
             if panel.window_caption == name:
@@ -1706,5 +1701,5 @@
                         if self.parent.panels[item].uid == panel.base.uid:
                             self.parent.panels[item].onClearSlicer(event)
-                            self.parent._mgr.Update()
+                            #self.parent._mgr.Update()
                             break
                 break
