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