X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32b1391332e67af96856865ded257aacd6e1e956..7325e21c4fda06b0f4a2ea5fd72169bae06a0d19:/src/univ/toolbar.cpp diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index 187ed939bc..644763e888 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -18,10 +18,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "univtoolbar.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -31,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 @@ -132,7 +129,7 @@ private: // wxToolBar implementation // ============================================================================ -IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl); +IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl) // ---------------------------------------------------------------------------- // wxToolBar creation @@ -591,7 +588,7 @@ void wxToolBar::DoDraw(wxControlRenderer *renderer) if (tool->IsSeparator() && !HasFlag(wxTB_FLAT)) { - // Draw seperators only in flat mode + // Draw separators only in flat mode continue; } @@ -653,6 +650,22 @@ 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->CanBeToggled() && tool->IsToggled() ) + { + tool->Toggle(false); + } + + 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 ) { @@ -875,4 +888,3 @@ bool wxStdToolbarInputHandler::HandleActivation(wxInputConsumer *consumer, } #endif // wxUSE_TOOLBAR -