From 587151f730be88de8fcba82004c2bb93f8362342 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 May 2011 14:18:09 +0000 Subject: [PATCH] Reset the checked state of the first radio item in wxAuiToolBar too. Fix the condition of the loop in wxAuiToolBar::ToggleTool() to also uncheck the item with index 0 that was always excluded before because of "i > 0" check in the loop. Also exclude the item being turned on itself from the loops, it's useless to reset its checked state only to turn it on again below. Closes #11110. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index b79323d664..8715e6a456 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -1535,13 +1535,13 @@ void wxAuiToolBar::ToggleTool(int tool_id, bool state) if (idx >= 0 && idx < count) { - for (i = idx; i < count; ++i) + for (i = idx + 1; i < count; ++i) { if (m_items[i].kind != wxITEM_RADIO) break; m_items[i].state &= ~wxAUI_BUTTON_STATE_CHECKED; } - for (i = idx; i > 0; i--) + for (i = idx - 1; i >= 0; i--) { if (m_items[i].kind != wxITEM_RADIO) break; -- 2.45.2