Patch from OSAF that maintains radio button selection if Realize is recalled.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33335 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
770ddb3ff7
commit
730d336601
@ -875,7 +875,30 @@ bool wxToolBar::Realize()
|
||||
// radio items
|
||||
button.fsState |= TBSTATE_CHECKED;
|
||||
|
||||
tool->Toggle(true);
|
||||
if (tool->Toggle(true))
|
||||
{
|
||||
DoToggleTool(tool, true);
|
||||
}
|
||||
}
|
||||
else if (tool->IsToggled())
|
||||
{
|
||||
wxToolBarToolsList::compatibility_iterator nodePrev = node->GetPrevious();
|
||||
int prevIndex = i - 1;
|
||||
while ( nodePrev )
|
||||
{
|
||||
TBBUTTON& prevButton = buttons[prevIndex];
|
||||
wxToolBarToolBase *tool = nodePrev->GetData();
|
||||
if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO )
|
||||
break;
|
||||
|
||||
if ( tool->Toggle(false) )
|
||||
{
|
||||
DoToggleTool(tool, false);
|
||||
}
|
||||
prevButton.fsState = TBSTATE_ENABLED;
|
||||
nodePrev = nodePrev->GetPrevious();
|
||||
prevIndex--;
|
||||
}
|
||||
}
|
||||
|
||||
isRadio = true;
|
||||
|
Loading…
Reference in New Issue
Block a user