Index: guiframe/README.txt
===================================================================
--- guiframe/README.txt	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
+++ guiframe/README.txt	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
@@ -0,0 +1,23 @@
+################################################################################
+#This software was developed by the University of Tennessee as part of the
+#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+#project funded by the US National Science Foundation. 
+#
+#See the license text in license.txt
+#
+#copyright 2008, University of Tennessee
+################################################################################
+
+
+How-to build an application using guiframe:
+
+1- Write a main application script along the lines of dummyapp.py
+2- Write a config script along the lines of config.py, and 
+    name it local_config.py
+3- Write your plug-ins and place them in a directory called "perspectives".
+    - Look at local_perspectives/plotting for an example of a plug-in.
+    - A plug-in should define a class named Plugin,
+    	 inheriting from PluginBase in plugin_base.py
+    
+4- each panel used in guiframe must inheritation from PanelBase in panel_base.py
+
Index: guiframe/events.py
===================================================================
--- guiframe/events.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
+++ guiframe/events.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
@@ -0,0 +1,28 @@
+import wx.lib.newevent
+#send  data to data manager
+(NewStoreDataEvent, EVT_NEW_STORE_DATA) = wx.lib.newevent.NewEvent()
+# send data to other perspectives
+(NewLoadedDataEvent, EVT_NEW_LOADED_DATA) = wx.lib.newevent.NewEvent()
+# plot data
+(NewPlotEvent, EVT_NEW_PLOT) = wx.lib.newevent.NewEvent()
+# print the messages on statusbar
+(StatusEvent,  EVT_STATUS)   = wx.lib.newevent.NewEvent()
+#create a panel slicer 
+(SlicerPanelEvent, EVT_SLICER_PANEL)   = wx.lib.newevent.NewEvent()
+#print update paramaters for panel slicer 
+(SlicerParamUpdateEvent, EVT_SLICER_PARS_UPDATE)   = wx.lib.newevent.NewEvent()
+#update the slicer from the panel 
+(SlicerParameterEvent, EVT_SLICER_PARS)   = wx.lib.newevent.NewEvent()
+#slicer event
+(SlicerEvent, EVT_SLICER)   = wx.lib.newevent.NewEvent()
+# event containinG A DICTIONARY OF NAME and errors of selected data
+(ErrorDataEvent, ERR_DATA) = wx.lib.newevent.NewEvent()
+## event that that destroy a page associate with Data1D removed from the graph
+(RemoveDataEvent, EVT_REMOVE_DATA)   = wx.lib.newevent.NewEvent()
+##event that allow to add more that to the same plot
+(AddManyDataEvent, EVT_ADD_MANY_DATA)   = wx.lib.newevent.NewEvent()
+##event for the panel on focus
+(PanelOnFocusEvent, EVT_PANEL_ON_FOCUS)   = wx.lib.newevent.NewEvent()
+# event to update state of each perspectives after state file is loaded
+(InvStateUpdateEvent, EVT_INVSTATE_UPDATE)   = wx.lib.newevent.NewEvent()
+(FitStateUpdateEvent, EVT_FITSTATE_UPDATE)   = wx.lib.newevent.NewEvent()
Index: guiframe/gui_manager.py
===================================================================
--- guiframe/gui_manager.py	(revision 32c0841e02d6c59dd5e7872fdba98ea9afb790b9)
+++ guiframe/gui_manager.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
@@ -10,16 +10,4 @@
 ################################################################################
 
-"""
-How-to build an application using guiframe:
-
-1- Write a main application script along the lines of dummyapp.py
-2- Write a config script along the lines of config.py, and 
-    name it local_config.py
-3- Write your plug-ins and place them in a directory called "perspectives".
-    - Look at local_perspectives/plotting for an example of a plug-in.
-    - A plug-in should define a class called Plugin. See abstract class below.
-
-"""
-#TODO: rewrite the status bar monstrosity
 
 import wx
