]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/menuitem.cpp
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxMenuItem implementation
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
13 // headers & declarations
14 // ============================================================================
17 #include "wx/menuitem.h"
19 // ============================================================================
21 // ============================================================================
23 // ----------------------------------------------------------------------------
24 // dynamic classes implementation
25 // ----------------------------------------------------------------------------
27 #if !USE_SHARED_LIBRARY
28 IMPLEMENT_DYNAMIC_CLASS(wxMenuItem
, wxObject
)
29 #endif //USE_SHARED_LIBRARY
31 // ----------------------------------------------------------------------------
33 // ----------------------------------------------------------------------------
38 wxMenuItem::wxMenuItem(wxMenu
*pParentMenu
, int id
,
39 const wxString
& strName
, const wxString
& strHelp
,
42 m_bCheckable(bCheckable
),
46 wxASSERT( pParentMenu
!= NULL
);
48 m_pParentMenu
= pParentMenu
;
49 m_pSubMenu
= pSubMenu
;
54 wxMenuItem::~wxMenuItem()
61 // delete the sub menu
62 void wxMenuItem::DeleteSubMenu()
64 wxASSERT( m_pSubMenu
!= NULL
);
73 void wxMenuItem::Enable(bool bDoEnable
)
75 if ( m_bEnabled
!= bDoEnable
) {
76 if ( m_pSubMenu
== NULL
) { // normal menu item
84 m_bEnabled
= bDoEnable
;
88 void wxMenuItem::Check(bool bDoCheck
)
90 wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
92 if ( m_bChecked
!= bDoCheck
) {
94 m_bChecked
= bDoCheck
;