X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a756f210019dd5b51331b7181c816d3882146a30..5d35dca95fed224817455e65e70f9f52ca3e293c:/src/msw/menuitem.cpp diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 0686c08269..cc38055c1f 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -72,11 +72,7 @@ // dynamic classes implementation // ---------------------------------------------------------------------------- -#if wxUSE_OWNER_DRAWN - IMPLEMENT_DYNAMIC_CLASS2(wxMenuItem, wxMenuItemBase, wxOwnerDrawn) -#else //!USE_OWNER_DRAWN - IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxMenuItemBase) -#endif //USE_OWNER_DRAWN +IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject) // ---------------------------------------------------------------------------- // wxMenuItem @@ -89,10 +85,11 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id, const wxString& text, const wxString& strHelp, - bool bCheckable, + wxItemKind kind, wxMenu *pSubMenu) + : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu) #if wxUSE_OWNER_DRAWN - : wxOwnerDrawn(GetLabelFromText(text), bCheckable) + , wxOwnerDrawn(GetLabelFromText(text), kind == wxItem_Check) #endif // owner drawn { wxASSERT_MSG( pParentMenu != NULL, wxT("a menu item should have a parent") ); @@ -112,15 +109,6 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, // tell the owner drawing code to to show the accel string as well SetAccelString(text.AfterFirst(_T('\t'))); #endif // wxUSE_OWNER_DRAWN - - m_parentMenu = pParentMenu; - m_subMenu = pSubMenu; - m_isEnabled = TRUE; - m_isChecked = FALSE; - m_id = id; - m_text = text; - m_isCheckable = bCheckable; - m_help = strHelp; } wxMenuItem::~wxMenuItem() @@ -174,7 +162,7 @@ void wxMenuItem::Enable(bool enable) void wxMenuItem::Check(bool check) { - wxCHECK_RET( m_isCheckable, wxT("only checkable items may be checked") ); + wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); if ( m_isChecked == check ) return; @@ -260,10 +248,10 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu, int id, const wxString& name, const wxString& help, - bool isCheckable, + wxItemKind kind, wxMenu *subMenu) { - return new wxMenuItem(parentMenu, id, name, help, isCheckable, subMenu); + return new wxMenuItem(parentMenu, id, name, help, kind, subMenu); } #endif // wxUSE_MENUS