]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/menuitem.tex
documented wxHashTable::DeleteContents(bool)
[wxWidgets.git] / docs / latex / wx / menuitem.tex
1 \section{\class{wxMenuItem}}\label{wxmenuitem}
2
3 A menu item represents an item in a popup menu. Note that the majority of this
4 class is only implemented under Windows so far, but everything except fonts, colours and
5 bitmaps can be achieved via wxMenu on all platforms.
6
7 \wxheading{Derived from}
8
9 wxOwnerDrawn (Windows only)\\
10 \helpref{wxObject}{wxobject}
11
12 \wxheading{Include files}
13
14 <wx/menuitem.h>
15
16 \wxheading{See also}
17
18 \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu}
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
28 Constructs 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
48 Destructor.
49
50 \membersection{wxMenuItem::Check}\label{wxmenuitemcheck}
51
52 \func{void}{Check}{\param{bool}{ check}}
53
54 Checks or unchecks the menu item.
55
56 \membersection{wxMenuItem::DeleteSubMenu}\label{wxmenuitemdeletesubmenu}
57
58 \func{void}{DeleteSubMenu}{\void}
59
60 Deletes the submenu, if any.
61
62 \membersection{wxMenuItem::Enable}\label{wxmenuitemenable}
63
64 \func{void}{Enable}{\param{bool}{ enable}}
65
66 Enables or disables the menu item.
67
68 \membersection{wxMenuItem::GetBackgroundColour}\label{wxmenuitemgetbackgroundcolour}
69
70 \constfunc{wxColour\&}{GetBackgroundColour}{\void}
71
72 Returns 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
78 Returns the checked or unchecked bitmap (Windows only).
79
80 \membersection{wxMenuItem::GetFont}\label{wxmenuitemgetfont}
81
82 \constfunc{wxFont\&}{GetFont}{\void}
83
84 Returns the font associated with the menu item (Windows only).
85
86 \membersection{wxMenuItem::GetHelp}\label{wxmenuitemgethelp}
87
88 \constfunc{wxString}{GetHelp}{\void}
89
90 Returns the help string associated with the menu item.
91
92 \membersection{wxMenuItem::GetId}\label{wxmenuitemgetid}
93
94 \constfunc{int}{GetId}{\void}
95
96 Returns the menu item identifier.
97
98 \membersection{wxMenuItem::GetLabel}\label{wxmenuitemgetlabel}
99
100 \constfunc{wxString}{GetLabel}{\void}
101
102 Returns the text associated with the menu item without any accelerator
103 characaters it might contain.
104
105 \wxheading{See also}
106
107 \helpref{GetText}{wxmenuitemgettext}
108
109 \membersection{wxMenuItem::GetMarginWidth}\label{wxmenuitemgetmarginwidth}
110
111 \constfunc{int}{GetMarginWidth}{\void}
112
113 Gets the width of the menu item checkmark bitmap (Windows only).
114
115 \membersection{wxMenuItem::GetName}\label{wxmenuitemgetname}
116
117 \constfunc{wxString}{GetName}{\void}
118
119 Returns the text associated with the menu item.
120
121 {\bf NB:} this function is deprecated, please use
122 \helpref{GetText}{wxmenuitemgettext} or \helpref{GetLabel}{wxmenuitemgetlabel}
123 instead.
124
125 \membersection{wxMenuItem::GetText}\label{wxmenuitemgettext}
126
127 \constfunc{wxString}{GetText}{\void}
128
129 Returns the text associated with the menu item, such as it was passed to the
130 wxMenuItem constructor, i.e. with any accelerator characters it may contain.
131
132 \wxheading{See also}
133
134 \helpref{GetLabel}{wxmenuitemgetlabel}
135
136 \membersection{wxMenuItem::GetSubMenu}\label{wxmenuitemgetsubmenu}
137
138 \constfunc{wxMenu*}{GetSubMenu}{\void}
139
140 Returns the submenu associated with the menu item, or NULL if there isn't one.
141
142 \membersection{wxMenuItem::GetTextColour}\label{wxmenuitemgettextcolour}
143
144 \constfunc{wxColour\&}{GetTextColour}{\void}
145
146 Returns the text colour associated with the menu item (Windows only).
147
148 \membersection{wxMenuItem::IsCheckable}\label{wxmenuitemischeckable}
149
150 \constfunc{bool}{IsCheckable}{\void}
151
152 Returns TRUE if the item is checkable.
153
154 \membersection{wxMenuItem::IsChecked}\label{wxmenuitemischecked}
155
156 \constfunc{bool}{IsChecked}{\void}
157
158 Returns TRUE if the item is checked.
159
160 \membersection{wxMenuItem::IsEnabled}\label{wxmenuitemisenabled}
161
162 \constfunc{bool}{IsEnabled}{\void}
163
164 Returns TRUE if the item is enabled.
165
166 \membersection{wxMenuItem::IsSeparator}\label{wxmenuitemisseparator}
167
168 \constfunc{bool}{IsSeparator}{\void}
169
170 Returns TRUE if the item is a separator.
171
172 \membersection{wxMenuItem::SetBackgroundColour}\label{wxmenuitemsetbackgroundcolour}
173
174 \constfunc{void}{SetBackgroundColour}{\param{const wxColour\& }{colour}}
175
176 Sets the background colour associated with the menu item (Windows only).
177
178 \membersection{wxMenuItem::SetBitmaps}\label{wxmenuitemsetbitmaps}
179
180 \constfunc{void}{SetBitmaps}{\param{const wxBitmap\& }{checked},
181 \param{const wxBitmap\& }{unchecked = wxNullBitmap}}
182
183 Sets the checked/unchecked bitmaps for the menu item (Windows only). The first bitmap
184 is also used as the single bitmap for uncheckable menu items.
185
186 \membersection{wxMenuItem::SetFont}\label{wxmenuitemsetfont}
187
188 \constfunc{void}{SetFont}{\param{const wxFont\& }{font}}
189
190 Sets the font associated with the menu item (Windows only).
191
192 \membersection{wxMenuItem::SetHelp}\label{wxmenuitemsethelp}
193
194 \constfunc{void}{SetHelp}{\param{const wxString\& }{helpString}}
195
196 Sets the help string.
197
198 \membersection{wxMenuItem::SetMarginWidth}\label{wxmenuitemsetmarginwidth}
199
200 \constfunc{void}{SetMarginWidth}{\param{int}{ width}}
201
202 Sets the width of the menu item checkmark bitmap (Windows only).
203
204 \membersection{wxMenuItem::SetName}\label{wxmenuitemsetname}
205
206 \constfunc{void}{SetName}{\param{const wxString\& }{text}}
207
208 Sets the text associated with the menu item.
209
210 \membersection{wxMenuItem::SetTextColour}\label{wxmenuitemsettextcolour}
211
212 \constfunc{void}{SetTextColour}{\param{const wxColour\& }{colour}}
213
214 Sets the text colour associated with the menu item (Windows only).
215
216
217
218 %%% Local Variables:
219 %%% mode: latex
220 %%% TeX-master: "referenc"
221 %%% End: