Index: guiframe/gui_manager.py
===================================================================
--- guiframe/gui_manager.py	(revision f036c692f54d10e88f06297560c534cf2520191b)
+++ guiframe/gui_manager.py	(revision a45037aaea7a183fd246884e3c1340d9e6d7fb7a)
@@ -38,5 +38,5 @@
 
 from sans.guiframe.events import EVT_STATUS
-from sans.guiframe.events import EVT_ADD_MANY_DATA
+from sans.guiframe.events import EVT_PANEL_ON_FOCUS
 from sans.guiframe.events import StatusEvent
 from sans.guiframe.events import NewPlotEvent
@@ -110,4 +110,5 @@
         self._applications_menu = None
         self._edit_menu = None
+        self._toolbar_menu = None
         #tool bar
         self._toolbar = None
@@ -141,5 +142,5 @@
         self.Bind(EVT_STATUS, self._on_status_event)
         #Register add extra data on the same panel event on load
-        self.Bind(EVT_ADD_MANY_DATA, self.set_panel_on_focus)
+        self.Bind(EVT_PANEL_ON_FOCUS, self.set_panel_on_focus)
         
     def set_panel_on_focus(self, event):
@@ -150,11 +151,14 @@
         """
         self.panel_on_focus = event.panel
+        panel_name = 'No panel on focus'
+        application_name = 'No Selected Application'
         if self.panel_on_focus is not None and self._data_panel is not None:
-            name = self.panel_on_focus.window_name
-            self._data_panel.set_panel_on_focus()
-            if self._toolbar is not None:
-                self.update_button(self.panel_on_focus)
-            #update edit menu
-            self.enable_edit_menu()
+            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()
+        print "set_panel_on_focus", event.panel.window_caption
             
     def build_gui(self):
@@ -179,5 +183,5 @@
         self.SetStatusBar(self.sb)
         # Add panel
-        default_flag = wx.aui.AUI_MGR_DEFAULT| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE
+        default_flag = wx.aui.AUI_MGR_DEFAULT#| wx.aui.AUI_MGR_ALLOW_ACTIVE_PANE
         self._mgr = wx.aui.AuiManager(self, flags=default_flag)
    
@@ -356,5 +360,6 @@
                               Name("default").
                               Center().
-                              CloseButton(True).
+                              CloseButton(False).
+                              MinimizeButton(False).
                               # This is where we set the size of
                               # the application window
@@ -374,5 +379,4 @@
         if style != GUIFRAME.MANAGER_ON:
             self._mgr.GetPane(self.panels["data_panel"].window_name).Hide()
-            print "manager_on"
         else:
             self._mgr.GetPane(self.panels["data_panel"].window_name).Show()
@@ -390,5 +394,8 @@
                     self._mgr.AddPane(p, wx.aui.AuiPaneInfo().
                                           Name(p.window_name).Caption(p.window_caption).
-                                           CenterPane().
+                                           #CenterPane().
+                                            Center().
+                                            CloseButton(False).
+                                            MinimizeButton(False).
                                            MinSize(wx.Size(w, h)).
                                            Hide())
@@ -508,9 +515,21 @@
         self._toolbar = GUIToolBar(self, -1)
         self.SetToolBar(self._toolbar)
-        self._toolbar.update_button()
+        self._update_toolbar_helper()
+        #self._on_hide_toolbar(event=None)
+    
+    def _update_toolbar_helper(self):
+        """
+        """
+        application_name = 'No Selected Application'
+        panel_name = 'No Panel on Focus'
+        self._toolbar.update_toolbar(self.panel_on_focus)
         if self._current_perspective is not None:
-            name = self._current_perspective.sub_menu
-            self._toolbar.set_active_perspective(name)
-          
+            application_name = self._current_perspective.sub_menu
+        if self.panel_on_focus is not None:
+            panel_name = self.panel_on_focus.window_caption
+        self._toolbar.update_button(application_name=application_name, 
+                                        panel_name=panel_name)
+        self._toolbar.Realize()
+        
     def _add_menu_tool(self):
         """
@@ -635,4 +654,9 @@
             wx.EVT_MENU(self, id, self.set_plotpanel_fixed)
             id = wx.NewId()
+            style1 = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS
+            if style1 == GUIFRAME.MULTIPLE_APPLICATIONS:
+                id = wx.NewId()
+                self._toolbar_menu = preferences_menu.Append(id,'&Hide Toolbar', '')
+                wx.EVT_MENU(self, id, self._on_hide_toolbar)
             self._window_menu.AppendSubMenu(preferences_menu,'&Preferences')
         if self._window_menu.GetMenuItemCount() == 0:
@@ -809,4 +833,20 @@
             self.show_data_panel(event=None)
                 
