X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32ceccf56fa2c1a7f580ca92dfe74e8e0ec6217c..b2458f311b426717c4d36b51aed2595a59f373d9:/src/univ/toolbar.cpp diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index 66e6b21623..644763e888 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" + #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 -