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:
@@ -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
|
||||
|
||||
@@ -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() )
|
||||
|
||||
Reference in New Issue
Block a user