From 2e2ff9e8b02d8dd91255512ff5238ff2fd277369 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:40:43 +0000 Subject: [PATCH] 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 --- src/univ/menu.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index ed0c4a05a9..5142f45fab 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -1127,6 +1127,8 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) // for now it has just one element item->SetAsRadioGroupStart(); item->SetRadioGroupEnd(m_startRadioGroup); + wxMenuBase::DoAppend(item); + item->Check(true); } 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?") ); } + wxMenuBase::DoAppend(item); } } else // not a radio item { EndRadioGroup(); + wxMenuBase::DoAppend(item); } - if ( !wxMenuBase::DoAppend(item) ) - return NULL; - OnItemAdded(item); return item;