Index: guiframe/events.py
===================================================================
--- guiframe/events.py	(revision 52b8b74ee4a07398ef3f87d25aa332dfba2e9656)
+++ guiframe/events.py	(revision 03314e7471e80689c0f7229fc1a95f0856155e0d)
@@ -24,5 +24,3 @@
 ##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 eec8dbbf952f11f78381509e5a455d82d09a0d45)
+++ guiframe/gui_manager.py	(revision 03314e7471e80689c0f7229fc1a95f0856155e0d)
@@ -149,6 +149,10 @@
         #Register add extra data on the same panel event on load
         self.Bind(EVT_PANEL_ON_FOCUS, self.set_panel_on_focus)
-        
-  
+    
+    def get_toolbar(self):
+        """
+        """
+        return self._toolbar
+    
     def set_panel_on_focus(self, event):
         """
@@ -163,8 +167,8 @@
             panel_name = self.panel_on_focus.window_caption
             self._data_panel.set_panel_on_focus(panel_name)
-        #update toolbar
-        self._update_toolbar_helper()
-        #update edit menu
-        self.enable_edit_menu()
+            #update toolbar
+            self._update_toolbar_helper()
+            #update edit menu
+            self.enable_edit_menu()
        
     def build_gui(self):
@@ -932,5 +936,5 @@
         return new_plot
  
-    def get_data(self, path, format=None):
+    def get_data(self, path):
         """
         """
@@ -949,51 +953,16 @@
                    message=log_msg, path=path)    
             return
-        try:
-            #reading a state file
-            for plug in self.plugins:
-                reader, ext = plug.get_extensions()
-                if reader is not None:
-                    #read the state of the single plugin
-                    if extension == ext:
-                        reader.read(path)
-                        return
-                    elif extension == '.svs':
-                        reader.read(path)
-        except:
-            raise
-                        
-    def load_update(self, output=None, message=""):
-        """
-        print update on the status bar
-        """
-        if message != "":
-            wx.PostEvent(self, StatusEvent(status=message,
-                                                  type="progress",
-                                                   info="warning"))
-        
-    def load_complete(self, output, message="", error_message="", 
-                      extension=None, path=None):
-        """
-         post message to  status bar and return list of data
-        """
-        wx.PostEvent(self, StatusEvent(status=message,
-                                              info="warning",
-                                              type="stop"))
-        if error_message != "":
-            self.load_error(error_message)
-        #send a list of available data to plotting plugin
-        available_data = []
-        if self._data_manager is not None:
-            self._data_manager.add_data(output)
-            temp = self._data_manager.get_selected_data()
-            for data_state in temp.values():
-                available_data.append(data_state.data)
+        
         #reading a state file
         for plug in self.plugins:
-            #plug.on_set_state_helper(event=None)
-            _, ext = plug.get_extensions()
-            plug.set_state(state=None, datainfo=available_data)
-            
-                
+            reader, ext = plug.get_extensions()
+            if reader is not None:
+                #read the state of the single plugin
+                if extension == ext:
+                    reader.read(path)
+                    return
+                elif extension == '.svs':
+                    reader.read(path)
+        
         style = self.__gui_style & GUIFRAME.MANAGER_ON
         if style == GUIFRAME.MANAGER_ON:
@@ -1002,5 +971,5 @@
                 self._data_panel.load_data_list(data_state)
                 self._mgr.GetPane(self._data_panel.window_name).Show(True)
-        
+                        
     def _on_open_state(self, event):
         """
@@ -1028,9 +997,8 @@
             if  basename.endswith('.svs'):
                 #remove panels for new states
-                for item in self.panels:
-                    try:
-                        self.panels[item].clear_panel()
-                    except:
-                        pass
+                for plug in self.plugins:
+                    plug.clear_panel()
+                    self.panel_on_focus = None
+                
             self.get_data(path)
                 
@@ -1579,4 +1547,81 @@
         if self.panel_on_focus is not None:
             self.panel_on_focus.on_reset(event)