+    def _on_hide_toolbar(self, event=None):
+        """
+        hide or show toolbar
+        """
+        if self._toolbar is None:
+            return
+        if self._toolbar.IsShown():
+            if self._toolbar_menu is not None:
+                self._toolbar_menu.SetItemLabel('Show Toolbar')
+            self._toolbar.Hide()
+        else:
+            if self._toolbar_menu is not None:
+                self._toolbar_menu.SetItemLabel('Hide Toolbar')
+            self._toolbar.Show()
+        self._toolbar.Realize()
+        
     def _on_status_event(self, evt):
         """
@@ -1241,11 +1281,20 @@
         if self._current_perspective is not None:
             self._add_current_plugin_menu()
+            for panel in self.panels.values():
+                if hasattr(panel, 'CENTER_PANE') and panel.CENTER_PANE:
+                    for name in self._current_perspective.get_perspective():
+                        print "current",name.lower(),panel.window_name.lower(), name == panel.window_name
+                        if name == panel.window_name:
+                            panel.on_set_focus(event=None)
+                            print "panel", name,  panel.window_name,  panel.window_caption
+                            break
+                           
             name = self._current_perspective.sub_menu
             if self._data_panel is not None:
                 self._data_panel.set_active_perspective(name)
                 self._check_applications_menu()
-            #update tool bar
-            if self._toolbar is not None:
-                self._toolbar.set_active_perspective(name)
+            ##update tool bar
+            #if self._toolbar is not None:
+            #    self._update_toolbar_helper()
                 
     def _check_applications_menu(self):
@@ -1341,25 +1390,25 @@
         """
         if self.panel_on_focus is not None and self._edit_menu is not None:
-            flag = panel_on_focus.get_undo_flag()
+            flag = self.panel_on_focus.get_undo_flag()
             self._edit_menu.Enable(GUIFRAME_ID.UNDO_ID, flag)
-            flag = panel_on_focus.get_redo_flag()
+            flag = self.panel_on_focus.get_redo_flag()
             self._edit_menu.Enable(GUIFRAME_ID.REDO_ID, flag)
-            flag = panel_on_focus.get_bookmark_flag()
+            flag = self.panel_on_focus.get_bookmark_flag()
             self._edit_menu.Enable(GUIFRAME_ID.BOOKMARK_ID, flag)
-            flag = panel_on_focus.get_save_flag()
+            flag = self.panel_on_focus.get_save_flag()
             self._edit_menu.Enable(GUIFRAME_ID.SAVE_ID, flag)
-            flag = panel_on_focus.get_print_flag()
+            flag = self.panel_on_focus.get_print_flag()
             self._edit_menu.Enable(GUIFRAME_ID.PRINT_ID, flag)
-            flag = panel_on_focus.get_prieview_flag()
+            flag = self.panel_on_focus.get_preview_flag()
             self._edit_menu.Enable(GUIFRAME_ID.PREVIEW_ID, flag)
-            flag = panel_on_focus.get_zoom_flag()
+            flag = self.panel_on_focus.get_zoom_flag()
             self._edit_menu.Enable(GUIFRAME_ID.ZOOM_ID, flag)
-            flag = panel_on_focus.get_zoom_in_flag()
+            flag = self.panel_on_focus.get_zoom_in_flag()
             self._edit_menu.Enable(GUIFRAME_ID.ZOOM_IN_ID, flag)
-            flag = panel_on_focus.get_zoom_out_flag()
+            flag = self.panel_on_focus.get_zoom_out_flag()
             self._edit_menu.Enable(GUIFRAME_ID.ZOOM_OUT_ID, flag)
-            flag = panel_on_focus.get_drag_flag()
+            flag = self.panel_on_focus.get_drag_flag()
             self._edit_menu.Enable(GUIFRAME_ID.DRAG_ID, flag)
-            flag = panel_on_focus.get_reset_flag()
+            flag = self.panel_on_focus.get_reset_flag()
             self._edit_menu.Enable(GUIFRAME_ID.RESET_ID, flag)
         else:
Index: guiframe/gui_toolbar.py
===================================================================
--- guiframe/gui_toolbar.py	(revision f036c692f54d10e88f06297560c534cf2520191b)
+++ guiframe/gui_toolbar.py	(revision a45037aaea7a183fd246884e3c1340d9e6d7fb7a)
@@ -56,9 +56,14 @@
                                              size=tbar_size)
         self.AddLabelTool(GUIFRAME_ID.REDO_ID, 'Redo', redo_bmp,shortHelp='Redo')
-        self.button = wx.Button(self, -1, 'Welcome')
-        self.button.SetForegroundColour('black')
-        self.button.SetBackgroundColour('#1874CD')
-        #self.button.Disable()
-        self.AddControl(self.button)
+        #add button for the current application
+        self.button_application = wx.Button(self, -1, 'Welcome')
+        self.button_application.SetForegroundColour('black')
+        self.button_application.SetBackgroundColour('#1874CD')
+        self.AddControl(self.button_application)
+         #add button for the panel on focus
+        self.button_panel = wx.Button(self, -1, 'No Panel')
+        self.button_panel.SetForegroundColour('black')
+        self.button_panel.SetBackgroundColour('#90EE90')
+        self.AddControl(self.button_panel)
     
         self.SetToolBitmapSize(tbar_size)
