From 54b5a795511dc79e04a8c99c146423d88a9434c0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 26 Mar 2002 17:45:04 +0000 Subject: [PATCH] fixed compilation error git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/tbar95.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 9c0ec13209..13b388e509 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -833,20 +833,18 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id) // avoid sending the event when a radio button is released, this is not // interesting - if ( tool->CanBeToggled() && tool->GetKind() == wxITEM_RADIO && !toggled ) + if ( !tool->CanBeToggled() || tool->GetKind() != wxITEM_RADIO || toggled ) { - return; - } - - // OnLeftClick() can veto the button state change - for buttons which may - // be toggled only, of couse - if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() ) - { - // revert back - toggled = !toggled; - tool->SetToggle(toggled); + // OnLeftClick() can veto the button state change - for buttons which + // may be toggled only, of couse + if ( !OnLeftClick((int)id, toggled) && tool->CanBeToggled() ) + { + // revert back + toggled = !toggled; + tool->SetToggle(toggled); - ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0)); + ::SendMessage(GetHwnd(), TB_CHECKBUTTON, id, MAKELONG(toggled, 0)); + } } return TRUE; -- 2.45.2