+            
+    def enable_undo(self):
+        """
+        enable undo related control
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_undo(self.panel_on_focus)
+            
+    def enable_redo(self):
+        """
+        enable redo 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_redo(self.panel_on_focus)
+            
+    def enable_bookmark(self):
+        """
+        Bookmark 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_bookmark(self.panel_on_focus)
+            
+    def enable_save(self):
+        """
+        save 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_save(self.panel_on_focus)
+            
+    def enable_preview(self):
+        """
+        preview 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_preview(self.panel_on_focus)
+            
+    def enable_print(self):
+        """
+        print 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_print(self.panel_on_focus)
+            
+    def enable_zoom(self):
+        """
+        zoom 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_zoom(self.panel_on_focus)
+            
+    def enable_zoom_in(self):
+        """
+        zoom in 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_zoom_in(self.panel_on_focus)
+            
+    def enable_zoom_out(self):
+        """
+        zoom out 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_zoom_out(self.panel_on_focus)
+            
+    def enable_drag(self, event=None):
+        """
+        drag 
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_drag(self.panel_on_focus)
+            
+    def enable_reset(self):
+        """
+        reset the current panel
+        """
+        if self.panel_on_focus is not None:
+            self._toolbar.enable_reset(self.panel_on_focus)
         
 class DefaultPanel(wx.Panel, PanelBase):
Index: guiframe/gui_toolbar.py
===================================================================
--- guiframe/gui_toolbar.py	(revision 568658be488d4c608c7e8d8c998e91e4d8553972)
+++ guiframe/gui_toolbar.py	(revision 03314e7471e80689c0f7229fc1a95f0856155e0d)
@@ -196,5 +196,44 @@
             self.EnableTool(GUIFRAME_ID.RESET_ID, panel.get_reset_flag())
         self.Realize()
-  
+        
+    def enable_undo(self, panel):
+        self.EnableTool(GUIFRAME_ID.PRINT_ID, panel.get_print_flag())
+        self.Realize()
+        
+    def enable_redo(self, panel):
+        self.EnableTool(GUIFRAME_ID.REDO_ID, panel.get_redo_flag())
+        self.Realize()
+        
+    def enable_print(self, panel):
+        self.EnableTool(GUIFRAME_ID.PRINT_ID, panel.get_print_flag())
+        self.Realize()
+    
+    def enable_zoom(self, panel):
+        self.EnableTool(GUIFRAME_ID.ZOOM_ID, panel.get_zoom_flag())
+        self.Realize()
+        
+    def enable_zoom_in(self, panel):
+        self.EnableTool(GUIFRAME_ID.ZOOM_IN_ID, panel.get_zoom_in_flag())
+        self.Realize()
+        
+    def enable_zoom_out(self, panel):
+        self.EnableTool(GUIFRAME_ID.ZOOM_OUT_ID, panel.get_zoom_out_flag())
+        self.Realize()
+        
+    def enable_bookmark(self, panel):
+        self.EnableTool(GUIFRAME_ID.BOOKMARK_ID, panel.get_bookmark_flag())
+        self.Realize()
+        
+    def enable_save(self, panel):
+        self.EnableTool(GUIFRAME_ID.SAVE_ID, panel.get_save_flag())
+        self.Realize()
+        
+    def enable_reset(self, panel):
+        self.EnableTool(GUIFRAME_ID.RESET_ID, panel.get_reset_flag())
+        self.Realize()
+    
+    def enable_preview(self, panel):
+        self.EnableTool(GUIFRAME_ID.PREVIEW_ID, panel.get_preview_flag())
+        self.Realize()
 
               
Index: guiframe/panel_base.py
===================================================================
--- guiframe/panel_base.py	(revision d20771fbe8a96012eaffc3aa0b316a04593b74de)
+++ guiframe/panel_base.py	(revision 03314e7471e80689c0f7229fc1a95f0856155e0d)
@@ -10,4 +10,5 @@
 #copyright 2008, University of Tennessee
 ################################################################################
+
 
 from sans.guiframe.events import PanelOnFocusEvent
@@ -32,5 +33,5 @@
         #panel manager
         self._manager = None
