]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/menuitem.h
Applied patch [ 619705 ] Fixes wxApp::GetComCtl32Version
[wxWidgets.git] / include / wx / os2 / menuitem.h
CommitLineData
0e320a79
DW
1///////////////////////////////////////////////////////////////////////////////
2// Name: menuitem.h
3// Purpose: wxMenuItem class
4// Author: Vadim Zeitlin
75f11ad7 5// Modified by:
0e320a79
DW
6// Created: 11.11.97
7// RCS-ID: $Id$
8// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
371a5b4e 9// Licence: wxWindows licence
0e320a79
DW
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _MENUITEM_H
13#define _MENUITEM_H
14
15#ifdef __GNUG__
16#pragma interface "menuitem.h"
17#endif
18
19// ----------------------------------------------------------------------------
20// headers
21// ----------------------------------------------------------------------------
22
23#include "wx/setup.h"
24
25// an exception to the general rule that a normal header doesn't include other
26// headers - only because ownerdrw.h is not always included and I don't want
27// to write #ifdef's everywhere...
28#if wxUSE_OWNER_DRAWN
75f11ad7 29 #include "wx/ownerdrw.h"
0e320a79
DW
30#endif
31
32// ----------------------------------------------------------------------------
33// constants
34// ----------------------------------------------------------------------------
35
0e320a79
DW
36// ----------------------------------------------------------------------------
37// wxMenuItem: an item in the menu, optionally implements owner-drawn behaviour
38// ----------------------------------------------------------------------------
e92f266c 39class WXDLLEXPORT wxMenuItem: public wxMenuItemBase
0e320a79
DW
40#if wxUSE_OWNER_DRAWN
41 , public wxOwnerDrawn
42#endif
43{
0e320a79 44public:
ab4fece8 45 //
e92f266c 46 // ctor & dtor
ab4fece8 47 //
22e90769 48 wxMenuItem( wxMenu* pParentMenu = NULL
4a277ceb 49 ,int nId = wxID_SEPARATOR
22e90769
DW
50 ,const wxString& rStrName = ""
51 ,const wxString& rWxHelp = ""
598d8cac 52 ,wxItemKind eKind = wxITEM_NORMAL
22e90769
DW
53 ,wxMenu* pSubMenu = NULL
54 );
ab4fece8
DW
55
56 //
57 // Depricated, do not use in new code
58 //
59 wxMenuItem( wxMenu* pParentMenu
60 ,int vId
61 ,const wxString& rsText
62 ,const wxString& rsHelp
63 ,bool bIsCheckable
64 ,wxMenu* pSubMenu = (wxMenu *)NULL
65 );
e92f266c 66 virtual ~wxMenuItem();
0e320a79 67
ab4fece8
DW
68 //
69 // Override base class virtuals
70 //
22e90769
DW
71 virtual void SetText(const wxString& rStrName);
72 virtual void SetCheckable(bool bCheckable);
0e320a79 73
e92f266c
DW
74 virtual void Enable(bool bDoEnable = TRUE);
75 virtual void Check(bool bDoCheck = TRUE);
22e90769 76 virtual bool IsChecked(void) const;
75f11ad7 77
ab4fece8
DW
78 //
79 // Unfortunately needed to resolve ambiguity between
e92f266c 80 // wxMenuItemBase::IsCheckable() and wxOwnerDrawn::IsCheckable()
ab4fece8 81 //
22e90769 82 bool IsCheckable(void) const { return wxMenuItemBase::IsCheckable(); }
0e320a79 83
ab4fece8
DW
84 //
85 // The id for a popup menu is really its menu handle (as required by
e92f266c
DW
86 // ::AppendMenu() API), so this function will return either the id or the
87 // menu handle depending on what we're
ab4fece8 88 //
22e90769 89 int GetRealId(void) const;
0e320a79 90
598d8cac
DW
91 //
92 // Mark item as belonging to the given radio group
93 //
ab4fece8
DW
94 void SetAsRadioGroupStart(void);
95 void SetRadioGroupStart(int nStart);
96 void SetRadioGroupEnd(int nEnd);
97
3e282d33
DW
98 //
99 // All OS/2PM Submenus and menus have one of these
100 //
101 MENUITEM m_vMenuData;
102
0e320a79 103private:
ab4fece8
DW
104 void Init();
105
106 //
107 // The positions of the first and last items of the radio group this item
108 // belongs to or -1: start is the radio group start and is valid for all
109 // but first radio group items (m_isRadioGroupStart == FALSE), end is valid
110 // only for the first one
111 //
112 union
113 {
114 int m_nStart;
115 int m_nEnd;
598d8cac
DW
116 } m_vRadioGroup;
117
118 //
119 // Does this item start a radio group?
120 //
ab4fece8 121 bool m_bIsRadioGroupStart;
598d8cac 122
e92f266c 123 DECLARE_DYNAMIC_CLASS(wxMenuItem)
22e90769 124}; // end of CLASS wxMenuItem
0e320a79
DW
125
126#endif //_MENUITEM_H