]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/menuitem.cpp
added missing return on error
[wxWidgets.git] / src / os2 / menuitem.cpp
index af97aab35a6613c776d1a4536afaa0c79e7e2052..1d960c605b06481777659b18c361ac97594d075d 100644 (file)
@@ -155,6 +155,8 @@ wxMenuItem::wxMenuItem(
     m_text        = TextToLabel(rText);
     m_isCheckable = bCheckable;
     m_help        = rStrHelp;
+    memset(&m_vMenuData, '\0', sizeof(m_vMenuData));
+    m_vMenuData.id= nId;
 } // end of wxMenuItem::wxMenuItem
 
 wxMenuItem::~wxMenuItem()
@@ -233,13 +235,13 @@ void wxMenuItem::Enable(
         bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu)
                                  ,MM_SETITEMATTR
                                  ,MPFROM2SHORT(GetRealId(), TRUE)
-                                 ,MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED)
+                                 ,MPFROM2SHORT(MIA_DISABLED, FALSE)
                                 );
     else
         bOk = (bool)::WinSendMsg( GetHMenuOf(m_parentMenu)
                                  ,MM_SETITEMATTR
                                  ,MPFROM2SHORT(GetRealId(), TRUE)
-                                 ,MPFROM2SHORT(MIA_DISABLED, FALSE)
+                                 ,MPFROM2SHORT(MIA_DISABLED, MIA_DISABLED)
                                 );
     if (!bOk)
     {
@@ -271,7 +273,7 @@ void wxMenuItem::Check(
                                 );
     if (!bOk)
     {
-        wxLogLastError("EnableMenuItem");
+        wxLogLastError("CheckMenuItem");
     }
     wxMenuItemBase::Check(bCheck);
 } // end of wxMenuItem::Check