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

« back to all changes in this revision

Viewing changes to lib/wx/src/gen/wxMenuItem.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_wxmenuitem.html">wxMenuItem</a>.
 
21
%% @type wxMenuItem().  An object reference, The representation is internal
 
22
%% and can be changed without notice. It can't be used for comparsion
 
23
%% stored on disc or distributed for use on other nodes.
 
24
 
 
25
-module(wxMenuItem).
 
26
-include("wxe.hrl").
 
27
-export([check/1,check/2,destroy/1,enable/1,enable/2,getBitmap/1,getHelp/1,getId/1,
 
28
  getKind/1,getLabel/1,getLabelFromText/1,getMenu/1,getSubMenu/1,getText/1,
 
29
  isCheckable/1,isChecked/1,isEnabled/1,isSeparator/1,isSubMenu/1,new/0,
 
30
  new/1,setBitmap/2,setHelp/2,setMenu/2,setSubMenu/2,setText/2]).
 
31
 
 
32
%% inherited exports
 
33
-export([parent_class/1]).
 
34
 
 
35
%% @hidden
 
36
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
 
37
 
 
38
%% @spec () -> wxMenuItem()
 
39
%% @equiv new([])
 
40
new() ->
 
41
  new([]).
 
42
 
 
43
%% @spec ([Option]) -> wxMenuItem()
 
44
%% Option = {parentMenu, wxMenu:wxMenu()} | {id, integer()} | {text, string()} | {help, string()} | {kind, WxItemKind} | {subMenu, wxMenu:wxMenu()}
 
45
%% WxItemKind = integer()
 
46
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemwxmenuitem">external documentation</a>.
 
47
%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
 
48
new(Options)
 
49
 when is_list(Options) ->
 