@@ -92,10 +97,11 @@
                              id=GUIFRAME_ID.PRINT_ID)
             
-    def set_active_perspective(self, name=''):
+    def update_button(self, application_name='', panel_name=''):
         """
         """
-        self.button.SetLabel(str(name))
-        
-    def update_button(self, panel=None):
+        self.button_application.SetLabel(str(application_name))
+        self.button_panel.SetLabel(str(panel_name))
+        print "update_button", application_name, panel_name
+    def update_toolbar(self, panel=None):
         """
         """
Index: guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- guiframe/local_perspectives/plotting/Plotter1D.py	(revision 7a67e0752e5221b461eec94cb638d91520fb6545)
+++ guiframe/local_perspectives/plotting/Plotter1D.py	(revision a45037aaea7a183fd246884e3c1340d9e6d7fb7a)
@@ -28,5 +28,5 @@
 from sans.guiframe.events import ErrorDataEvent
 from sans.guiframe.events import RemoveDataEvent
-from sans.guiframe.events import AddManyDataEvent
+from sans.guiframe.events import PanelOnFocusEvent
 from sans.guiframe.events import EVT_NEW_LOADED_DATA
 from sans.guiframe.utils import PanelMenu
@@ -60,5 +60,5 @@
                  dpi=None, style=wx.NO_FULL_REPAINT_ON_RESIZE, **kwargs):
         PlotPanel.__init__(self, parent, id=id, style=style, **kwargs)
-        PanelBase.__init__(self)
+        PanelBase.__init__(self, parent)
         ## Reference to the parent window
         self.parent = parent
@@ -210,5 +210,5 @@
             
         #post nd event to notify guiframe that this panel is on focus
-        wx.PostEvent(self.parent, AddManyDataEvent(panel=self))
+        wx.PostEvent(self.parent, PanelOnFocusEvent(panel=self))
         
     def _onRemove(self, event):
Index: guiframe/panel_base.py
===================================================================
--- guiframe/panel_base.py	(revision f036c692f54d10e88f06297560c534cf2520191b)
+++ guiframe/panel_base.py	(revision a45037aaea7a183fd246884e3c1340d9e6d7fb7a)
@@ -11,4 +11,6 @@
 ################################################################################
 
+from sans.guiframe.events import PanelOnFocusEvent
+import wx
 
 class PanelBase:
@@ -24,5 +26,5 @@
     #CENTER_PANE = True
     
-    def __init__(self):
+    def __init__(self, parent=None):
         """
         Initialize some flag that Viewerframe used
@@ -42,5 +44,10 @@
         self._drag_flag = False
         self._reset_flag = False
-        
+        self.parent = parent
+        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 _set_print_flag(self, flag=True):
         """
@@ -49,4 +56,5 @@
         """
         self._print_flag = flag
+        self.on_set_focus(event=None)
     
     def get_print_flag(self):
@@ -62,5 +70,6 @@
         """
         self._undo_flag = flag
-        
+        self.on_set_focus(event=None)
+       
     def get_undo_flag(self):
         """
@@ -75,5 +84,6 @@
         """
         self._redo_flag = flag
-     
+        self.on_set_focus(event=None)
+    
     def get_redo_flag(self):
         """
@@ -81,4 +91,5 @@
         """
         return self._redo_flag
+    
     
     def _set_zoomed_in_flag(self, flag=True):
@@ -88,4 +99,6 @@
         """
         self._zoom_in_flag = flag
+        self.on_set_focus(event=None)
+
         
     def get_zoom_in_flag(self):
@@ -101,4 +114,5 @@
         """
         self._zoom_out_flag = flag
+        self.on_set_focus(event=None)
         
     def get_zoom_out_flag(self):
@@ -114,5 +128,6 @@
         """
         self._zoom_flag = flag
-        
+        self.on_set_focus(event=None)
+    
     def get_zoom_flag(self):
         """
@@ -127,5 +142,6 @@
         """
         self._bookmark_flag = flag
-        
+        self.on_set_focus(event=None)
+       
     def get_bookmark_flag(self):
         """
@@ -140,4 +156,5 @@
         """
         self._preview_flag = flag
+        self.on_set_focus(event=None)
         
     def get_preview_flag(self):
@@ -153,5 +170,6 @@
         """
         self._save_flag = flag
-        
+        self.on_set_focus(event=None)
+
     def get_save_flag(self):
         """
@@ -166,5 +184,5 @@
         """
         self._drag_flag = flag
-        
+       
     def get_drag_flag(self):
         """
@@ -179,5 +197,5 @@
         """
         self._reset_flag = flag
-        
+      
     def get_reset_flag(self):
         """
@@ -227,8 +245,11 @@
         if zoom mode is implemented
         """
-    def on_set_focus(self, event):
+    def on_set_focus(self, event=None):
         """
         The  derivative class is on focus if implemented
         """
+        if self.parent is not None:
+            print "on_set_focus", self.window_name, self.parent
+            wx.PostEvent(self.parent, PanelOnFocusEvent(panel=self))
         
     def get_data(self):
