From: Julian Smart Date: Sat, 11 Mar 2006 14:40:41 +0000 (+0000) Subject: Applied patch [ 1428990 ] wxUniv: patch for toolbar button remain in pressed status X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c4709ea55c2299c61ecda2ac350370f656de16ca Applied patch [ 1428990 ] wxUniv: patch for toolbar button remain in pressed status git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index bb134fe21f..a708a7cb74 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -649,6 +649,23 @@ bool wxToolBar::PerformAction(const wxControlAction& action, PerformAction( wxACTION_BUTTON_RELEASE, numArg ); PerformAction( wxACTION_BUTTON_CLICK, numArg ); + + // Write by Danny Raynor to change state again. + if( tool->IsToggled() ) + { + // Change toggle state to false + tool->Toggle(false); + } + + // 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 ) {