diff options
Diffstat (limited to 'lib/wx/src/gen/wxMenuItem.erl')
-rw-r--r-- | lib/wx/src/gen/wxMenuItem.erl | 99 |
1 files changed, 65 insertions, 34 deletions
diff --git a/lib/wx/src/gen/wxMenuItem.erl b/lib/wx/src/gen/wxMenuItem.erl index e2bbe681c5..76ce8408ed 100644 --- a/lib/wx/src/gen/wxMenuItem.erl +++ b/lib/wx/src/gen/wxMenuItem.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -32,19 +32,26 @@ %% inherited exports -export([parent_class/1]). +-export_type([wxMenuItem/0]). %% @hidden parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -%% @spec () -> wxMenuItem() +-type wxMenuItem() :: wx:wx_object(). %% @equiv new([]) +-spec new() -> wxMenuItem(). + new() -> new([]). -%% @spec ([Option]) -> wxMenuItem() -%% Option = {parentMenu, wxMenu:wxMenu()} | {id, integer()} | {text, string()} | {help, string()} | {kind, WxItemKind} | {subMenu, wxMenu:wxMenu()} -%% WxItemKind = integer() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemwxmenuitem">external documentation</a>. -%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX +%%<br /> Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX +-spec new([Option]) -> wxMenuItem() when + Option :: {parentMenu, wxMenu:wxMenu()} + | {id, integer()} + | {text, string()} + | {help, string()} + | {kind, wx:wx_enum()} + | {subMenu, wxMenu:wxMenu()}. new(Options) when is_list(Options) -> MOpts = fun({parentMenu, #wx_ref{type=ParentMenuT,ref=ParentMenuRef}}, Acc) -> ?CLASS(ParentMenuT,wxMenu),[<<1:32/?UI,ParentMenuRef:32/?UI>>|Acc]; @@ -58,15 +65,18 @@ new(Options) wxe_util:construct(?wxMenuItem_new, <<BinOpt/binary>>). -%% @spec (This::wxMenuItem()) -> ok %% @equiv check(This, []) +-spec check(This) -> ok when + This::wxMenuItem(). + check(This) when is_record(This, wx_ref) -> check(This, []). -%% @spec (This::wxMenuItem(), [Option]) -> ok -%% Option = {check, bool()} %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemcheck">external documentation</a>. +-spec check(This, [Option]) -> ok when + This::wxMenuItem(), + Option :: {check, boolean()}. check(#wx_ref{type=ThisT,ref=ThisRef}, Options) when is_list(Options) -> ?CLASS(ThisT,wxMenuItem), @@ -76,15 +86,18 @@ check(#wx_ref{type=ThisT,ref=ThisRef}, Options) wxe_util:cast(?wxMenuItem_Check, <<ThisRef:32/?UI, 0:32,BinOpt/binary>>). -%% @spec (This::wxMenuItem()) -> ok %% @equiv enable(This, []) +-spec enable(This) -> ok when + This::wxMenuItem(). + enable(This) when is_record(This, wx_ref) -> enable(This, []). -%% @spec (This::wxMenuItem(), [Option]) -> ok -%% Option = {enable, bool()} %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemenable">external documentation</a>. +-spec enable(This, [Option]) -> ok when + This::wxMenuItem(), + Option :: {enable, boolean()}. enable(#wx_ref{type=ThisT,ref=ThisRef}, Options) when is_list(Options) -> ?CLASS(ThisT,wxMenuItem), @@ -94,117 +107,132 @@ enable(#wx_ref{type=ThisT,ref=ThisRef}, Options) wxe_util:cast(?wxMenuItem_Enable, <<ThisRef:32/?UI, 0:32,BinOpt/binary>>). -%% @spec (This::wxMenuItem()) -> wxBitmap:wxBitmap() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetbitmap">external documentation</a>. +-spec getBitmap(This) -> wxBitmap:wxBitmap() when + This::wxMenuItem(). getBitmap(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetBitmap, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> string() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgethelp">external documentation</a>. +-spec getHelp(This) -> string() when + This::wxMenuItem(). getHelp(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetHelp, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> integer() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetid">external documentation</a>. +-spec getId(This) -> integer() when + This::wxMenuItem(). getId(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetId, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> WxItemKind -%% WxItemKind = integer() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetkind">external documentation</a>. -%%<br /> WxItemKind is one of ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX +%%<br /> Res = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX +-spec getKind(This) -> wx:wx_enum() when + This::wxMenuItem(). getKind(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetKind, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> string() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetlabel">external documentation</a>. +-spec getLabel(This) -> string() when + This::wxMenuItem(). getLabel(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetLabel, <<ThisRef:32/?UI>>). -%% @spec (Text::string()) -> string() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetlabelfromtext">external documentation</a>. +-spec getLabelFromText(Text) -> string() when + Text::string(). getLabelFromText(Text) when is_list(Text) -> Text_UC = unicode:characters_to_binary([Text,0]), wxe_util:call(?wxMenuItem_GetLabelFromText, <<(byte_size(Text_UC)):32/?UI,(Text_UC)/binary, 0:(((8- ((4+byte_size(Text_UC)) band 16#7)) band 16#7))/unit:8>>). -%% @spec (This::wxMenuItem()) -> wxMenu:wxMenu() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetmenu">external documentation</a>. +-spec getMenu(This) -> wxMenu:wxMenu() when + This::wxMenuItem(). getMenu(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetMenu, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> string() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgettext">external documentation</a>. +-spec getText(This) -> string() when + This::wxMenuItem(). getText(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetText, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> wxMenu:wxMenu() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemgetsubmenu">external documentation</a>. +-spec getSubMenu(This) -> wxMenu:wxMenu() when + This::wxMenuItem(). getSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetSubMenu, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> bool() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemischeckable">external documentation</a>. +-spec isCheckable(This) -> boolean() when + This::wxMenuItem(). isCheckable(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsCheckable, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> bool() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemischecked">external documentation</a>. +-spec isChecked(This) -> boolean() when + This::wxMenuItem(). isChecked(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsChecked, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> bool() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemisenabled">external documentation</a>. +-spec isEnabled(This) -> boolean() when + This::wxMenuItem(). isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsEnabled, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> bool() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemisseparator">external documentation</a>. +-spec isSeparator(This) -> boolean() when + This::wxMenuItem(). isSeparator(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsSeparator, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem()) -> bool() %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemissubmenu">external documentation</a>. +-spec isSubMenu(This) -> boolean() when + This::wxMenuItem(). isSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsSubMenu, <<ThisRef:32/?UI>>). -%% @spec (This::wxMenuItem(), Bitmap::wxBitmap:wxBitmap()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetbitmap">external documentation</a>. +-spec setBitmap(This, Bitmap) -> ok when + This::wxMenuItem(), Bitmap::wxBitmap:wxBitmap(). setBitmap(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef}) -> ?CLASS(ThisT,wxMenuItem), ?CLASS(BitmapT,wxBitmap), wxe_util:cast(?wxMenuItem_SetBitmap, <<ThisRef:32/?UI,BitmapRef:32/?UI>>). -%% @spec (This::wxMenuItem(), Str::string()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsethelp">external documentation</a>. +-spec setHelp(This, Str) -> ok when + This::wxMenuItem(), Str::string(). setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str) when is_list(Str) -> ?CLASS(ThisT,wxMenuItem), @@ -212,24 +240,27 @@ setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str) wxe_util:cast(?wxMenuItem_SetHelp, <<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>>). -%% @spec (This::wxMenuItem(), Menu::wxMenu:wxMenu()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetmenu">external documentation</a>. +-spec setMenu(This, Menu) -> ok when + This::wxMenuItem(), Menu::wxMenu:wxMenu(). setMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) -> ?CLASS(ThisT,wxMenuItem), ?CLASS(MenuT,wxMenu), wxe_util:cast(?wxMenuItem_SetMenu, <<ThisRef:32/?UI,MenuRef:32/?UI>>). -%% @spec (This::wxMenuItem(), Menu::wxMenu:wxMenu()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsetsubmenu">external documentation</a>. +-spec setSubMenu(This, Menu) -> ok when + This::wxMenuItem(), Menu::wxMenu:wxMenu(). setSubMenu(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=MenuT,ref=MenuRef}) -> ?CLASS(ThisT,wxMenuItem), ?CLASS(MenuT,wxMenu), wxe_util:cast(?wxMenuItem_SetSubMenu, <<ThisRef:32/?UI,MenuRef:32/?UI>>). -%% @spec (This::wxMenuItem(), Str::string()) -> ok %% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxmenuitem.html#wxmenuitemsettext">external documentation</a>. +-spec setText(This, Str) -> ok when + This::wxMenuItem(), Str::string(). setText(#wx_ref{type=ThisT,ref=ThisRef},Str) when is_list(Str) -> ?CLASS(ThisT,wxMenuItem), @@ -237,8 +268,8 @@ setText(#wx_ref{type=ThisT,ref=ThisRef},Str) wxe_util:cast(?wxMenuItem_SetText, <<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>>). -%% @spec (This::wxMenuItem()) -> ok %% @doc Destroys this object, do not use object again +-spec destroy(This::wxMenuItem) -> ok. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxMenuItem), wxe_util:destroy(?DESTROY_OBJECT,Obj), |