]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/toolbar.cpp
remove unneeded gdiobj.h files
[wxWidgets.git] / src / univ / toolbar.cpp
index d07923834ebff398ef85daba5724861ff5640ff3..66e6b2162339b7b6289de47e4ba525c071fc0ec1 100644 (file)
@@ -128,7 +128,7 @@ private:
 // wxToolBar implementation
 // ============================================================================
 
-IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl);
+IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
 
 // ----------------------------------------------------------------------------
 // wxToolBar creation
@@ -649,6 +649,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 )
     {