]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/toolbar.cpp
Specify tree control in event table to avoid problems with stray tree events
[wxWidgets.git] / src / univ / toolbar.cpp
index c8ec9c1a209d65669b05f446158d8518d9485c19..74ff8b55e0effb50ad7093cf2572c97eeeba88ed 100644 (file)
@@ -18,7 +18,7 @@
 // headers
 // ----------------------------------------------------------------------------
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "univtoolbar.h"
 #endif
 
@@ -645,6 +645,8 @@ bool wxToolBar::PerformAction(const wxControlAction& action,
                               const wxString& strArg)
 {
     wxToolBarTool *tool = (wxToolBarTool*) FindById(numArg);
+    if (!tool)
+        return false;
     
     if ( action == wxACTION_TOOLBAR_TOGGLE )
     {
@@ -849,9 +851,9 @@ bool wxStdToolbarInputHandler::HandleMouseMove(wxInputConsumer *consumer,
 }
 
 bool wxStdToolbarInputHandler::HandleFocus(wxInputConsumer *consumer,
-                                           const wxFocusEvent& event)
+                                           const wxFocusEvent& WXUNUSED(event))
 {
-    if (m_toolCapture)
+    if ( m_toolCapture ) 
     {
         // We shouldn't be left with a highlighted button
         consumer->PerformAction( wxACTION_TOOLBAR_LEAVE, m_toolCapture->GetId() );