~statik/ubuntu/maverick/erlang/erlang-merge-testing

« back to all changes in this revision

Viewing changes to lib/wx/src/gen/wxMenu.erl

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-05-01 10:14:38 UTC
  • mfrom: (3.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20090501101438-6qlr6rsdxgyzrg2z
Tags: 1:13.b-dfsg-2
* Cleaned up patches: removed unneeded patch which helped to support
  different SCTP library versions, made sure that changes for m68k
  architecture applied only when building on this architecture.
* Removed duplicated information from binary packages descriptions.
* Don't require libsctp-dev build-dependency on solaris-i386 architecture
  which allows to build Erlang on Nexenta (thanks to Tim Spriggs for
  the suggestion).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
%%
 
2
%% %CopyrightBegin%
 
3
%% 
 
4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
 
5
%% 
 
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/.
 
11
%% 
 
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
 
15
%% under the License.
 
16
%% 
 
17
%% %CopyrightEnd%
 
18
%% This file is generated DO NOT EDIT
 
19
 
 
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}
 
23
%% </p>
 
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.
 
27
 
 
28
-module(wxMenu).
 
29
-include("wxe.hrl").
 
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]).
 
39
 
 
40
%% inherited exports
 
41
-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
 
42
 
 
43
%% @hidden
 
44
parent_class(wxEvtHandler) -> true;
 
45
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
 
46
 
 
47
%% @spec () -> wxMenu()
 
48
%% @equiv new([])
 
49
new() ->
 
50
  new([]).
 
51
 
 
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>.
 
55
new(Options)
 
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,
 
61
  <<BinOpt/binary>>).
 
62
 
 
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>.
 
66
new(Title, Options)
 
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>>).
 
74
 
 
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}) ->
 
78
  ?CLASS(ThisT,wxMenu),
 
79
  ?CLASS(ItemT,wxMenuItem),
 
80
  wxe_util:call(?wxMenu_Append_1,
 
81
  <<ThisRef:32/?UI,ItemRef:32/?UI>>).
 
82
 
 
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, []).
 
88
 
 
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: 
 
92
%% <p><c>
 
93
%% append(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu()) -> append(This,Itemid,Text,Submenu, []) </c></p>
 
94
%% <p><c>
 
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
 
99
%% </p>
 
100
 
 
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>>).
 
114
 
 
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: 
 
118
%% <p><c>
 
119
%% append(This::wxMenu(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
 
120
%% </p>
 
121
%% <p><c>
 
122
%% append(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
 
123
%%<br /> Option = {help, string()}
 
124
%% </p>
 
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>>).
 
142
 
 
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, []).
 
148
 
 
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>>).
 
161
 
 
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, []).
 
167
 
 
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>>).
 
180
 
 
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,
 
186
  <<ThisRef:32/?UI>>).
 
187
 
 
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,
 
193
  <<ThisRef:32/?UI>>).
 
194
 
 
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>>).
 
202
 
 
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: 
 
206
%% <p><c>
 
207
%% delete(This::wxMenu(), Itemid::integer()) -> bool() </c>
 
208
%% </p>
 
209
%% <p><c>
 
210
%% delete(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> bool() </c>
 
211
%% </p>
 
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>>).
 
222
 
 
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: 
 
226
%% <p><c>
 
227
%% 'Destroy'(This::wxMenu(), Itemid::integer()) -> bool() </c>
 
228
%% </p>
 
229
%% <p><c>
 
230
%% 'Destroy'(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> bool() </c>
 
231
%% </p>
 
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>>).
 
242
 
 
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>>).
 
250
 
 
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: 
 
254
%% <p><c>
 
255
%% findItem(This::wxMenu(), Itemid::integer()) -> wxMenuItem:wxMenuItem() </c>
 
256
%% </p>
 
257
%% <p><c>
 
258
%% findItem(This::wxMenu(), Item::string()) -> integer() </c>
 
259
%% </p>
 
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>>).
 
271
 
 
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>>).
 
