fix for r56618: toolbar event handlers can toggle or disable tools again (patch #10241)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1250,7 +1250,16 @@ bool wxToolBar::MSWCommand(WXUINT WXUNUSED(cmd), WXWORD id_)
|
|||||||
|
|
||||||
bool allowLeftClick = OnLeftClick(id, toggled);
|
bool allowLeftClick = OnLeftClick(id, toggled);
|
||||||
|
|
||||||
// restore the unpressed state
|
// Restore the unpressed state. Enabled/toggled state might have been
|
||||||
|
// changed since so take care of it.
|
||||||
|
if (tool->IsEnabled())
|
||||||
|
state |= TBSTATE_ENABLED;
|
||||||
|
else
|
||||||
|
state &= ~TBSTATE_ENABLED;
|
||||||
|
if (tool->IsToggled())
|
||||||
|
state |= TBSTATE_CHECKED;
|
||||||
|
else
|
||||||
|
state &= ~TBSTATE_CHECKED;
|
||||||
::SendMessage(GetHwnd(), TB_SETSTATE, id, MAKELONG(state, 0));
|
::SendMessage(GetHwnd(), TB_SETSTATE, id, MAKELONG(state, 0));
|
||||||
|
|
||||||
// OnLeftClick() can veto the button state change - for buttons which
|
// OnLeftClick() can veto the button state change - for buttons which
|
||||||
|
Reference in New Issue
Block a user