You should use EVT_UPDATE_UI(yourCommandID, yourEventHandler)
for checking/unchecking and enabling/disabling menu items.
In your UpdateUI event handler you should specify cases when your item is enabled
E.g. you have radiobutton group with commands ID_RADIO_1 and ID_RADIO_2 and they should be checked depending on condition bool m_SomeConditionVariable
then you should create 2 event handlers for them like
void OnRadio1UpdateUI(wxUpdateUIEvent & event)
{
event.Checked(m_SomeConditionVariable == true);
}
void OnRadio2UpdateUI(wxUpdateUIEvent & event)
{
event.Checked(m_SomeConditionVariable == false);
}
and in this case first radio item will be checked only when variable is false and second will be checked when variable is true.
You can use also calculated condition instaed of storing variable e.g.
void OnRadio2UpdateUI(wxUpdateUIEvent & event)
{
// Item will be enabled only when text control has non-empty value
event.Enabled(!m_SomeTextCtrl->GetValue().Trim().IsEmpty());
}