4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
18
%% This file is generated DO NOT EDIT
20
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html">wxMenu</a>.
21
%% <p>This class is derived (and can use functions) from:
22
%% <br />{@link wxEvtHandler}
24
%% @type wxMenu(). An object reference, The representation is internal
25
%% and can be changed without notice. It can't be used for comparsion
26
%% stored on disc or distributed for use on other nodes.
30
-export(['Destroy'/2,append/2,append/3,append/4,append/5,appendCheckItem/3,appendCheckItem/4,
31
appendRadioItem/3,appendRadioItem/4,appendSeparator/1,break/1,check/3,
32
delete/2,destroy/1,enable/3,findItem/2,findItemByPosition/2,getHelpString/2,
33
getLabel/2,getMenuItemCount/1,getMenuItems/1,getTitle/1,insert/3,insert/4,
34
insert/5,insert/6,insertCheckItem/4,insertCheckItem/5,insertRadioItem/4,
35
insertRadioItem/5,insertSeparator/2,isChecked/2,isEnabled/2,new/0,
36
new/1,new/2,prepend/2,prepend/3,prepend/4,prepend/5,prependCheckItem/3,
37
prependCheckItem/4,prependRadioItem/3,prependRadioItem/4,prependSeparator/1,
38
remove/2,setHelpString/3,setLabel/3,setTitle/2]).
41
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
44
parent_class(wxEvtHandler) -> true;
45
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
47
%% @spec () -> wxMenu()
52
%% @spec ([Option]) -> wxMenu()
53
%% Option = {style, integer()}
54
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuwxmenu">external documentation</a>.
56
when is_list(Options) ->
57
MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc];
58
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
59
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
60
wxe_util:construct(?wxMenu_new_1,
63
%% @spec (Title::string(), [Option]) -> wxMenu()
64
%% Option = {style, integer()}
65
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuwxmenu">external documentation</a>.
67
when is_list(Title),is_list(Options) ->
68
Title_UC = unicode:characters_to_binary([Title,0]),
69
MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc];
70
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
71
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
72
wxe_util:construct(?wxMenu_new_2,
73
<<(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((4+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
75
%% @spec (This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem()
76
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappend">external documentation</a>.
77
append(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
79
?CLASS(ItemT,wxMenuItem),
80
wxe_util:call(?wxMenu_Append_1,
81
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
83
%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
84
%% @equiv append(This,Itemid,Text, [])
85
append(This,Itemid,Text)
86
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
87
append(This,Itemid,Text, []).
89
%% @spec (This::wxMenu(),Itemid::integer(),Text::string(),X::wxMenu()|term()) -> wxMenuItem:wxMenuItem()
90
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappend">external documentation</a>.
91
%% <br /> Alternatives:
93
%% append(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> append(This,Itemid,Text,Submenu, []) </c></p>
95
%% append(This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem() </c>
96
%%<br /> Option = {help, string()} | {kind, WxItemKind}
97
%%<br /> WxItemKind = integer()
98
%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
101
append(This,Itemid,Text,Submenu)
102
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) ->
103
append(This,Itemid,Text,Submenu, []);
104
append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
105
when is_integer(Itemid),is_list(Text),is_list(Options) ->
106
?CLASS(ThisT,wxMenu),
107
Text_UC = unicode:characters_to_binary([Text,0]),
108
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
109
({kind, Kind}, Acc) -> [<<2:32/?UI,Kind:32/?UI>>|Acc];
110
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
111
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
112
wxe_util:call(?wxMenu_Append_3,
113
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
115
%% @spec (This::wxMenu(),Itemid::integer(),Text::string(),X::string()|wxMenu(),X::bool()|term()) -> ok|wxMenuItem:wxMenuItem()
116
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappend">external documentation</a>.
117
%% <br /> Alternatives:
119
%% append(This::wxMenu(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
122
%% append(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
123
%%<br /> Option = {help, string()}
125
append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,Help,IsCheckable)
126
when is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) ->
127
?CLASS(ThisT,wxMenu),
128
Text_UC = unicode:characters_to_binary([Text,0]),
129
Help_UC = unicode:characters_to_binary([Help,0]),
130
wxe_util:cast(?wxMenu_Append_4_0,
131
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((4+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(IsCheckable)):32/?UI>>);
132
append(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=SubmenuRef}, Options)
133
when is_integer(Itemid),is_list(Text),is_list(Options) ->
134
?CLASS(ThisT,wxMenu),
135
Text_UC = unicode:characters_to_binary([Text,0]),
136
?CLASS(SubmenuT,wxMenu),
137
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
138
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
139
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
140
wxe_util:call(?wxMenu_Append_4_1,
141
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,SubmenuRef:32/?UI, 0:32,BinOpt/binary>>).
143
%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
144
%% @equiv appendCheckItem(This,Itemid,Text, [])
145
appendCheckItem(This,Itemid,Text)
146
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
147
appendCheckItem(This,Itemid,Text, []).
149
%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
150
%% Option = {help, string()}
151
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappendcheckitem">external documentation</a>.
152
appendCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
153
when is_integer(Itemid),is_list(Text),is_list(Options) ->
154
?CLASS(ThisT,wxMenu),
155
Text_UC = unicode:characters_to_binary([Text,0]),
156
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
157
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
158
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
159
wxe_util:call(?wxMenu_AppendCheckItem,
160
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
162
%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
163
%% @equiv appendRadioItem(This,Itemid,Text, [])
164
appendRadioItem(This,Itemid,Text)
165
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
166
appendRadioItem(This,Itemid,Text, []).
168
%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
169
%% Option = {help, string()}
170
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappendradioitem">external documentation</a>.
171
appendRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
172
when is_integer(Itemid),is_list(Text),is_list(Options) ->
173
?CLASS(ThisT,wxMenu),
174
Text_UC = unicode:characters_to_binary([Text,0]),
175
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
176
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
177
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
178
wxe_util:call(?wxMenu_AppendRadioItem,
179
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
181
%% @spec (This::wxMenu()) -> wxMenuItem:wxMenuItem()
182
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuappendseparator">external documentation</a>.
183
appendSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
184
?CLASS(ThisT,wxMenu),
185
wxe_util:call(?wxMenu_AppendSeparator,
188
%% @spec (This::wxMenu()) -> ok
189
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenubreak">external documentation</a>.
190
break(#wx_ref{type=ThisT,ref=ThisRef}) ->
191
?CLASS(ThisT,wxMenu),
192
wxe_util:cast(?wxMenu_Break,
195
%% @spec (This::wxMenu(), Itemid::integer(), Check::bool()) -> ok
196
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenucheck">external documentation</a>.
197
check(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Check)
198
when is_integer(Itemid),is_boolean(Check) ->
199
?CLASS(ThisT,wxMenu),
200
wxe_util:cast(?wxMenu_Check,
201
<<ThisRef:32/?UI,Itemid:32/?UI,(wxe_util:from_bool(Check)):32/?UI>>).
203
%% @spec (This::wxMenu(),X::integer()|term()) -> bool()
204
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenudelete">external documentation</a>.
205
%% <br /> Alternatives:
207
%% delete(This::wxMenu(), Itemid::integer()) -> bool() </c>
210
%% delete(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> bool() </c>
212
delete(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
213
when is_integer(Itemid) ->
214
?CLASS(ThisT,wxMenu),
215
wxe_util:call(?wxMenu_Delete_1_0,
216
<<ThisRef:32/?UI,Itemid:32/?UI>>);
217
delete(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
218
?CLASS(ThisT,wxMenu),
219
?CLASS(ItemT,wxMenuItem),
220
wxe_util:call(?wxMenu_Delete_1_1,
221
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
223
%% @spec (This::wxMenu(),X::integer()|term()) -> bool()
224
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenudestroy">external documentation</a>.
225
%% <br /> Alternatives:
227
%% 'Destroy'(This::wxMenu(), Itemid::integer()) -> bool() </c>
230
%% 'Destroy'(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> bool() </c>
232
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
233
when is_integer(Itemid) ->
234
?CLASS(ThisT,wxMenu),
235
wxe_util:call(?wxMenu_Destroy_1_0,
236
<<ThisRef:32/?UI,Itemid:32/?UI>>);
237
'Destroy'(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
238
?CLASS(ThisT,wxMenu),
239
?CLASS(ItemT,wxMenuItem),
240
wxe_util:call(?wxMenu_Destroy_1_1,
241
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
243
%% @spec (This::wxMenu(), Itemid::integer(), Enable::bool()) -> ok
244
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuenable">external documentation</a>.
245
enable(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Enable)
246
when is_integer(Itemid),is_boolean(Enable) ->
247
?CLASS(ThisT,wxMenu),
248
wxe_util:cast(?wxMenu_Enable,
249
<<ThisRef:32/?UI,Itemid:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>).
251
%% @spec (This::wxMenu(),X::integer()|string()) -> wxMenuItem:wxMenuItem()|integer()
252
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenufinditem">external documentation</a>.
253
%% <br /> Alternatives:
255
%% findItem(This::wxMenu(), Itemid::integer()) -> wxMenuItem:wxMenuItem() </c>
258
%% findItem(This::wxMenu(), Item::string()) -> integer() </c>
260
findItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
261
when is_integer(Itemid) ->
262
?CLASS(ThisT,wxMenu),
263
wxe_util:call(?wxMenu_FindItem_2,
264
<<ThisRef:32/?UI,Itemid:32/?UI>>);
265
findItem(#wx_ref{type=ThisT,ref=ThisRef},Item)
266
when is_list(Item) ->
267
?CLASS(ThisT,wxMenu),
268
Item_UC = unicode:characters_to_binary([Item,0]),
269
wxe_util:call(?wxMenu_FindItem_1,
270
<<ThisRef:32/?UI,(byte_size(Item_UC)):32/?UI,(Item_UC)/binary, 0:(((8- ((0+byte_size(Item_UC)) band 16#7)) band 16#7))/unit:8>>).
272
%% @spec (This::wxMenu(), Position::integer()) -> wxMenuItem:wxMenuItem()
273
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenufinditembyposition">external documentation</a>.
274
findItemByPosition(#wx_ref{type=ThisT,ref=ThisRef},Position)
275
when is_integer(Position) ->
276
?CLASS(ThisT,wxMenu),
277
wxe_util:call(?wxMenu_FindItemByPosition,
278
<<ThisRef:32/?UI,Position:32/?UI>>).
280
%% @spec (This::wxMenu(), Itemid::integer()) -> string()
281
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugethelpstring">external documentation</a>.
282
getHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
283
when is_integer(Itemid) ->
284
?CLASS(ThisT,wxMenu),
285
wxe_util:call(?wxMenu_GetHelpString,
286
<<ThisRef:32/?UI,Itemid:32/?UI>>).
288
%% @spec (This::wxMenu(), Itemid::integer()) -> string()
289
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugetlabel">external documentation</a>.
290
getLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
291
when is_integer(Itemid) ->
292
?CLASS(ThisT,wxMenu),
293
wxe_util:call(?wxMenu_GetLabel,
294
<<ThisRef:32/?UI,Itemid:32/?UI>>).
296
%% @spec (This::wxMenu()) -> integer()
297
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugetmenuitemcount">external documentation</a>.
298
getMenuItemCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
299
?CLASS(ThisT,wxMenu),
300
wxe_util:call(?wxMenu_GetMenuItemCount,
303
%% @spec (This::wxMenu()) -> [wxMenuItem:wxMenuItem()]
304
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugetmenuitems">external documentation</a>.
305
getMenuItems(#wx_ref{type=ThisT,ref=ThisRef}) ->
306
?CLASS(ThisT,wxMenu),
307
wxe_util:call(?wxMenu_GetMenuItems,
310
%% @spec (This::wxMenu()) -> string()
311
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenugettitle">external documentation</a>.
312
getTitle(#wx_ref{type=ThisT,ref=ThisRef}) ->
313
?CLASS(ThisT,wxMenu),
314
wxe_util:call(?wxMenu_GetTitle,
317
%% @spec (This::wxMenu(),Pos::integer(),X::integer()|term()) -> wxMenuItem:wxMenuItem()
318
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsert">external documentation</a>.
319
%% <br /> Alternatives:
321
%% insert(This::wxMenu(), Pos::integer(), Itemid::integer()) -> insert(This,Pos,Itemid, []) </c></p>
323
%% insert(This::wxMenu(), Pos::integer(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
326
insert(This,Pos,Itemid)
327
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid) ->
328
insert(This,Pos,Itemid, []);
329
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,#wx_ref{type=ItemT,ref=ItemRef})
330
when is_integer(Pos) ->
331
?CLASS(ThisT,wxMenu),
332
?CLASS(ItemT,wxMenuItem),
333
wxe_util:call(?wxMenu_Insert_2,
334
<<ThisRef:32/?UI,Pos:32/?UI,ItemRef:32/?UI>>).
336
%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), [Option]) -> wxMenuItem:wxMenuItem()
337
%% Option = {text, string()} | {help, string()} | {kind, WxItemKind}
338
%% WxItemKind = integer()
339
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsert">external documentation</a>.
340
%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
341
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid, Options)
342
when is_integer(Pos),is_integer(Itemid),is_list(Options) ->
343
?CLASS(ThisT,wxMenu),
344
MOpts = fun({text, Text}, Acc) -> Text_UC = unicode:characters_to_binary([Text,0]),[<<1:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
345
({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<2:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
346
({kind, Kind}, Acc) -> [<<3:32/?UI,Kind:32/?UI>>|Acc];
347
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
348
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
349
wxe_util:call(?wxMenu_Insert_3,
350
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI, 0:32,BinOpt/binary>>).
352
%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> wxMenuItem:wxMenuItem()
353
%% @equiv insert(This,Pos,Itemid,Text,Submenu, [])
354
insert(This,Pos,Itemid,Text,Submenu)
355
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) ->
356
insert(This,Pos,Itemid,Text,Submenu, []).
358
%% @spec (This::wxMenu(),Pos::integer(),Itemid::integer(),Text::string(),X::string()|wxMenu(),X::bool()|term()) -> ok|wxMenuItem:wxMenuItem()
359
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsert">external documentation</a>.
360
%% <br /> Alternatives:
362
%% insert(This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
365
%% insert(This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
366
%%<br /> Option = {help, string()}
368
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,Help,IsCheckable)
369
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) ->
370
?CLASS(ThisT,wxMenu),
371
Text_UC = unicode:characters_to_binary([Text,0]),
372
Help_UC = unicode:characters_to_binary([Help,0]),
373
wxe_util:cast(?wxMenu_Insert_5_0,
374
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((4+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(IsCheckable)):32/?UI>>);
375
insert(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text,#wx_ref{type=SubmenuT,ref=SubmenuRef}, Options)
376
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) ->
377
?CLASS(ThisT,wxMenu),
378
Text_UC = unicode:characters_to_binary([Text,0]),
379
?CLASS(SubmenuT,wxMenu),
380
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
381
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
382
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
383
wxe_util:call(?wxMenu_Insert_5_1,
384
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,SubmenuRef:32/?UI, 0:32,BinOpt/binary>>).
386
%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
387
%% @equiv insertCheckItem(This,Pos,Itemid,Text, [])
388
insertCheckItem(This,Pos,Itemid,Text)
389
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text) ->
390
insertCheckItem(This,Pos,Itemid,Text, []).
392
%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
393
%% Option = {help, string()}
394
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsertcheckitem">external documentation</a>.
395
insertCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options)
396
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) ->
397
?CLASS(ThisT,wxMenu),
398
Text_UC = unicode:characters_to_binary([Text,0]),
399
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
400
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
401
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
402
wxe_util:call(?wxMenu_InsertCheckItem,
403
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
405
%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
406
%% @equiv insertRadioItem(This,Pos,Itemid,Text, [])
407
insertRadioItem(This,Pos,Itemid,Text)
408
when is_record(This, wx_ref),is_integer(Pos),is_integer(Itemid),is_list(Text) ->
409
insertRadioItem(This,Pos,Itemid,Text, []).
411
%% @spec (This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
412
%% Option = {help, string()}
413
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsertradioitem">external documentation</a>.
414
insertRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Pos,Itemid,Text, Options)
415
when is_integer(Pos),is_integer(Itemid),is_list(Text),is_list(Options) ->
416
?CLASS(ThisT,wxMenu),
417
Text_UC = unicode:characters_to_binary([Text,0]),
418
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
419
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
420
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
421
wxe_util:call(?wxMenu_InsertRadioItem,
422
<<ThisRef:32/?UI,Pos:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
424
%% @spec (This::wxMenu(), Pos::integer()) -> wxMenuItem:wxMenuItem()
425
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuinsertseparator">external documentation</a>.
426
insertSeparator(#wx_ref{type=ThisT,ref=ThisRef},Pos)
427
when is_integer(Pos) ->
428
?CLASS(ThisT,wxMenu),
429
wxe_util:call(?wxMenu_InsertSeparator,
430
<<ThisRef:32/?UI,Pos:32/?UI>>).
432
%% @spec (This::wxMenu(), Itemid::integer()) -> bool()
433
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuischecked">external documentation</a>.
434
isChecked(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
435
when is_integer(Itemid) ->
436
?CLASS(ThisT,wxMenu),
437
wxe_util:call(?wxMenu_IsChecked,
438
<<ThisRef:32/?UI,Itemid:32/?UI>>).
440
%% @spec (This::wxMenu(), Itemid::integer()) -> bool()
441
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuisenabled">external documentation</a>.
442
isEnabled(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
443
when is_integer(Itemid) ->
444
?CLASS(ThisT,wxMenu),
445
wxe_util:call(?wxMenu_IsEnabled,
446
<<ThisRef:32/?UI,Itemid:32/?UI>>).
448
%% @spec (This::wxMenu(),X::integer()|term()) -> wxMenuItem:wxMenuItem()
449
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprepend">external documentation</a>.
450
%% <br /> Alternatives:
452
%% prepend(This::wxMenu(), Itemid::integer()) -> prepend(This,Itemid, []) </c></p>
454
%% prepend(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
458
when is_record(This, wx_ref),is_integer(Itemid) ->
459
prepend(This,Itemid, []);
460
prepend(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
461
?CLASS(ThisT,wxMenu),
462
?CLASS(ItemT,wxMenuItem),
463
wxe_util:call(?wxMenu_Prepend_1,
464
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
466
%% @spec (This::wxMenu(), Itemid::integer(), [Option]) -> wxMenuItem:wxMenuItem()
467
%% Option = {text, string()} | {help, string()} | {kind, WxItemKind}
468
%% WxItemKind = integer()
469
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprepend">external documentation</a>.
470
%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
471
prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid, Options)
472
when is_integer(Itemid),is_list(Options) ->
473
?CLASS(ThisT,wxMenu),
474
MOpts = fun({text, Text}, Acc) -> Text_UC = unicode:characters_to_binary([Text,0]),[<<1:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((0+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
475
({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<2:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
476
({kind, Kind}, Acc) -> [<<3:32/?UI,Kind:32/?UI>>|Acc];
477
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
478
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
479
wxe_util:call(?wxMenu_Prepend_2,
480
<<ThisRef:32/?UI,Itemid:32/?UI, BinOpt/binary>>).
482
%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> wxMenuItem:wxMenuItem()
483
%% @equiv prepend(This,Itemid,Text,Submenu, [])
484
prepend(This,Itemid,Text,Submenu)
485
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text),is_record(Submenu, wx_ref) ->
486
prepend(This,Itemid,Text,Submenu, []).
488
%% @spec (This::wxMenu(),Itemid::integer(),Text::string(),X::string()|wxMenu(),X::bool()|term()) -> ok|wxMenuItem:wxMenuItem()
489
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprepend">external documentation</a>.
490
%% <br /> Alternatives:
492
%% prepend(This::wxMenu(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
495
%% prepend(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
496
%%<br /> Option = {help, string()}
498
prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,Help,IsCheckable)
499
when is_integer(Itemid),is_list(Text),is_list(Help),is_boolean(IsCheckable) ->
500
?CLASS(ThisT,wxMenu),
501
Text_UC = unicode:characters_to_binary([Text,0]),
502
Help_UC = unicode:characters_to_binary([Help,0]),
503
wxe_util:cast(?wxMenu_Prepend_4_0,
504
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((4+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8,(wxe_util:from_bool(IsCheckable)):32/?UI>>);
505
prepend(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text,#wx_ref{type=SubmenuT,ref=SubmenuRef}, Options)
506
when is_integer(Itemid),is_list(Text),is_list(Options) ->
507
?CLASS(ThisT,wxMenu),
508
Text_UC = unicode:characters_to_binary([Text,0]),
509
?CLASS(SubmenuT,wxMenu),
510
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
511
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
512
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
513
wxe_util:call(?wxMenu_Prepend_4_1,
514
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8,SubmenuRef:32/?UI, 0:32,BinOpt/binary>>).
516
%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
517
%% @equiv prependCheckItem(This,Itemid,Text, [])
518
prependCheckItem(This,Itemid,Text)
519
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
520
prependCheckItem(This,Itemid,Text, []).
522
%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
523
%% Option = {help, string()}
524
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprependcheckitem">external documentation</a>.
525
prependCheckItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
526
when is_integer(Itemid),is_list(Text),is_list(Options) ->
527
?CLASS(ThisT,wxMenu),
528
Text_UC = unicode:characters_to_binary([Text,0]),
529
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
530
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
531
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
532
wxe_util:call(?wxMenu_PrependCheckItem,
533
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
535
%% @spec (This::wxMenu(), Itemid::integer(), Text::string()) -> wxMenuItem:wxMenuItem()
536
%% @equiv prependRadioItem(This,Itemid,Text, [])
537
prependRadioItem(This,Itemid,Text)
538
when is_record(This, wx_ref),is_integer(Itemid),is_list(Text) ->
539
prependRadioItem(This,Itemid,Text, []).
541
%% @spec (This::wxMenu(), Itemid::integer(), Text::string(), [Option]) -> wxMenuItem:wxMenuItem()
542
%% Option = {help, string()}
543
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprependradioitem">external documentation</a>.
544
prependRadioItem(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Text, Options)
545
when is_integer(Itemid),is_list(Text),is_list(Options) ->
546
?CLASS(ThisT,wxMenu),
547
Text_UC = unicode:characters_to_binary([Text,0]),
548
MOpts = fun({help, Help}, Acc) -> Help_UC = unicode:characters_to_binary([Help,0]),[<<1:32/?UI,(byte_size(Help_UC)):32/?UI,(Help_UC)/binary, 0:(((8- ((0+byte_size(Help_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
549
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
550
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
551
wxe_util:call(?wxMenu_PrependRadioItem,
552
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
554
%% @spec (This::wxMenu()) -> wxMenuItem:wxMenuItem()
555
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuprependseparator">external documentation</a>.
556
prependSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
557
?CLASS(ThisT,wxMenu),
558
wxe_util:call(?wxMenu_PrependSeparator,
561
%% @spec (This::wxMenu(),X::integer()|term()) -> wxMenuItem:wxMenuItem()
562
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenuremove">external documentation</a>.
563
%% <br /> Alternatives:
565
%% remove(This::wxMenu(), Itemid::integer()) -> wxMenuItem:wxMenuItem() </c>
568
%% remove(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
570
remove(#wx_ref{type=ThisT,ref=ThisRef},Itemid)
571
when is_integer(Itemid) ->
572
?CLASS(ThisT,wxMenu),
573
wxe_util:call(?wxMenu_Remove_1_0,
574
<<ThisRef:32/?UI,Itemid:32/?UI>>);
575
remove(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ItemT,ref=ItemRef}) ->
576
?CLASS(ThisT,wxMenu),
577
?CLASS(ItemT,wxMenuItem),
578
wxe_util:call(?wxMenu_Remove_1_1,
579
<<ThisRef:32/?UI,ItemRef:32/?UI>>).
581
%% @spec (This::wxMenu(), Itemid::integer(), HelpString::string()) -> ok
582
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenusethelpstring">external documentation</a>.
583
setHelpString(#wx_ref{type=ThisT,ref=ThisRef},Itemid,HelpString)
584
when is_integer(Itemid),is_list(HelpString) ->
585
?CLASS(ThisT,wxMenu),
586
HelpString_UC = unicode:characters_to_binary([HelpString,0]),
587
wxe_util:cast(?wxMenu_SetHelpString,
588
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(HelpString_UC)):32/?UI,(HelpString_UC)/binary, 0:(((8- ((4+byte_size(HelpString_UC)) band 16#7)) band 16#7))/unit:8>>).
590
%% @spec (This::wxMenu(), Itemid::integer(), Label::string()) -> ok
591
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenusetlabel">external documentation</a>.
592
setLabel(#wx_ref{type=ThisT,ref=ThisRef},Itemid,Label)
593
when is_integer(Itemid),is_list(Label) ->
594
?CLASS(ThisT,wxMenu),
595
Label_UC = unicode:characters_to_binary([Label,0]),
596
wxe_util:cast(?wxMenu_SetLabel,
597
<<ThisRef:32/?UI,Itemid:32/?UI,(byte_size(Label_UC)):32/?UI,(Label_UC)/binary, 0:(((8- ((4+byte_size(Label_UC)) band 16#7)) band 16#7))/unit:8>>).
599
%% @spec (This::wxMenu(), Title::string()) -> ok
600
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenu.html#wxmenusettitle">external documentation</a>.
601
setTitle(#wx_ref{type=ThisT,ref=ThisRef},Title)
602
when is_list(Title) ->
603
?CLASS(ThisT,wxMenu),
604
Title_UC = unicode:characters_to_binary([Title,0]),
605
wxe_util:cast(?wxMenu_SetTitle,
606
<<ThisRef:32/?UI,(byte_size(Title_UC)):32/?UI,(Title_UC)/binary, 0:(((8- ((0+byte_size(Title_UC)) band 16#7)) band 16#7))/unit:8>>).
608
%% @spec (This::wxMenu()) -> ok
609
%% @doc Destroys this object, do not use object again
610
destroy(Obj=#wx_ref{type=Type}) ->
612
wxe_util:destroy(?DESTROY_OBJECT,Obj),
616
disconnect(This,EventType, Options) -> wxEvtHandler:disconnect(This,EventType, Options).
618
disconnect(This,EventType) -> wxEvtHandler:disconnect(This,EventType).
620
disconnect(This) -> wxEvtHandler:disconnect(This).
622
connect(This,EventType, Options) -> wxEvtHandler:connect(This,EventType, Options).
624
connect(This,EventType) -> wxEvtHandler:connect(This,EventType).