X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/987da0d4116e93c1d326b29272c28ee9f989b87c..b58a1455e15477cac9d335b5f7a2c3fc3111b342:/src/os2/menuitem.cpp?ds=sidebyside diff --git a/src/os2/menuitem.cpp b/src/os2/menuitem.cpp index 6b4c37c65a..9b5bc2fed4 100644 --- a/src/os2/menuitem.cpp +++ b/src/os2/menuitem.cpp @@ -96,11 +96,7 @@ static wxString TextToLabel(const wxString& rTitle) // 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 @@ -114,11 +110,12 @@ wxMenuItem::wxMenuItem( , int nId , const wxString& rText , const wxString& rStrHelp -, bool bCheckable +, wxItemKind kind , wxMenu* pSubMenu ) +: wxMenuItemBase(pParentMenu, nId, rText, rStrHelp, kind, pSubMenu) #if wxUSE_OWNER_DRAWN -: wxOwnerDrawn( TextToLabel(rText) +, wxOwnerDrawn( TextToLabel(rText) ,bCheckable ) #endif // owner drawn @@ -130,7 +127,7 @@ wxMenuItem::wxMenuItem( // // Set default menu colors // - #define SYS_COLOR(c) (wxSystemSettings::GetSystemColour(wxSYS_COLOUR_##c)) + #define SYS_COLOR(c) (wxSystemSettings::GetColour(wxSYS_COLOUR_##c)) SetTextColour(SYS_COLOR(MENUTEXT)); SetBackgroundColour(SYS_COLOR(MENU)); @@ -143,14 +140,8 @@ wxMenuItem::wxMenuItem( #undef SYS_COLOR #endif // wxUSE_OWNER_DRAWN - m_parentMenu = pParentMenu; - m_subMenu = pSubMenu; - m_isEnabled = TRUE; - m_isChecked = FALSE; - m_id = nId; 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 @@ -240,7 +231,7 @@ void wxMenuItem::Check( { bool bOk; - wxCHECK_RET( m_isCheckable, wxT("only checkable items may be checked") ); + wxCHECK_RET( IsCheckable(), wxT("only checkable items may be checked") ); if (m_isChecked == bCheck) return; if (bCheck) @@ -363,7 +354,7 @@ wxMenuItem* wxMenuItemBase::New( , int nId , const wxString& rName , const wxString& rHelp -, bool bIsCheckable +, wxItemKind kind , wxMenu* pSubMenu ) { @@ -371,7 +362,7 @@ wxMenuItem* wxMenuItemBase::New( ,nId ,rName ,rHelp - ,bIsCheckable + ,kind ,pSubMenu ); } // end of wxMenuItemBase::New