diff --git a/include/wx/menuitem.h b/include/wx/menuitem.h index 7bc457673f..a7289a9e54 100644 --- a/include/wx/menuitem.h +++ b/include/wx/menuitem.h @@ -82,7 +82,13 @@ public: void SetKind(wxItemKind kind) { m_kind = kind; } bool IsSeparator() const { return m_kind == wxITEM_SEPARATOR; } - virtual void SetCheckable(bool checkable) { m_kind = checkable ? wxITEM_CHECK : wxITEM_NORMAL; } + bool IsCheck() const { return m_kind == wxITEM_CHECK; } + bool IsRadio() const { return m_kind == wxITEM_RADIO; } + + virtual void SetCheckable(bool checkable) + { m_kind = checkable ? wxITEM_CHECK : wxITEM_NORMAL; } + + // Notice that this doesn't quite match SetCheckable(). bool IsCheckable() const { return m_kind == wxITEM_CHECK || m_kind == wxITEM_RADIO; } diff --git a/interface/wx/menuitem.h b/interface/wx/menuitem.h index d659f74801..7317a32e0b 100644 --- a/interface/wx/menuitem.h +++ b/interface/wx/menuitem.h @@ -268,8 +268,21 @@ public: */ //@{ + /** + Returns @true if the item is a check item. + + Unlike IsCheckable() this doesn't return @true for the radio buttons. + + @since 2.9.5 + */ + bool IsCheck() const; + /** Returns @true if the item is checkable. + + Notice that the radio buttons are considered to be checkable as well, + so this method returns @true for them too. Use IsCheck() if you want to + test for the check items only. */ bool IsCheckable() const; @@ -283,6 +296,13 @@ public: */ virtual bool IsEnabled() const; + /** + Returns @true if the item is a radio button. + + @since 2.9.5 + */ + bool IsRadio() const; + /** Returns @true if the item is a separator. */