]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/toolbar.cpp
fixed python-related files names after they had been apparently renamed in the cvs...
[wxWidgets.git] / src / univ / toolbar.cpp
index bb134fe21fb9b138209144ecbf11e98e54833c98..a284182dd50cdff8f90db35b7b5ac7b555fefd36 100644 (file)
 
 #if wxUSE_TOOLBAR
 
+#include "wx/toolbar.h"
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/app.h"
+    #include "wx/log.h"
 #endif
 
 #include "wx/univ/renderer.h"
 
 #include "wx/frame.h"
-#include "wx/toolbar.h"
 #include "wx/image.h"
-#include "wx/log.h"
 
 // ----------------------------------------------------------------------------
 // constants
@@ -649,6 +650,17 @@ bool wxToolBar::PerformAction(const wxControlAction& action,
         PerformAction( wxACTION_BUTTON_RELEASE, numArg );
 
         PerformAction( wxACTION_BUTTON_CLICK, numArg );
+
+        // Write by Danny Raynor to change state again.
+        // Check button still pressed or not
+        if( tool->IsInverted() )
+        {
+            PerformAction( wxACTION_TOOLBAR_RELEASE, numArg );
+        }
+
+        // Set mouse leave toolbar button range (If still in the range,
+        // toolbar button would get focus again
+        PerformAction( wxACTION_TOOLBAR_LEAVE, numArg );
     }
     else if ( action == wxACTION_TOOLBAR_PRESS )
     {
@@ -871,4 +883,3 @@ bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer,
 }
 
 #endif // wxUSE_TOOLBAR
-