-        
+        self.parent = parent
         self._print_flag = False
         self._undo_flag = False
@@ -44,10 +45,16 @@
         self._drag_flag = False
         self._reset_flag = False
-        self.parent = parent
+        self._has_changed = False
+        
         self.Bind(wx.EVT_LEFT_DOWN, self.on_set_focus)
         self.Bind(wx.EVT_TEXT_ENTER, self.on_set_focus)
         self.Bind(wx.EVT_MIDDLE_DOWN, self.on_set_focus)
         self.Bind(wx.EVT_RIGHT_DOWN, self.on_set_focus)
-
+        
+    def has_changed(self):
+        """
+        """
+        return self._has_changed
+            
     def _set_print_flag(self, flag=True):
         """
@@ -55,7 +62,12 @@
         be printed
         """
+        if flag == self._print_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._print_flag = flag
-        self.on_set_focus(event=None)
-    
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_print()
+     
     def get_print_flag(self):
         """
@@ -69,7 +81,12 @@
         current action done can be canceled
         """
+        if flag == self._undo_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._undo_flag = flag
-        self.on_set_focus(event=None)
-       
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_undo()
+      
     def get_undo_flag(self):
         """
@@ -83,7 +100,12 @@
         action done can be recovered
         """
+        if flag == self._redo_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._redo_flag = flag
-        self.on_set_focus(event=None)
-    
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_redo()
+      
     def get_redo_flag(self):
         """
@@ -91,5 +113,4 @@
         """
         return self._redo_flag
-    
     
     def _set_zoomed_in_flag(self, flag=True):
@@ -98,8 +119,12 @@
         can be zoomed in
         """
+        if self._zoom_in_flag == flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._zoom_in_flag = flag
-        self.on_set_focus(event=None)
-
-        
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_zoom_in()
+       
     def get_zoom_in_flag(self):
         """
@@ -113,6 +138,11 @@
         can be zoomed out
         """
+        if self._zoom_out_flag == flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._zoom_out_flag = flag
-        self.on_set_focus(event=None)
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_zoom_out()
         
     def get_zoom_out_flag(self):
@@ -127,7 +157,12 @@
         can be zoomed
         """
+        if flag == self._zoom_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._zoom_flag = flag
-        self.on_set_focus(event=None)
-    
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_zoom()
+     
     def get_zoom_flag(self):
         """
@@ -141,6 +176,11 @@
         can be bookmarked
         """
+        if flag == self._bookmark_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._bookmark_flag = flag
-        self.on_set_focus(event=None)
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_bookmark()
        
     def get_bookmark_flag(self):
@@ -155,7 +195,12 @@
         can be previewed
         """
+        if flag == self._preview_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._preview_flag = flag
-        self.on_set_focus(event=None)
-        
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_preview()
+       
     def get_preview_flag(self):
         """
@@ -169,6 +214,11 @@
         can be saved
         """
+        if flag == self._save_flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._save_flag = flag
-        self.on_set_focus(event=None)
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_save()
 
     def get_save_flag(self):
@@ -183,5 +233,11 @@
         dragging motion is possible
         """
+        if self._drag_flag == flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._drag_flag = flag
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_drag()
        
     def get_drag_flag(self):
@@ -196,5 +252,11 @@
         can be reset
         """
+        if self._reset_flag == flag:
+            self._has_changed = False
+            return
+        self._has_changed = True
         self._reset_flag = flag
+        if self._manager is not None and self._manager.parent is not None:
+            self._manager.parent.enable_reset()
       
     def get_reset_flag(self):
Index: guiframe/plugin_base.py
===================================================================
--- guiframe/plugin_base.py	(revision 75fbd1798f95ec58502a817f7435b1dfae03b69f)
+++ guiframe/plugin_base.py	(revision 03314e7471e80689c0f7229fc1a95f0856155e0d)
@@ -48,4 +48,8 @@
         self.perspective = []
         
+    def clear_panel(self):
+        """
+        clear all related panels
+        """
     def get_extensions(self):
         """
