]>
git.saurik.com Git - wxWidgets.git/blob - src/stubs/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 IMPLEMENT_DYNAMIC_CLASS(wxMenuItem
, wxObject
)
29 // ----------------------------------------------------------------------------
31 // ----------------------------------------------------------------------------
36 wxMenuItem::wxMenuItem(wxMenu
*pParentMenu
, int id
,
37 const wxString
& strName
, const wxString
& strHelp
,
40 m_bCheckable(bCheckable
),
44 wxASSERT( pParentMenu
!= NULL
);
46 m_pParentMenu
= pParentMenu
;
47 m_pSubMenu
= pSubMenu
;
52 wxMenuItem::~wxMenuItem()
59 // delete the sub menu
60 void wxMenuItem::DeleteSubMenu()
62 wxASSERT( m_pSubMenu
!= NULL
);
71 void wxMenuItem::Enable(bool bDoEnable
)
73 if ( m_bEnabled
!= bDoEnable
) {
74 if ( m_pSubMenu
== NULL
) { // normal menu item
82 m_bEnabled
= bDoEnable
;
86 void wxMenuItem::Check(bool bDoCheck
)
88 wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
90 if ( m_bChecked
!= bDoCheck
) {
92 m_bChecked
= bDoCheck
;