summaryrefslogtreecommitdiff
path: root/lib/wx/doc/src/wxMenuBar.xml
blob: 0f4431dc3219446988c27c558c6887316fdd0bf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<!-- THIS FILE IS GENERATED DO NOT EDIT -->


<erlref>
<header>
  <copyright>
    <year>2020</year><year>2022</year>
    <holder>wxWidgets team.</holder></copyright>
  <legalnotice>Licensed under the wxWindows Free Documentation Licence, Version 3
  </legalnotice>
  <title>wxMenuBar</title>
</header>
<module>wxMenuBar</module>
<modulesummary>Functions for wxMenuBar class</modulesummary>
<description><p>A menu bar is a series of menus accessible from the top of a frame.
      </p><p>Remark: To respond to a menu selection, provide a handler for EVT_MENU, in the frame that contains the menu bar.
      </p><p> If you have a toolbar which uses the same identifiers as your EVT_MENU entries, events from the toolbar will also be processed by your EVT_MENU event handlers.
      </p><p>Tip: under Windows, if you discover that menu shortcuts (for example, Alt-F to show the file menu) are not working, check any EVT_CHAR events you are handling in child windows. If you are not calling event.Skip() for events that you don't process in these event handlers, menu shortcuts may cease to work.
      </p><p>See: <seeerl marker="wxMenu"><c>wxMenu</c></seeerl>, <url href="https://docs.wxwidgets.org/3.1/overview_events.html#overview_events">Overview events</url>
      </p>
  <p>This class is derived (and can use functions) from: 
    <seeerl marker="wxWindow"><c>wxWindow</c></seeerl> <seeerl marker="wxEvtHandler"><c>wxEvtHandler</c></seeerl></p>
  
  <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_menu_bar.html">wxMenuBar</url></p>
  </description>
<datatypes><datatype><name name="wxMenuBar"/></datatype></datatypes>

