Merge branch 'updateui-ischeckable'

Add a flag to wxUpdateUIEvent to tell if the item supports the check
action.

See https://github.com/wxWidgets/wxWidgets/pull/2027
This commit is contained in:
Vadim Zeitlin
2020-09-02 19:34:05 +02:00
8 changed files with 53 additions and 7 deletions

View File

@@ -617,6 +617,9 @@ void wxMenuBase::UpdateUI(wxEvtHandler* source)
wxUpdateUIEvent event(itemid);
event.SetEventObject( this );
if ( !item->IsCheckable() )
event.DisallowCheck();
if ( source->ProcessEvent(event) )
{
// if anything changed, update the changed attribute

View File

@@ -739,6 +739,9 @@ void wxToolBarBase::UpdateWindowUI(long flags)
wxUpdateUIEvent event(toolid);
event.SetEventObject(this);
if ( !tool->CanBeToggled() )
event.DisallowCheck();
if ( evtHandler->ProcessEvent(event) )
{
if ( event.GetSetEnabled() )