]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/toolbar.cpp
revert removal of gtk1 code from common file
[wxWidgets.git] / src / univ / toolbar.cpp
index 66e6b2162339b7b6289de47e4ba525c071fc0ec1..644763e88872a81968c3a205352b53111b879c77 100644 (file)
 
 #if wxUSE_TOOLBAR
 
+#include "wx/toolbar.h"
+
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
     #include "wx/app.h"
+    #include "wx/log.h"
+    #include "wx/frame.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,14 +650,19 @@ bool wxToolBar::PerformAction(const wxControlAction& action,
         PerformAction( wxACTION_BUTTON_RELEASE, numArg );
 
         PerformAction( wxACTION_BUTTON_CLICK, numArg );
-                        
-        // Write by Danny Raynor to change state again.                
+
+        // Write by Danny Raynor to change state again.
         // Check button still pressed or not
+        if ( tool->CanBeToggled() && tool->IsToggled() )
+        {
+            tool->Toggle(false);
+        }
+
         if( tool->IsInverted() )
-        {        
-            PerformAction( wxACTION_TOOLBAR_RELEASE, numArg );      
+        {
+            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 );
@@ -882,4 +888,3 @@ bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer,
 }
 
 #endif // wxUSE_TOOLBAR
-