]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/menuitem.tex
Typos in sizer docs.
[wxWidgets.git] / docs / latex / wx / menuitem.tex
CommitLineData
a660d684
KB
1\section{\class{wxMenuItem}}\label{wxmenuitem}
2
3A menu item represents an item in a popup menu. Note that the majority of this
4class is only implemented under Windows so far, but everything except fonts, colours and
5bitmaps can be achieved via wxMenu on all platforms.
6
7\wxheading{Derived from}
8
9wxOwnerDrawn (Windows only)\\
10\helpref{wxObject}{wxobject}
11
954b8ae6
JS
12\wxheading{Include files}
13
14<wx/menuitem.h>
15
a660d684
KB
16\wxheading{See also}
17
2432b92d 18\helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu}
a660d684
KB
19
20\latexignore{\rtfignore{\wxheading{Members}}}
21
22\membersection{wxMenuItem::wxMenuItem}\label{wxmenuitemconstr}
23
24\func{}{wxMenuItem}{\param{wxMenu*}{ parentMenu = NULL}, \param{int}{ id = ID\_SEPARATOR},
25 \param{const wxString\& }{text = ""}, \param{const wxString\& }{helpString = ""},
26 \param{bool }{checkable = FALSE}, \param{wxMenu*}{ subMenu = NULL}, }
27
28Constructs a wxMenuItem object.
29
30\wxheading{Parameters}
31
32\docparam{parentMenu}{Menu that the menu item belongs to.}
33
34\docparam{id}{Identifier for this menu item, or ID\_SEPARATOR to indicate a separator.}
35
36\docparam{text}{Text for the menu item, as shown on the menu.}
37
38\docparam{helpString}{Optional help string that will be shown on the status bar.}
39
40\docparam{checkable}{TRUE if this menu item is checkable.}
41
42\docparam{subMenu}{If non-NULL, indicates that the menu item is a submenu.}
43
44\membersection{wxMenuItem::\destruct{wxMenuItem}}
45
46\func{}{\destruct{wxMenuItem}}{\void}
47
48Destructor.
49
50\membersection{wxMenuItem::Check}\label{wxmenuitemcheck}
51
52\func{void}{Check}{\param{bool}{ check}}
53
54Checks or unchecks the menu item.
55
56\membersection{wxMenuItem::DeleteSubMenu}\label{wxmenuitemdeletesubmenu}
57
58\func{void}{DeleteSubMenu}{\void}
59
60Deletes the submenu, if any.
61
62\membersection{wxMenuItem::Enable}\label{wxmenuitemenable}
63
64\func{void}{Enable}{\param{bool}{ enable}}
65
66Enables or disables the menu item.
67
68\membersection{wxMenuItem::GetBackgroundColour}\label{wxmenuitemgetbackgroundcolour}
69
70\constfunc{wxColour\&}{GetBackgroundColour}{\void}
71
72Returns the background colour associated with the menu item (Windows only).
73
74\membersection{wxMenuItem::GetBitmap}\label{wxmenuitemgetbitmap}
75
76\constfunc{wxBitmap\&}{GetBitmap}{\param{bool}{ checked = TRUE}}
77
78Returns the checked or unchecked bitmap (Windows only).
79
80\membersection{wxMenuItem::GetFont}\label{wxmenuitemgetfont}
81
82\constfunc{wxFont\&}{GetFont}{\void}
83
84Returns the font associated with the menu item (Windows only).
85
86\membersection{wxMenuItem::GetHelp}\label{wxmenuitemgethelp}
87
88\constfunc{wxString}{GetHelp}{\void}
89
90Returns the help string associated with the menu item.
91
92\membersection{wxMenuItem::GetId}\label{wxmenuitemgetid}
93
94\constfunc{int}{GetId}{\void}
95
96Returns the menu item identifier.
97
98\membersection{wxMenuItem::GetMarginWidth}\label{wxmenuitemgetmarginwidth}
99
100\constfunc{int}{GetMarginWidth}{\void}
101
102Gets the width of the menu item checkmark bitmap (Windows only).
103
104\membersection{wxMenuItem::GetName}\label{wxmenuitemgetname}
105
106\constfunc{wxString}{GetName}{\void}
107
108Returns the text associated with the menu item.
109
110\membersection{wxMenuItem::GetSubMenu}\label{wxmenuitemgetsubmenu}
111
112\constfunc{wxMenu*}{GetSubMenu}{\void}
113
114Returns the submenu associated with the menu item, or NULL if there isn't one.
115
116\membersection{wxMenuItem::GetTextColour}\label{wxmenuitemgettextcolour}
117
118\constfunc{wxColour\&}{GetTextColour}{\void}
119
120Returns the text colour associated with the menu item (Windows only).
121
122\membersection{wxMenuItem::IsCheckable}\label{wxmenuitemischeckable}
123
124\constfunc{bool}{IsCheckable}{\void}
125
126Returns TRUE if the item is checkable.
127
128\membersection{wxMenuItem::IsChecked}\label{wxmenuitemischecked}
129
130\constfunc{bool}{IsChecked}{\void}
131
132Returns TRUE if the item is checked.
133
134\membersection{wxMenuItem::IsEnabled}\label{wxmenuitemisenabled}
135
136\constfunc{bool}{IsEnabled}{\void}
137
138Returns TRUE if the item is enabled.
139
140\membersection{wxMenuItem::IsSeparator}\label{wxmenuitemisseparator}
141
142\constfunc{bool}{IsSeparator}{\void}
143
144Returns TRUE if the item is a separator.
145
146\membersection{wxMenuItem::SetBackgroundColour}\label{wxmenuitemsetbackgroundcolour}
147
e14dccff 148\constfunc{void}{SetBackgroundColour}{\param{const wxColour\& }{colour}}
a660d684
KB
149
150Sets the background colour associated with the menu item (Windows only).
151
152\membersection{wxMenuItem::SetBitmaps}\label{wxmenuitemsetbitmaps}
153
e14dccff
KB
154\constfunc{void}{SetBitmaps}{\param{const wxBitmap\& }{checked},
155 \param{const wxBitmap\& }{unchecked = wxNullBitmap}}
a660d684
KB
156
157Sets the checked/unchecked bitmaps for the menu item (Windows only). The first bitmap
158is also used as the single bitmap for uncheckable menu items.
159
160\membersection{wxMenuItem::SetFont}\label{wxmenuitemsetfont}
161
e14dccff 162\constfunc{void}{SetFont}{\param{const wxFont\& }{font}}
a660d684
KB
163
164Sets the font associated with the menu item (Windows only).
165
166\membersection{wxMenuItem::SetHelp}\label{wxmenuitemsethelp}
167
e14dccff 168\constfunc{void}{SetHelp}{\param{const wxString\& }{helpString}}
a660d684
KB
169
170Sets the help string.
171
172\membersection{wxMenuItem::SetMarginWidth}\label{wxmenuitemsetmarginwidth}
173
174\constfunc{void}{SetMarginWidth}{\param{int}{ width}}
175
176Sets the width of the menu item checkmark bitmap (Windows only).
177
178\membersection{wxMenuItem::SetName}\label{wxmenuitemsetname}
179
e14dccff 180\constfunc{void}{SetName}{\param{const wxString\& }{text}}
a660d684
KB
181
182Sets the text associated with the menu item.
183
184\membersection{wxMenuItem::SetTextColour}\label{wxmenuitemsettextcolour}
185
e14dccff 186\constfunc{void}{SetTextColour}{\param{const wxColour\& }{colour}}
a660d684
KB
187
188Sets the text colour associated with the menu item (Windows only).
189
190
e14dccff
KB
191
192%%% Local Variables:
193%%% mode: latex
194%%% TeX-master: "referenc"
195%%% End: