Index: lib/matplotlib/backend_bases.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/lib/matplotlib/backend_bases.py,v
retrieving revision 1.49
diff -u -r1.49 backend_bases.py
--- lib/matplotlib/backend_bases.py	2 May 2005 18:41:45 -0000	1.49
+++ lib/matplotlib/backend_bases.py	4 May 2005 19:30:13 -0000
@@ -901,6 +901,9 @@
       navigating
 
     * set_message (optional) - display message
+
+    * set_history_buttons (optional) - you can change the history 
+       back / forward buttons to indicate disabled / enabled state.
     
     That's it, we'll do the rest!
     """
@@ -920,6 +923,7 @@
         self._button_pressed = None # determined by the button pressed at start
 
         self.mode = ''  # a mode string for the status bar
+        self.set_history_buttons()
 
     def set_message(self, s):
         'display a message on toolbar or in status bar'
@@ -928,6 +932,7 @@
     def back(self, *args):
         'move back up the view lim stack'
         self._views.back()
+        self.set_history_buttons()
         self._update_view()
 
     def dynamic_update(self):
@@ -940,11 +945,13 @@
     def forward(self, *args):
         'move forward in the view lim stack'
         self._views.forward()
+        self.set_history_buttons()
         self._update_view()
 
     def home(self, *args):
         'restore the original view'
         self._views.home()
+        self.set_history_buttons()
         self._update_view()       
 
     def _init_toolbar(self):
@@ -1093,6 +1100,7 @@
             ymin, ymax = a.get_ylim()
             lims.append( (xmin, xmax, ymin, ymax) )
         self._views.push(lims)
+        self.set_history_buttons()
         
         
 
@@ -1313,6 +1321,7 @@
     def update(self):
         'reset the axes stack'
         self._views.clear()
+        self.set_history_buttons()
 
     def zoom(self, *args):
         'activate zoom to rect mode'
@@ -1335,3 +1344,10 @@
             self.mode = 'Zoom to rect mode'
 
         self.set_message(self.mode)
+
+
+    def set_history_buttons(self):
+        'enable or disable back/forward button'
+        pass
+
+
Index: lib/matplotlib/backends/backend_wx.py
===================================================================
RCS file: /cvsroot/matplotlib/matplotlib/lib/matplotlib/backends/backend_wx.py,v
retrieving revision 1.26
diff -u -r1.26 backend_wx.py
--- lib/matplotlib/backends/backend_wx.py	15 Apr 2005 16:02:16 -0000	1.26
+++ lib/matplotlib/backends/backend_wx.py	4 May 2005 19:30:13 -0000
@@ -1496,48 +1496,57 @@
 
         self._parent = self.canvas.GetParent()
         _NTB2_HOME    =wx.NewId()
-        _NTB2_BACK    =wx.NewId()
-        _NTB2_FORWARD =wx.NewId()
-        _NTB2_PAN     =wx.NewId()
-        _NTB2_ZOOM    =wx.NewId()
+        self._NTB2_BACK    =wx.NewId()
+        self._NTB2_FORWARD =wx.NewId()
+        self._NTB2_PAN     =wx.NewId()
+        self._NTB2_ZOOM    =wx.NewId()
         _NTB2_SAVE    =wx.NewId()
 
         self.SetToolBitmapSize(wx.Size(24,24))
 
         self.AddSimpleTool(_NTB2_HOME, _load_bitmap('home.xpm'),
-                           '', 'Reset original view')
-        self.AddSimpleTool(_NTB2_BACK, _load_bitmap('back.xpm'),
-                           '', 'Back navigation view')
-        self.AddSimpleTool(_NTB2_FORWARD, _load_bitmap('forward.xpm'),
-                           '', 'Forward navigation view')
+                           'Home', 'Reset original view')
+        self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.xpm'),
+                           'Back', 'Back navigation view')
+        self.AddSimpleTool(self._NTB2_FORWARD, _load_bitmap('forward.xpm'),
+                           'Forward', 'Forward navigation view')
         # todo: get new bitmap
-        self.AddSimpleTool(_NTB2_PAN, _load_bitmap('move.xpm'),
-                           '', 'Pan with left, zoom with right')
-        self.AddSimpleTool(_NTB2_ZOOM, _load_bitmap('zoom_to_rect.xpm'),
-                           '', 'Zoom to rectangle')
+        self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.xpm'),
+                           shortHelp='Pan', 
+                           longHelp='Pan with left, zoom with right')
+        self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.xpm'),
+                           shortHelp='Zoom', longHelp='Zoom to rectangle')
 
         self.AddSeparator()
         self.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.xpm'),
-                           '', 'Save plot contents to file')
+                           'Save', 'Save plot contents to file')
 
         if wx.VERSION_STRING >= '2.5':
             self.Bind(wx.EVT_TOOL, self.home, id=_NTB2_HOME)
-            self.Bind(wx.EVT_TOOL, self.forward, id=_NTB2_FORWARD)
-            self.Bind(wx.EVT_TOOL, self.back, id=_NTB2_BACK)
-            self.Bind(wx.EVT_TOOL, self.zoom, id=_NTB2_ZOOM)
-            self.Bind(wx.EVT_TOOL, self.pan, id=_NTB2_PAN)
+            self.Bind(wx.EVT_TOOL, self.forward, id=self._NTB2_FORWARD)
+            self.Bind(wx.EVT_TOOL, self.back, id=self._NTB2_BACK)
+            self.Bind(wx.EVT_TOOL, self.zoom, id=self._NTB2_ZOOM)
+            self.Bind(wx.EVT_TOOL, self.pan, id=self._NTB2_PAN)
             self.Bind(wx.EVT_TOOL, self.save, id=_NTB2_SAVE)
         else:
             wx.EVT_TOOL(self, _NTB2_HOME, self.home)
-            wx.EVT_TOOL(self, _NTB2_FORWARD, self.forward)
-            wx.EVT_TOOL(self, _NTB2_BACK, self.back)
-            wx.EVT_TOOL(self, _NTB2_ZOOM, self.zoom)
-            wx.EVT_TOOL(self, _NTB2_PAN, self.pan)
+            wx.EVT_TOOL(self, self._NTB2_FORWARD, self.forward)
+            wx.EVT_TOOL(self, self._NTB2_BACK, self.back)
+            wx.EVT_TOOL(self, self._NTB2_ZOOM, self.zoom)
+            wx.EVT_TOOL(self, self._NTB2_PAN, self.pan)
             wx.EVT_TOOL(self, _NTB2_SAVE, self.save)
 
         self.Realize()
 
 
+    def zoom(self, *args):
+        self.ToggleTool(self._NTB2_PAN, False)
+        NavigationToolbar2.zoom(self, *args)
+
+    def pan(self, *args):
+        self.ToggleTool(self._NTB2_ZOOM, False)
+        NavigationToolbar2.pan(self, *args)
+
     def save(self, evt):
         # Fetch the required filename and file type.
         filetypes = self.canvas._get_imagesave_wildcards()
@@ -1613,6 +1622,13 @@
     def set_message(self, s):
         if self.statbar is not None: self.statbar.set_function(s)
 
+    def set_history_buttons(self):
+        can_backward = (self._views._pos > 0)
+        can_forward = (self._views._pos < len(self._views._elements) - 1)
+        self.EnableTool(self._NTB2_BACK, can_backward)
+        self.EnableTool(self._NTB2_FORWARD, can_forward)
+
+
 class NavigationToolbarWx(wx.ToolBar):
     def __init__(self, canvas, can_kill=False):
         """
