X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8907154c1a8a6882c6797d1f16393ddfb23e7f3a..4362c7052b045f2ae743057d0fe8a17e053894cd:/src/univ/toolbar.cpp diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index d07923834e..a284182dd5 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -27,17 +27,18 @@ #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 @@ -128,7 +129,7 @@ private: // wxToolBar implementation // ============================================================================ -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl); +IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) // ---------------------------------------------------------------------------- // wxToolBar creation @@ -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 -