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

@@ -407,6 +407,13 @@ public:
*/
int GetAlignment() const;
/**
Returns whether the toolbar item can be toggled.
@since 3.1.5
*/
bool CanBeToggled() const;
};
/**

View File

@@ -2374,6 +2374,26 @@ public:
*/
bool GetEnabled() const;
/**
Returns @true if the UI element can be checked.
For the event handlers that can be used for multiple items, not all of
which can be checked, this method can be useful to determine whether
to call Check() on the event object or not, i.e. the main use case for
this method is:
@code
void MyWindow::OnUpdateUI(wxUpdateUIEvent& event)
{
....
if ( event.IsCheckable() )
event.Check(...some condition...);
}
@endcode
@since 3.1.5
*/
bool IsCheckable() const;
/**
Static function returning a value specifying how wxWidgets will send update
events: to all windows, or only to those which specify that they will process