@@ -57,147 +45,5 @@
 STATE_FILE_EXT = ['.inv', '.fitv', '.prv']
 
-def quit_guiframe(parent=None):
-    """
-    Pop up message to make sure the user wants to quit the application
-    """
-    message = "Do you really want to quit \n"
-    message += "this application?"
-    dial = wx.MessageDialog(parent, message, 'Question',
-                       wx.YES_NO|wx.NO_DEFAULT|wx.ICON_QUESTION)
-    if dial.ShowModal() == wx.ID_YES:
-        return True
-    else:
-        return False
-    
-class Plugin:
-    """
-    This class defines the interface for a Plugin class
-    that can be used by the gui_manager.
-    
-    Plug-ins should be placed in a sub-directory called "perspectives".
-    For example, a plug-in called Foo should be place in "perspectives/Foo".
-    That directory contains at least two files:
-        perspectives/Foo/__init.py contains two lines:
-        
-            PLUGIN_ID = "Foo plug-in 1.0"
-            from Foo import *
-            
-        perspectives/Foo/Foo.py contains the definition of the Plugin
-        class for the Foo plug-in. The interface of that Plugin class
-        should follow the interface of the class you are looking at.
-        
-    See dummyapp.py for a plugin example.
-    """
-    
-    def __init__(self, name="Test_plugin"):
-        """
-            Abstract class for gui_manager Plugins.
-        """
-        ## Plug-in name. It will appear on the application menu.
-        self.sub_menu = name     
-        
-        ## Reference to the parent window. Filled by get_panels() below.
-        self.parent = None
-        
-        ## List of panels that you would like to open in AUI windows
-        #  for your plug-in. This defines your plug-in "perspective"
-        self.perspective = []
-        
-        
-    def populate_menu(self, id, parent):
-        """
-        Create and return the list of application menu
-        items for the plug-in. 
-        
-        :param id: deprecated. Un-used.
-        :param parent: parent window
-        
-        :return: plug-in menu
-        
-        """
-        return []
-    
-    def get_panels(self, parent):
-        """
-        Create and return the list of wx.Panels for your plug-in.
-        Define the plug-in perspective.
-        
-        Panels should inherit from DefaultPanel defined below,
-        or should present the same interface. They must define
-        "window_caption" and "window_name".
-        
-        :param parent: parent window
-        
-        :return: list of panels
-        
-        """
-        ## Save a reference to the parent
-        self.parent = parent
-        
-        # Return the list of panels
-        return []
-    
-    def get_tools(self):
-        """
-        Returns a set of menu entries for tools
-        """
-        return []
-        
-    
-    def get_context_menu(self, graph=None):
-        """
-        This method is optional.
-    
-        When the context menu of a plot is rendered, the 
-        get_context_menu method will be called to give you a 
-        chance to add a menu item to the context menu.
-        
-        A ref to a Graph object is passed so that you can
-        investigate the plot content and decide whether you
-        need to add items to the context menu.  
-        
-        This method returns a list of menu items.
-        Each item is itself a list defining the text to 
-        appear in the menu, a tool-tip help text, and a
-        call-back method.
-        
-        :param graph: the Graph object to which we attach the context menu
-        
-        :return: a list of menu items with call-back function
-        
-        """
-        return []
-    
-    def get_perspective(self):
-        """
-        Get the list of panel names for this perspective
-        """
-        return self.perspective
-    
-    def on_perspective(self, event):
-        """
-        Call back function for the perspective menu item.
-        We notify the parent window that the perspective
-        has changed.
-        
-        :param event: menu event
-        
-        """
-        self.parent.set_perspective(self.perspective)
-    
-    def post_init(self):
-        """
-        Post initialization call back to close the loose ends
-        """
-        pass
-    
-    def set_default_perspective(self):
-        """
-       Call back method that True to notify the parent that the current plug-in
-       can be set as default  perspective.
-       when returning False, the plug-in is not candidate for an automatic 
-       default perspective setting
-        """
-        return False
+
 
 class ViewerFrame(wx.Frame):
