make sure the first item of a radio group is checked by default

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-23 17:40:43 +00:00
parent 02526cc9d2
commit 2e2ff9e8b0

View File

@@ -1127,6 +1127,8 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
// for now it has just one element // for now it has just one element
item->SetAsRadioGroupStart(); item->SetAsRadioGroupStart();
item->SetRadioGroupEnd(m_startRadioGroup); item->SetRadioGroupEnd(m_startRadioGroup);
wxMenuBase::DoAppend(item);
item->Check(true);
} }
else // extend the current radio group else // extend the current radio group
{ {
@@ -1142,16 +1144,15 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item)
{ {
wxFAIL_MSG( wxT("where is the radio group start item?") ); wxFAIL_MSG( wxT("where is the radio group start item?") );
} }
wxMenuBase::DoAppend(item);
} }
} }
else // not a radio item else // not a radio item
{ {
EndRadioGroup(); EndRadioGroup();
wxMenuBase::DoAppend(item);
} }
if ( !wxMenuBase::DoAppend(item) )
return NULL;
OnItemAdded(item); OnItemAdded(item);
return item; return item;