Make IsCheckable true by default and switch to explicitly disallowing it

Also add a new accessor to wxAuiToolBarItem to make it easier to
determine when a tool can be checked.
This commit is contained in:
Ian McInerney
2020-08-21 23:15:38 +01:00
parent 65e124bb64
commit afbb334a26
10 changed files with 28 additions and 17 deletions

View File

@@ -2891,12 +2891,11 @@ public:
m_setEnabled =
m_setShown =
m_setText =
m_setChecked =
m_isCheckable = false;
m_setChecked = false;
m_isCheckable = true;
}
wxUpdateUIEvent(const wxUpdateUIEvent& event)
: wxCommandEvent(event),
m_isCheckable(event.m_isCheckable),
m_checked(event.m_checked),
m_enabled(event.m_enabled),
m_shown(event.m_shown),
@@ -2904,6 +2903,7 @@ public:
m_setShown(event.m_setShown),
m_setText(event.m_setText),
m_setChecked(event.m_setChecked),
m_isCheckable(event.m_isCheckable),
m_text(event.m_text)
{ }
@@ -2921,9 +2921,9 @@ public:
void Show(bool show) { m_shown = show; m_setShown = true; }
void SetText(const wxString& text) { m_text = text; m_setText = true; }
// Set a flag saying if the object being updated supports the check action
// A flag saying if the item can be checked. True by default.
bool IsCheckable() const { return m_isCheckable; }
void SetIsCheckable(bool aCheckable) { m_isCheckable = aCheckable; }
void DisallowCheck() { m_isCheckable = false; }
// Sets the interval between updates in milliseconds.
// Set to -1 to disable updates, or to 0 to update as frequently as possible.
@@ -2950,7 +2950,6 @@ public:
virtual wxEvent *Clone() const wxOVERRIDE { return new wxUpdateUIEvent(*this); }
protected:
bool m_isCheckable;
bool m_checked;
bool m_enabled;
bool m_shown;
@@ -2958,6 +2957,7 @@ protected:
bool m_setShown;
bool m_setText;
bool m_setChecked;
bool m_isCheckable;
wxString m_text;
#if wxUSE_LONGLONG
static wxLongLong sm_lastUpdate;