@@ -836,10 +682,23 @@
         wx.Exit()
         sys.exit()
-                     
+                 
+    def quit_guiframe(self):
+        """
+        Pop up message to make sure the user wants to quit the application
+        """
+        message = "Do you really want to quit \n"
+        message += "this application?"
+        dial = wx.MessageDialog(self, message, 'Question',
+                           wx.YES_NO|wx.YES_DEFAULT|wx.ICON_QUESTION)
+        if dial.ShowModal() == wx.ID_YES:
+            return True
+        else:
+            return False    
+        
     def Close(self, event=None):
         """
         Quit the application
         """
-        flag = quit_guiframe(parent=self)
+        flag = self.quit_guiframe()
         if flag:
             #import sys
Index: guiframe/panel_base.py
===================================================================
--- guiframe/panel_base.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
+++ guiframe/panel_base.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
@@ -0,0 +1,231 @@
+
+
+################################################################################
+#This software was developed by the University of Tennessee as part of the
+#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+#project funded by the US National Science Foundation. 
+#
+#See the license text in license.txt
+#
+#copyright 2008, University of Tennessee
+################################################################################
+
+
+class PanelBase:
+    """
+    Defines the API for a panels to work with
+    the ViewerFrame toolbar and menu bar
+    """
+    ## Internal nickname for the window, used by the AUI manager
+    window_name = "default"
+    ## Name to appear on the window title bar
+    window_caption = "Welcome panel"
+    ## Flag to tell the AUI manager to put this panel in the center pane
+    CENTER_PANE = True
+    
+    def __init__(self):
+        """
+        Initialize some flag that Viewerframe used
+        """
+        self._print_flag = False
+        self._undo_flag = False
+        self._redo_flag = False
+        self._preview_flag = False
+        self._bookmark_flag = False
+        self._zoom_in_flag = False
+        self._zoom_out_flag = False
+        self._zoom_flag = False
+        self._save_flag = False
+        self._drag_flag = False
+        self._reset_flag = False
+        
+    def set_print_flag(self, flag=True):
+        """
+        The derivative class sets the print flag value to indicate that it can 
+        be printed
+        """
+        self._print_flag = flag
+    
+    def get_print_flag(self):
+        """
+        Get the print flag to update appropriately the tool bar
+        """
+        return self._print_flag
+    
+    def set_undo_flag(self, flag=True):
+        """
+        The derivative class sets the undo flag value to indicate that the 
+        current action done can be canceled
+        """
+        self._undo_flag = flag
+        
+    def get_undo_flag(self):
+        """
+        Get the undo flag to update appropriately the tool bar
+        """
+        return self._undo_flag
+    
+    def set_redo_flag(self, flag=True):
+        """
+        The derivative class sets the redo flag value to indicate that the 
+        action done can be recovered
+        """
+        self._redo_flag = flag
+     
+    def get_redo_flag(self):
+        """
+        Get the redo flag to update appropriately the tool bar
+        """
+        return self._redo_flag
+    
+    def set_zoomed_in_flag(self, flag=True):
+        """
+        The derivative class sets the zoom in flag value to indicate that it
+        can be zoomed in
+        """
+        self._zoom_in_flag = flag
+        
+    def get_zoom_in_flag(self):
+        """
+        Get the zoom in flag to update appropriately the tool bar
+        """
+        return self._zoom_in_flag
+    
+    def set_zoomed_out_flag(self, flag=True):
+        """
+        The derivative class sets the zoom out flag value to indicate that it
+        can be zoomed out
+        """
+        self._zoom_out_flag = flag
+        
+    def get_zoom_out_flag(self):
+        """
+        Get the zoom out flag to update appropriately the tool bar
+        """
+        return self._zoom_out_flag
+    
+    def set_zoom_flag(self, flag=True):
+        """
+        The derivative class sets the zoom flag value to indicate that it
+        can be zoomed
+        """
+        self._zoom_flag = flag
+        
+    def get_zoom_flag(self):
+        """
+        Get the zoom flag to update appropriately the tool bar
+        """
+        return self._zoom_flag
+    
+    def set_bookmark_flag(self, flag=True):
+        """
+        The derivative class sets the bookmark flag value to indicate that it
+        can be bookmarked
+        """
+        self._bookmark_flag = flag
+        
+    def get_bookmark_flag(self):
+        """
+        Get the bookmark flag to update appropriately the tool bar
+        """
+        return self._bookmark_flag
+    
+    def set_preview_flag(self, flag=True):
+        """
+        The derivative class sets the preview flag value to indicate that it
+        can be previewed
+        """
+        self._preview_flag = flag
+        
+    def get_preview_flag(self):
+        """
+        Get the preview flag to update appropriately the tool bar
+        """
+        return self._preview_flag
+    
+    def set_save_flag(self, flag=True):
+        """
+        The derivative class sets the drag flag value to indicate that it
+        can be saved
+        """
+        self._save_flag = flag
+        
+    def get_save_flag(self):
+        """
+        Get the save flag to update appropriately the tool bar
+        """
+        return self._save_flag
+    
+    def set_drag_flag(self, flag=True):
+        """
+        The derivative class sets the drag flag value to indicate that 
+        dragging motion is possible
+        """
+        self._drag_flag = flag
+        
+    def get_drag_flag(self):
+        """
+        Get the drag flag to update appropriately the tool bar
+        """
+        return self._drag_flag
+    
+    def set_reset_flag(self, flag=True):
+        """
+        The derivative class sets the reset flag value to indicate that it
+        can be reset
+        """
+        self._reset_flag = flag
+        
+    def get_reset_flag(self):
+        """
+        Get the reset flag to update appropriately the tool bar
+        """
+        return self._reset_flag
+
+    def on_reset(self, event):
+        """
+        The derivative class state is restored
+        """
+    def on_drag(self, event):
+        """
+        The derivative class allows dragging motion if implemented
+        """
+    def on_preview(self, event):
+        """
+        Display a printable version of the class derivative
+        """
+    def on_save(self, event):
+        """
+        The state of the derivative class is restored
+        """
+    def on_redo(self, event):
+        """
+        The previous action is restored if possible
+        """
+    def on_undo(self, event):
+        """
+        The current action is canceled
+        """
+    def on_bookmark(self, event):
+        """
+        The derivative class is on bookmark mode if implemented
+        """
+    def on_zoom_in(self, event):
+        """
+        The derivative class is on zoom in mode if implemented
+        """
+    def on_zoom_out(self, event):
+        """
+        The derivative class is on zoom out mode if implemented
+        """
+    def on_zoom(self, event):
+        """
+        The derivative class is on zoom mode (using pane)
+        if zoom mode is implemented
+        """
+    def on_set_focus(self, event):
+        """
+        The  derivative class is on focus if implemented
+        """
+        
+   
Index: guiframe/plugin_base.py
===================================================================
--- guiframe/plugin_base.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
+++ guiframe/plugin_base.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
@@ -0,0 +1,141 @@
+################################################################################
+#This software was developed by the University of Tennessee as part of the
+#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+#project funded by the US National Science Foundation. 
+#
+#See the license text in license.txt
+#
+#copyright 2008, University of Tennessee
+################################################################################
+ 
+class PluginBase:
+    """
+    This class defines the interface for a Plugin class
+    that can be used by the gui_manager.
+    
+    Plug-ins should be placed in a sub-directory called "perspectives".
+    For example, a plug-in called Foo should be place in "perspectives/Foo".
+    That directory contains at least two files:
+        perspectives/Foo/__init__.py contains two lines:
+        
+            PLUGIN_ID = "Foo plug-in 1.0"
+            from Foo import *
+            
+        perspectives/Foo/Foo.py contains the definition of the Plugin
+        class for the Foo plug-in. The interface of that Plugin class
+        should follow the interface of the class you are looking at.
+        
+    See dummyapp.py for a plugin example.
+    """
+    
+    def __init__(self, name="Test_plugin", standalone=True):
+        """
+            Abstract class for gui_manager Plugins.
+        """
+        ## Plug-in name. It will appear on the application menu.
+        self.sub_menu = name     
+        #standalone flag
+        self.standalone = standalone
+        ## Reference to the parent window. Filled by get_panels() below.
+        self.parent = None
+        
+        ## List of panels that you would like to open in AUI windows
+        #  for your plug-in. This defines your plug-in "perspective"
+        self.perspective = []
+        
+        
+    def populate_menu(self, id, parent):
+        """
+        Create and return the list of application menu
+        items for the plug-in. 
+        
+        :param id: deprecated. Un-used.
+        :param parent: parent window
+        
+        :return: plug-in menu
+        
+        """
+        return []
+    
+    def get_panels(self, parent):
+        """
+        Create and return the list of wx.Panels for your plug-in.
+        Define the plug-in perspective.
+        
+        Panels should inherit from DefaultPanel defined below,
+        or should present the same interface. They must define
+        "window_caption" and "window_name".
+        
+        :param parent: parent window
+        
+        :return: list of panels
+        
+        """
+        ## Save a reference to the parent
+        self.parent = parent
+        
+        # Return the list of panels
+        return []
+    
+    def get_tools(self):
+        """
+        Returns a set of menu entries for tools
+        """
+        return []
+        
+    
+    def get_context_menu(self, graph=None):
+        """
+        This method is optional.
+    
+        When the context menu of a plot is rendered, the 
+        get_context_menu method will be called to give you a 
+        chance to add a menu item to the context menu.
+        
+        A ref to a Graph object is passed so that you can
+        investigate the plot content and decide whether you
+        need to add items to the context menu.  
+        
+        This method returns a list of menu items.
+        Each item is itself a list defining the text to 
+        appear in the menu, a tool-tip help text, and a
+        call-back method.
+        
+        :param graph: the Graph object to which we attach the context menu
+        
+        :return: a list of menu items with call-back function
+        
+        """
+        return []
+    
+    def get_perspective(self):
+        """
+        Get the list of panel names for this perspective
+        """
+        return self.perspective
+    
+    def on_perspective(self, event):
+        """
+        Call back function for the perspective menu item.
+        We notify the parent window that the perspective
+        has changed.
+        
+        :param event: menu event
+        
+        """
+        self.parent.set_perspective(self.perspective)
+    
+    def post_init(self):
+        """
+        Post initialization call back to close the loose ends
+        """
+        pass
+    
+    def set_default_perspective(self):
+        """
+       Call back method that True to notify the parent that the current plug-in
+       can be set as default  perspective.
+       when returning False, the plug-in is not candidate for an automatic 
+       default perspective setting
+        """
+        return False
Index: guiframe/statusbar.py
===================================================================
--- guiframe/statusbar.py	(revision 32c0841e02d6c59dd5e7872fdba98ea9afb790b9)
+++ guiframe/statusbar.py	(revision b5ca22392a8b926450a207ca7fb9c9bf296558e2)
@@ -246,5 +246,5 @@
         if type.lower() == "start":
             self.nb_start += 1
-            self.timer.Stop()
+            #self.timer.Stop()
             self.progress += 10
             self.gauge.SetValue(int(self.progress)) 
@@ -254,5 +254,5 @@
         if type.lower() == "progress":
             self.nb_progress += 1
-            self.timer.Start(100)
+            self.timer.Start(0)
             self.gauge.Pulse()
         if type.lower() == "update":
