Index: prview/perspectives/pr/inversion_panel.py
===================================================================
--- prview/perspectives/pr/inversion_panel.py	(revision 3e41f43f7d0b8c4264182203e33d8cbf55977c98)
+++ prview/perspectives/pr/inversion_panel.py	(revision 75df58b1beae85913437ed9d779e48bb1169235d)
@@ -10,5 +10,6 @@
 import logging
 from wx.lib.scrolledpanel import ScrolledPanel
-from sans.guicomm.events import StatusEvent    
+from sans.guiframe.events import StatusEvent   
+from sans.guiframe.panel_base import PanelBase 
 from inversion_state import InversionState
 from pr_widgets import PrTextCtrl
@@ -18,5 +19,5 @@
 
 
-class InversionControl(ScrolledPanel):
+class InversionControl(ScrolledPanel, PanelBase):
     """
     """
@@ -35,4 +36,5 @@
         """
         ScrolledPanel.__init__(self, parent, id=id, **kwargs)
+        PanelBase.__init__(self)
         self.SetupScrolling()
         
@@ -72,18 +74,12 @@
         self.alpha_estimate_ctl = None
         self.nterms_estimate_ctl = None
-        
         ## D_max distance explorator
         self.distance_explorator_ctl = None
-        
         ## Data manager
         self.manager   = None
-        
         ## Standalone flage
         self.standalone = standalone
-        
         ## Default file location for save
         self._default_save_location = os.getcwd()
-        
-        
         # Default width
         self._default_width = 350
@@ -578,8 +574,8 @@
         hint_msg = "Radius of gyration for the computed P(r)."
         self.rg_ctl.SetToolTipString(hint_msg)
-        self.iq0_ctl   = OutputTextCtrl(self, -1, size=(60,20))
+        self.iq0_ctl   = OutputTextCtrl(self, -1, size=(60, 20))
         hint_msg = "Scattering intensity at Q=0 for the computed P(r)."
         self.iq0_ctl.SetToolTipString(hint_msg)
-        self.bck_ctl   = OutputTextCtrl(self, -1, size=(60,20))
+        self.bck_ctl   = OutputTextCtrl(self, -1, size=(60, 20))
         self.bck_ctl.SetToolTipString("Value of estimated constant background.")
         
@@ -592,13 +588,13 @@
         label_pos_err = wx.StaticText(self, -1, "1-sigma positive fraction")
         
-        self.time_ctl = OutputTextCtrl(self, -1, size=(60,20))
+        self.time_ctl = OutputTextCtrl(self, -1, size=(60, 20))
         hint_msg = "Computation time for the last inversion, in seconds."
         self.time_ctl.SetToolTipString(hint_msg)
         
-        self.chi2_ctl = OutputTextCtrl(self, -1, size=(60,20))
+        self.chi2_ctl = OutputTextCtrl(self, -1, size=(60, 20))
         self.chi2_ctl.SetToolTipString("Chi^2 over degrees of freedom.")
         
         # Oscillation parameter
-        self.osc_ctl = OutputTextCtrl(self, -1, size=(60,20))
+        self.osc_ctl = OutputTextCtrl(self, -1, size=(60, 20))
         hint_msg = "Oscillation parameter. P(r) for a sphere has an "
         hint_msg += " oscillation parameter of 1.1."
@@ -606,5 +602,5 @@
         
         # Positive fraction figure of merit
-        self.pos_ctl = OutputTextCtrl(self, -1, size=(60,20))
+        self.pos_ctl = OutputTextCtrl(self, -1, size=(60, 20))
         hint_msg = "Fraction of P(r) that is positive. "
         hint_msg += "Theoretically, P(r) is defined positive."
@@ -612,5 +608,5 @@
         
         # 1-simga positive fraction figure of merit
-        self.pos_err_ctl = OutputTextCtrl(self, -1, size=(60,20))
+        self.pos_err_ctl = OutputTextCtrl(self, -1, size=(60, 20))
         message  = "Fraction of P(r) that is at least 1 standard deviation"
         message += " greater than zero.\n"
@@ -775,8 +771,5 @@
         height = 0
         width  = 0
-        
         flag = True
-        
-        
         # Read slit height
         try:
@@ -917,25 +910,17 @@
             wx.PostEvent(self.parent, StatusEvent(status=message))
         
-    def _change_file(self, evt=None, filepath=None):
+    def _change_file(self, evt=None, filepath=None, data=None):
         """
         Choose a new input file for I(q)
         """
-        import os
-        if not self.manager==None:
-            path = self.manager.choose_file(path=filepath)
-            
-            if path and os.path.isfile(path):
-                self.plot_data.SetValue(str(path))
-                try:
-                    self.manager.show_data(path, reset=True)
-                    self._on_pars_changed(None)
-                
-                    # Perform inversion
-                    if self.standalone == True:
-                        self._on_invert(None)
-                except:
-                    # Invalid data
-                    msg = "InversionControl._change_file: %s" % sys.exc_value
-                    logging.error(msg)                    
+        if not self.manager is None:
+            self.plot_data.SetValue(str(data.name))
+            try:
+                self.manager.show_data(data=data, reset=True)
+                self._on_pars_changed(None)
+                self._on_invert(None)
+            except:
+                msg = "InversionControl._change_file: %s" % sys.exc_value
+                logging.error(msg)                    
 
 class HelpDialog(wx.Dialog):
@@ -954,5 +939,5 @@
         explanation = help()
            
-        label_explain = wx.StaticText(self, -1, explanation, size=(350,320))
+        label_explain = wx.StaticText(self, -1, explanation, size=(350, 320))
             
         vbox.Add(label_explain, 0, wx.ALL|wx.EXPAND, 15)
@@ -991,13 +976,12 @@
         
         label_npts = wx.StaticText(self, -1, "Number of points")
-        self.npts_ctl = PrTextCtrl(self, -1, size=(100,20))
+        self.npts_ctl = PrTextCtrl(self, -1, size=(100, 20))
                  
-        pars_sizer = wx.GridBagSizer(5,5)
+        pars_sizer = wx.GridBagSizer(5, 5)
         iy = 0
-        pars_sizer.Add(label_npts,      (iy,0), (1,1), wx.LEFT, 15)
-        pars_sizer.Add(self.npts_ctl,   (iy,1), (1,1), wx.RIGHT, 0)
+        pars_sizer.Add(label_npts, (iy, 0), (1, 1), wx.LEFT, 15)
+        pars_sizer.Add(self.npts_ctl, (iy, 1), (1, 1), wx.RIGHT, 0)
         
         vbox.Add(pars_sizer, 0, wx.ALL|wx.EXPAND, 15)
-
 
         static_line = wx.StaticLine(self, -1)