279
 
 
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>>).
 
287
 
 
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>>).
 
295
 
 
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,
 
301
  <<ThisRef:32/?UI>>).
 
302
 
 
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,
 
308
  <<ThisRef:32/?UI>>).
 
309
 
 
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,
 
315
  <<ThisRef:32/?UI>>).
 
316
 
 
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: 
 
320
%% <p><c>
 
321
%% insert(This::wxMenu(), Pos::integer(), Itemid::integer()) -> insert(This,Pos,Itemid, []) </c></p>
 
322
%% <p><c>
 
323
%% insert(This::wxMenu(), Pos::integer(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
 
324
%% </p>
 
325
 
 
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>>).
 
335
 
 
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>>).
 
351
 
 
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, []).
 
357
 
 
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: 
 
361
%% <p><c>
 
362
%% insert(This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
 
363
%% </p>
 
364
%% <p><c>
 
365
%% insert(This::wxMenu(), Pos::integer(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
 
366
%%<br /> Option = {help, string()}
 
367
%% </p>
 
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>>).
 
385
 
 
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, []).
 
391
 
 
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>>).
 
404
 
 
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, []).
 
410
 
 
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>>).
 
423
 
 
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>>).
 
431
 
 
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>>).
 
439
 
 
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>>).
 
447
 
 
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: 
 
451
%% <p><c>
 
452
%% prepend(This::wxMenu(), Itemid::integer()) -> prepend(This,Itemid, []) </c></p>
 
453
%% <p><c>
 
454
%% prepend(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
 
455
%% </p>
 
456
 
 
457
prepend(This,Itemid)
 
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>>).
 
465
 
 
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>>).
 
481
 
 
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, []).
 
487
 
 
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: 
 
491
%% <p><c>
 
492
%% prepend(This::wxMenu(), Itemid::integer(), Text::string(), Help::string(), IsCheckable::bool()) -> ok </c>
 
493
%% </p>
 
494
%% <p><c>
 
495
%% prepend(This::wxMenu(), Itemid::integer(), Text::string(), Submenu::wxMenu(), [Option]) -> wxMenuItem:wxMenuItem() </c>
 
496
%%<br /> Option = {help, string()}
 
497
%% </p>
 
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>>).
 
515
 
 
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, []).
 
521
 
 
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>>).
 
534
 
 
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, []).
 
540
 
 
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>>).
 
553
 
 
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,
 
559
  <<ThisRef:32/?UI>>).
 
560
 
 
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: 
 
564
%% <p><c>
 
565
%% remove(This::wxMenu(), Itemid::integer()) -> wxMenuItem:wxMenuItem() </c>
 
566
%% </p>
 
567
%% <p><c>
 
568
%% remove(This::wxMenu(), Item::wxMenuItem:wxMenuItem()) -> wxMenuItem:wxMenuItem() </c>
 
569
%% </p>
 
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>>).
 
580
 
 
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>>).
 
589
 
 
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>>).
 
598
 
 
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>>).
 
607
 
 
608
%% @spec (This::wxMenu()) -> ok
 
609
%% @doc Destroys this object, do not use object again
 
610
destroy(Obj=#wx_ref{type=Type}) -> 
 
611
  ?CLASS(Type,wxMenu),
 
612
  wxe_util:destroy(?DESTROY_OBJECT,Obj),
 
613
  ok.
 
614
 %% From wxEvtHandler 
 
615
%% @hidden
 
616
disconnect(This,EventType, Options) -> wxEvtHandler:disconnect(This,EventType, Options).
 
617
%% @hidden
 
618
disconnect(This,EventType) -> wxEvtHandler:disconnect(This,EventType).
 
619
%% @hidden
 
620
disconnect(This) -> wxEvtHandler:disconnect(This).
 
621
%% @hidden
 
622
connect(This,EventType, Options) -> wxEvtHandler:connect(This,EventType, Options).
 
623
%% @hidden
 
624
connect(This,EventType) -> wxEvtHandler:connect(This,EventType).