50
  MOpts = fun({parentMenu, #wx_ref{type=ParentMenuT,ref=ParentMenuRef}}, Acc) ->   ?CLASS(ParentMenuT,wxMenu),[<<1:32/?UI,ParentMenuRef:32/?UI>>|Acc];
 
51
          ({id, Id}, Acc) -> [<<2:32/?UI,Id:32/?UI>>|Acc];
 
52
          ({text, Text}, Acc) ->   Text_UC = unicode:characters_to_binary([Text,0]),[<<3: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];
 
53
          ({help, Help}, Acc) ->   Help_UC = unicode:characters_to_binary([Help,0]),[<<4: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];
 
54
          ({kind, Kind}, Acc) -> [<<5:32/?UI,Kind:32/?UI>>|Acc];
 
55
          ({subMenu, #wx_ref{type=SubMenuT,ref=SubMenuRef}}, Acc) ->   ?CLASS(SubMenuT,wxMenu),[<<6:32/?UI,SubMenuRef:32/?UI>>|Acc];
 
56
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
57
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
58
  wxe_util:construct(?wxMenuItem_new,
 
59
  <<BinOpt/binary>>).
 
60
 
 
61
%% @spec (This::wxMenuItem()) -> ok
 
62
%% @equiv check(This, [])
 
63
check(This)
 
64
 when is_record(This, wx_ref) ->
 
65
  check(This, []).
 
66
 
 
67
%% @spec (This::wxMenuItem(), [Option]) -> ok
 
68
%% Option = {check, bool()}
 
69
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemcheck">external documentation</a>.
 
70
check(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
71
 when is_list(Options) ->
 
72
  ?CLASS(ThisT,wxMenuItem),
 
73
  MOpts = fun({check, Check}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Check)):32/?UI>>|Acc];
 
74
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
75
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
76
  wxe_util:cast(?wxMenuItem_Check,
 
77
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
78
 
 
79
%% @spec (This::wxMenuItem()) -> ok
 
80
%% @equiv enable(This, [])
 
81
enable(This)
 
82
 when is_record(This, wx_ref) ->
 
83
  enable(This, []).
 
84
 
 
85
%% @spec (This::wxMenuItem(), [Option]) -> ok
 
86
%% Option = {enable, bool()}
 
87
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemenable">external documentation</a>.
 
88
enable(#wx_ref{type=ThisT,ref=ThisRef}, Options)
 
89
 when is_list(Options) ->
 
90
  ?CLASS(ThisT,wxMenuItem),
 
91
  MOpts = fun({enable, Enable}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>|Acc];
 
92
          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
 
93
  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
 
94
  wxe_util:cast(?wxMenuItem_Enable,
 
95
  <<ThisRef:32/?UI, 0:32,BinOpt/binary>>).
 
96
 
 
97
%% @spec (This::wxMenuItem()) -> wxBitmap:wxBitmap()
 
98
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetbitmap">external documentation</a>.
 
99
getBitmap(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
100
  ?CLASS(ThisT,wxMenuItem),
 
101
  wxe_util:call(?wxMenuItem_GetBitmap,
 
102
  <<ThisRef:32/?UI>>).
 
103
 
 
104
%% @spec (This::wxMenuItem()) -> string()
 
105
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgethelp">external documentation</a>.
 
106
getHelp(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
107
  ?CLASS(ThisT,wxMenuItem),
 
108
  wxe_util:call(?wxMenuItem_GetHelp,
 
109
  <<ThisRef:32/?UI>>).
 
110
 
 
111
%% @spec (This::wxMenuItem()) -> integer()
 
112
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetid">external documentation</a>.
 
113
getId(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
114
  ?CLASS(ThisT,wxMenuItem),
 
115
  wxe_util:call(?wxMenuItem_GetId,
 
116
  <<ThisRef:32/?UI>>).
 
117
 
 
118
%% @spec (This::wxMenuItem()) -> WxItemKind
 
119
%% WxItemKind = integer()
 
120
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetkind">external documentation</a>.
 
121
%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX
 
122
getKind(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
123
  ?CLASS(ThisT,wxMenuItem),
 
124
  wxe_util:call(?wxMenuItem_GetKind,
 
125
  <<ThisRef:32/?UI>>).
 
126
 
 
127
%% @spec (This::wxMenuItem()) -> string()
 
128
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetlabel">external documentation</a>.
 
129
getLabel(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
130
  ?CLASS(ThisT,wxMenuItem),
 
131
  wxe_util:call(?wxMenuItem_GetLabel,
 
132
  <<ThisRef:32/?UI>>).
 
133
 
 
134
%% @spec (Text::string()) -> string()
 
135
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetlabelfromtext">external documentation</a>.
 
136
getLabelFromText(Text)
 
137
 when is_list(Text) ->
 
138
  Text_UC = unicode:characters_to_binary([Text,0]),
 
139
  wxe_util:call(?wxMenuItem_GetLabelFromText,
 
140
  <<(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>).
 
141
 
 
142
%% @spec (This::wxMenuItem()) -> wxMenu:wxMenu()
 
143
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetmenu">external documentation</a>.
 
144
getMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
145
  ?CLASS(ThisT,wxMenuItem),
 
146
  wxe_util:call(?wxMenuItem_GetMenu,
 
147
  <<ThisRef:32/?UI>>).
 
148
 
 
149
%% @spec (This::wxMenuItem()) -> string()
 
150
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgettext">external documentation</a>.
 
151
getText(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
152
  ?CLASS(ThisT,wxMenuItem),
 
153
  wxe_util:call(?wxMenuItem_GetText,
 
154
  <<ThisRef:32/?UI>>).
 
155
 
 
156
%% @spec (This::wxMenuItem()) -> wxMenu:wxMenu()
 
157
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetsubmenu">external documentation</a>.
 
158
getSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
159
  ?CLASS(ThisT,wxMenuItem),
 
160
  wxe_util:call(?wxMenuItem_GetSubMenu,
 
161
  <<ThisRef:32/?UI>>).
 
162
 
 
163
%% @spec (This::wxMenuItem()) -> bool()
 
164
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemischeckable">external documentation</a>.
 
165
isCheckable(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
166
  ?CLASS(ThisT,wxMenuItem),
 
167
  wxe_util:call(?wxMenuItem_IsCheckable,
 
168
  <<ThisRef:32/?UI>>).
 
169
 
 
170
%% @spec (This::wxMenuItem()) -> bool()
 
171
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemischecked">external documentation</a>.
 
172
isChecked(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
173
  ?CLASS(ThisT,wxMenuItem),
 
174
  wxe_util:call(?wxMenuItem_IsChecked,
 
175
  <<ThisRef:32/?UI>>).
 
176
 
 
177
%% @spec (This::wxMenuItem()) -> bool()
 
178
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemisenabled">external documentation</a>.
 
179
isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
180
  ?CLASS(ThisT,wxMenuItem),
 
181
  wxe_util:call(?wxMenuItem_IsEnabled,
 
182
  <<ThisRef:32/?UI>>).
 
183
 
 
184
%% @spec (This::wxMenuItem()) -> bool()
 
185
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemisseparator">external documentation</a>.
 
186
isSeparator(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
187
  ?CLASS(ThisT,wxMenuItem),
 
188
  wxe_util:call(?wxMenuItem_IsSeparator,
 
189
  <<ThisRef:32/?UI>>).
 
190
 
 
191
%% @spec (This::wxMenuItem()) -> bool()
 
192
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemissubmenu">external documentation</a>.
 
193
isSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) ->
 
194
  ?CLASS(ThisT,wxMenuItem),
 
195
  wxe_util:call(?wxMenuItem_IsSubMenu,
 
196
  <<ThisRef:32/?UI>>).
 
197
 
 
198
%% @spec (This::wxMenuItem(), Bitmap::wxBitmap:wxBitmap()) -> ok
 
199
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetbitmap">external documentation</a>.
 
200
setBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) ->
 
201
  ?CLASS(ThisT,wxMenuItem),
 
202
  ?CLASS(BitmapT,wxBitmap),
 
203
  wxe_util:cast(?wxMenuItem_SetBitmap,
 
204
  <<ThisRef:32/?UI,BitmapRef:32/?UI>>).
 
205
 
 
206
%% @spec (This::wxMenuItem(), Str::string()) -> ok
 
207
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsethelp">external documentation</a>.
 
208
setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str)
 
209
 when is_list(Str) ->
 
210
  ?CLASS(ThisT,wxMenuItem),
 
211
  Str_UC = unicode:characters_to_binary([Str,0]),
 
212
  wxe_util:cast(?wxMenuItem_SetHelp,
 
213
  <<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
 
214
 
 
215
%% @spec (This::wxMenuItem(), Menu::wxMenu:wxMenu()) -> ok
 
216
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetmenu">external documentation</a>.
 
217
setMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) ->
 
218
  ?CLASS(ThisT,wxMenuItem),
 
219
  ?CLASS(MenuT,wxMenu),
 
220
  wxe_util:cast(?wxMenuItem_SetMenu,
 
221
  <<ThisRef:32/?UI,MenuRef:32/?UI>>).
 
222
 
 
223
%% @spec (This::wxMenuItem(), Menu::wxMenu:wxMenu()) -> ok
 
224
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetsubmenu">external documentation</a>.
 
225
setSubMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) ->
 
226
  ?CLASS(ThisT,wxMenuItem),
 
227
  ?CLASS(MenuT,wxMenu),
 
228
  wxe_util:cast(?wxMenuItem_SetSubMenu,
 
229
  <<ThisRef:32/?UI,MenuRef:32/?UI>>).
 
230
 
 
231
%% @spec (This::wxMenuItem(), Str::string()) -> ok
 
232
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsettext">external documentation</a>.
 
233
setText(#wx_ref{type=ThisT,ref=ThisRef},Str)
 
234
 when is_list(Str) ->
 
235
  ?CLASS(ThisT,wxMenuItem),
 
236
  Str_UC = unicode:characters_to_binary([Str,0]),
 
237
  wxe_util:cast(?wxMenuItem_SetText,
 
238
  <<ThisRef:32/?UI,(byte_size(Str_UC)):32/?UI,(Str_UC)/binary, 0:(((8- ((0+byte_size(Str_UC)) band 16#7)) band 16#7))/unit:8>>).
 
239
 
 
240
%% @spec (This::wxMenuItem()) -> ok
 
241
%% @doc Destroys this object, do not use object again
 
242
destroy(Obj=#wx_ref{type=Type}) -> 
 
243
  ?CLASS(Type,wxMenuItem),
 
244
  wxe_util:destroy(?DESTROY_OBJECT,Obj),
 
245
  ok.