]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menuitem.cpp
compilation fix for FALSE -> wxItemKind conversion
[wxWidgets.git] / src / msw / menuitem.cpp
index 0686c08269a43e3b0422f594a2aa40df77d6fe7a..cc38055c1fe19934ba8c5bac5cc11f85258a10dc 100644 (file)
 // 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