From c0bfaf4104fc09ac0dfac069ce783d55ef48bca7 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Fri, 21 Aug 2020 23:29:08 +0100 Subject: [PATCH] Use new CanBeToggled function inside wxAuiToolBar where appropriate --- src/aui/auibar.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 6956e652cd..eacb77e7be 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -1546,7 +1546,7 @@ void wxAuiToolBar::ToggleTool(int tool_id, bool state) { wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool && (tool->m_kind == wxITEM_CHECK || tool->m_kind == wxITEM_RADIO)) + if ( tool && tool->CanBeToggled() ) { if (tool->m_kind == wxITEM_RADIO) { @@ -1587,13 +1587,8 @@ bool wxAuiToolBar::GetToolToggled(int tool_id) const { wxAuiToolBarItem* tool = FindTool(tool_id); - if (tool) - { - if ( (tool->m_kind != wxITEM_CHECK) && (tool->m_kind != wxITEM_RADIO) ) - return false; - + if ( tool && tool->CanBeToggled() ) return (tool->m_state & wxAUI_BUTTON_STATE_CHECKED) ? true : false; - } return false; }