]> git.saurik.com Git - wxWidgets.git/blob - src/stubs/menuitem.cpp
Added facility to resize rows and cols by dragging grid lines.
[wxWidgets.git] / src / stubs / menuitem.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: menuitem.cpp
3 // Purpose: wxMenuItem implementation
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // headers & declarations
14 // ============================================================================
15
16 #include "wx/menu.h"
17 #include "wx/menuitem.h"
18
19 // ============================================================================
20 // implementation
21 // ============================================================================
22
23 // ----------------------------------------------------------------------------
24 // dynamic classes implementation
25 // ----------------------------------------------------------------------------
26
27 IMPLEMENT_DYNAMIC_CLASS(wxMenuItem, wxObject)
28
29 // ----------------------------------------------------------------------------
30 // wxMenuItem
31 // ----------------------------------------------------------------------------
32
33 // ctor & dtor
34 // -----------
35
36 wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id,
37 const wxString& strName, const wxString& strHelp,
38 bool bCheckable,
39 wxMenu *pSubMenu) :
40 m_bCheckable(bCheckable),
41 m_strName(strName),
42 m_strHelp(strHelp)
43 {
44 wxASSERT( pParentMenu != NULL );
45
46 m_pParentMenu = pParentMenu;
47 m_pSubMenu = pSubMenu;
48 m_idItem = id;
49 m_bEnabled = TRUE;
50 }
51
52 wxMenuItem::~wxMenuItem()
53 {
54 }
55
56 // misc
57 // ----
58
59 // delete the sub menu
60 void wxMenuItem::DeleteSubMenu()
61 {
62 wxASSERT( m_pSubMenu != NULL );
63
64 delete m_pSubMenu;
65 m_pSubMenu = NULL;
66 }
67
68 // change item state
69 // -----------------
70
71 void wxMenuItem::Enable(bool bDoEnable)
72 {
73 if ( m_bEnabled != bDoEnable ) {
74 if ( m_pSubMenu == NULL ) { // normal menu item
75 // TODO
76 }
77 else // submenu
78 {
79 // TODO
80 }
81
82 m_bEnabled = bDoEnable;
83 }
84 }
85
86 void wxMenuItem::Check(bool bDoCheck)
87 {
88 wxCHECK_RET( IsCheckable(), "only checkable items may be checked" );
89
90 if ( m_bChecked != bDoCheck ) {
91 // TODO
92 m_bChecked = bDoCheck;
93 }