<funcs>
  <func>
    <name name="new" arity="0" clause_i="1" since=""/>
    <fsummary>Construct an empty menu bar. </fsummary>
    <desc><p>Construct an empty menu bar. 
      </p></desc>
  </func>
  
  <func>
    <name name="new" arity="1" clause_i="1" since=""/>
    <fsummary/>
    <desc/>
  </func>
  
  <func>
    <name name="destroy" arity="1" clause_i="1" since=""/>
    <fsummary>Destructor, destroying the menu bar and removing it from the parent frame (if any). </fsummary>
    <desc><p>Destructor, destroying the menu bar and removing it from the parent frame (if any). 
      </p></desc>
  </func>
  
  <func>
    <name name="append" arity="3" clause_i="1" since=""/>
    <fsummary>Adds the item to the end of the menu bar. </fsummary>
    <desc><p>Adds the item to the end of the menu bar. 
      </p><p>Return: true on success, false if an error occurred.
      </p><p>See: <seemfa marker="#insert/4"><c>insert/4</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="check" arity="3" clause_i="1" since=""/>
    <fsummary>Checks or unchecks a menu item. </fsummary>
    <desc><p>Checks or unchecks a menu item. 
      </p><p>Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the <seeerl marker="wxMenu"><c>wxMenu</c></seeerl> equivalent call. 
      </p></desc>
  </func>
  
  <func>
    <name name="enable" arity="3" clause_i="1" since=""/>
    <fsummary>Enables or disables (greys out) a menu item. </fsummary>
    <desc><p>Enables or disables (greys out) a menu item. 
      </p><p>Remark: Only use this when the menu bar has been associated with a frame; otherwise, use the <seeerl marker="wxMenu"><c>wxMenu</c></seeerl> equivalent call. 
      </p></desc>
  </func>
  
  <func>
    <name name="enableTop" arity="3" clause_i="1" since=""/>
    <fsummary>Enables or disables a whole menu. </fsummary>
    <desc><p>Enables or disables a whole menu. 
      </p><p>Remark: Only use this when the menu bar has been associated with a frame. 
      </p></desc>
  </func>
  
  <func>
    <name name="findMenu" arity="2" clause_i="1" since=""/>
    <fsummary>Returns the index of the menu with the given <c>title</c> or <c>wxNOT_FOUND</c> if no such menu exists in this menubar. </fsummary>
    <desc><p>Returns the index of the menu with the given <c>title</c> or <c>wxNOT_FOUND</c> if no such menu exists in this menubar. 
      </p><p>The <c>title</c> parameter may specify either the menu title (with accelerator characters, i.e. <c>"&amp;File"</c>) or just the menu label (<c>"File"</c>) indifferently. 
      </p></desc>
  </func>
  
  <func>
    <name name="findMenuItem" arity="3" clause_i="1" since=""/>
    <fsummary>Finds the menu item id for a menu name/menu item string pair. </fsummary>
    <desc><p>Finds the menu item id for a menu name/menu item string pair. 
      </p><p>Return: The menu item identifier, or wxNOT_FOUND if none was found.
      </p><p>Remark: Any special menu codes are stripped out of source and target strings before matching. 
      </p></desc>
  </func>
  
  <func>
    <name name="findItem" arity="2" clause_i="1" since=""/>
    <fsummary>Finds the menu item object associated with the given menu item identifier. </fsummary>
    <desc><p>Finds the menu item object associated with the given menu item identifier. 
      </p><p>Return: The found menu item object, or NULL if one was not found. 
      </p></desc>
  </func>
  
  <func>
    <name name="getHelpString" arity="2" clause_i="1" since=""/>
    <fsummary>Gets the help string associated with the menu item identifier. </fsummary>
    <desc><p>Gets the help string associated with the menu item identifier. 
      </p><p>Return: The help string, or the empty string if there was no help string or the menu item was not found.
      </p><p>See: <seemfa marker="#setHelpString/3"><c>setHelpString/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getLabel" arity="2" clause_i="1" since=""/>
    <fsummary>Gets the label associated with a menu item. </fsummary>
    <desc><p>Gets the label associated with a menu item. 
      </p><p>Return: The menu item label, or the empty string if the item was not found.
      </p><p>Remark: Use only after the menubar has been associated with a frame. 
      </p></desc>
  </func>
  
  <func>
    <name name="getLabelTop" arity="2" clause_i="1" since=""/>
    <fsummary>See: <c>getMenuLabel/2</c></fsummary>
    <desc><p>See: <seemfa marker="#getMenuLabel/2"><c>getMenuLabel/2</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="getMenuLabel" arity="2" clause_i="1" since=""/>
    <fsummary>Returns the label of a top-level menu. </fsummary>
    <desc><p>Returns the label of a top-level menu. 
      </p><p>Note that the returned string includes the accelerator characters that have been specified in the menu title string during its construction.
      </p><p>Return: The menu label, or the empty string if the menu was not found.
      </p><p>Remark: Use only after the menubar has been associated with a frame.
      </p><p>See: <seemfa marker="#getMenuLabelText/2"><c>getMenuLabelText/2</c></seemfa>, <seemfa marker="#setMenuLabel/3"><c>setMenuLabel/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getMenuLabelText" arity="2" clause_i="1" since=""/>
    <fsummary>Returns the label of a top-level menu. </fsummary>
    <desc><p>Returns the label of a top-level menu. 
      </p><p>Note that the returned string does not include any accelerator characters that may have been specified in the menu title string during its construction.
      </p><p>Return: The menu label, or the empty string if the menu was not found.
      </p><p>Remark: Use only after the menubar has been associated with a frame.
      </p><p>See: <seemfa marker="#getMenuLabel/2"><c>getMenuLabel/2</c></seemfa>, <seemfa marker="#setMenuLabel/3"><c>setMenuLabel/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="getMenu" arity="2" clause_i="1" since=""/>
    <fsummary>Returns the menu at <c>menuIndex</c> (zero-based). </fsummary>
    <desc><p>Returns the menu at <c>menuIndex</c> (zero-based). 
      </p></desc>
  </func>
  
  <func>
    <name name="getMenuCount" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the number of menus in this menubar. </fsummary>
    <desc><p>Returns the number of menus in this menubar. 
      </p></desc>
  </func>
  
  <func>
    <name name="insert" arity="4" clause_i="1" since=""/>
    <fsummary>Inserts the menu at the given position into the menu bar. </fsummary>
    <desc><p>Inserts the menu at the given position into the menu bar. 
      </p><p>Inserting menu at position 0 will insert it in the very beginning of it, inserting at position <seemfa marker="#getMenuCount/1"><c>getMenuCount/1</c></seemfa> is the same as calling <seemfa marker="#append/3"><c>append/3</c></seemfa>.
      </p><p>Return: true on success, false if an error occurred.
      </p><p>See: <seemfa marker="#append/3"><c>append/3</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="isChecked" arity="2" clause_i="1" since=""/>
    <fsummary>Determines whether an item is checked. </fsummary>
    <desc><p>Determines whether an item is checked. 
      </p><p>Return: true if the item was found and is checked, false otherwise. 
      </p></desc>
  </func>
  
  <func>
    <name name="setAutoWindowMenu" arity="1" clause_i="1" since=""/>
    <fsummary/>
    <desc/>
  </func>
  
  <func>
    <name name="getAutoWindowMenu" arity="0" clause_i="1" since=""/>
    <fsummary/>
    <desc/>
  </func>
  
  <func>
    <name name="oSXGetAppleMenu" arity="1" clause_i="1" since=""/>
    <fsummary>Returns the Apple menu. </fsummary>
    <desc><p>Returns the Apple menu. 
      </p><p>This is the leftmost menu with application's name as its title. You shouldn't remove any items from it, but it is safe to insert extra menu items or submenus into it.
      </p><p>Only for:wxosx</p><p>Since: 3.0.1 
      </p></desc>
  </func>
  
  <func>
    <name name="macGetCommonMenuBar" arity="0" clause_i="1" since=""/>
    <fsummary>Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open. </fsummary>
    <desc><p>Enables you to get the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open. 
      </p><p>Return: The global menubar.
      </p><p>Remark: Only exists on Mac, other platforms do not have this method.
      </p><p>Only for:wxosx</p></desc>
  </func>
  
  <func>
    <name name="macSetCommonMenuBar" arity="1" clause_i="1" since=""/>
    <fsummary>Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open. </fsummary>
    <desc><p>Enables you to set the global menubar on Mac, that is, the menubar displayed when the app is running without any frames open. 
      </p><p>Remark: Only exists on Mac, other platforms do not have this method.
      </p><p>Only for:wxosx</p></desc>
  </func>
  
  <func>
    <name name="isEnabled" arity="2" clause_i="1" since=""/>
    <fsummary>Determines whether an item is enabled. </fsummary>
    <desc><p>Determines whether an item is enabled. 
      </p><p>Return: true if the item was found and is enabled, false otherwise. 
      </p></desc>
  </func>
  
  <func>
    <name name="remove" arity="2" clause_i="1" since=""/>
    <fsummary>Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it. </fsummary>
    <desc><p>Removes the menu from the menu bar and returns the menu object - the caller is responsible for deleting it. 
      </p><p>This function may be used together with <seemfa marker="#insert/4"><c>insert/4</c></seemfa> to change the menubar dynamically.
      </p><p>See: <seemfa marker="#replace/4"><c>replace/4</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="replace" arity="4" clause_i="1" since=""/>
    <fsummary>Replaces the menu at the given position with another one. </fsummary>
    <desc><p>Replaces the menu at the given position with another one. 
      </p><p>Return: The menu which was previously at position pos. The caller is responsible for deleting it.
      </p><p>See: <seemfa marker="#insert/4"><c>insert/4</c></seemfa>, <seemfa marker="#remove/2"><c>remove/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setHelpString" arity="3" clause_i="1" since=""/>
    <fsummary>Sets the help string associated with a menu item. </fsummary>
    <desc><p>Sets the help string associated with a menu item. 
      </p><p>See: <seemfa marker="#getHelpString/2"><c>getHelpString/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setLabel" arity="3" clause_i="1" since=""/>
    <fsummary>Sets the label of a menu item. </fsummary>
    <desc><p>Sets the label of a menu item. 
      </p><p>Remark: Use only after the menubar has been associated with a frame.
      </p><p>See: <seemfa marker="#getLabel/2"><c>getLabel/2</c></seemfa>
      </p></desc>
  </func>
  
  <func>
    <name name="setLabelTop" arity="3" clause_i="1" since=""/>
    <fsummary>See: <c>setMenuLabel/3</c></fsummary>
    <desc><p>See: <seemfa marker="#setMenuLabel/3"><c>setMenuLabel/3</c></seemfa>.</p>
    </desc>
  </func>
  
  <func>
    <name name="setMenuLabel" arity="3" clause_i="1" since=""/>
    <fsummary>Sets the label of a top-level menu. </fsummary>
    <desc><p>Sets the label of a top-level menu. 
      </p><p>Remark: Use only after the menubar has been associated with a frame. 
      </p></desc>
  </func>
  </funcs>
</erlref>