%% %% %CopyrightBegin% %% %% Copyright Ericsson AB 2008-2016. All Rights Reserved. %% %% Licensed under the Apache License, Version 2.0 (the "License"); %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% http://www.apache.org/licenses/LICENSE-2.0 %% %% Unless required by applicable law or agreed to in writing, software %% distributed under the License is distributed on an "AS IS" BASIS, %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %% See the License for the specific language governing permissions and %% limitations under the License. %% %% %CopyrightEnd% %% This file is generated DO NOT EDIT %% @doc See external documentation: wxMenuItem. %% @type wxMenuItem(). An object reference, The representation is internal %% and can be changed without notice. It can't be used for comparsion %% stored on disc or distributed for use on other nodes. -module(wxMenuItem). -include("wxe.hrl"). -export([check/1,check/2,destroy/1,enable/1,enable/2,getBitmap/1,getHelp/1,getId/1, getKind/1,getLabel/1,getLabelFromText/1,getMenu/1,getSubMenu/1,getText/1, isCheckable/1,isChecked/1,isEnabled/1,isSeparator/1,isSubMenu/1,new/0, new/1,setBitmap/2,setHelp/2,setMenu/2,setSubMenu/2,setText/2]). %% inherited exports -export([parent_class/1]). -export_type([wxMenuItem/0]). %% @hidden parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -type wxMenuItem() :: wx:wx_object(). %% @equiv new([]) -spec new() -> wxMenuItem(). new() -> new([]). %% @doc See external documentation. %%
Kind = ?wxITEM_SEPARATOR | ?wxITEM_NORMAL | ?wxITEM_CHECK | ?wxITEM_RADIO | ?wxITEM_MAX -spec new([Option]) -> wxMenuItem() when Option :: {'parentMenu', wxMenu:wxMenu()} | {'id', integer()} | {'text', unicode:chardata()} | {'help', unicode:chardata()} | {'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]; ({id, Id}, Acc) -> [<<2:32/?UI,Id:32/?UI>>|Acc]; ({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]; ({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]; ({kind, Kind}, Acc) -> [<<5:32/?UI,Kind:32/?UI>>|Acc]; ({subMenu, #wx_ref{type=SubMenuT,ref=SubMenuRef}}, Acc) -> ?CLASS(SubMenuT,wxMenu),[<<6:32/?UI,SubMenuRef:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), wxe_util:construct(?wxMenuItem_new, <>). %% @equiv check(This, []) -spec check(This) -> 'ok' when This::wxMenuItem(). check(This) when is_record(This, wx_ref) -> check(This, []). %% @doc See external documentation. -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), MOpts = fun({check, Check}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Check)):32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), wxe_util:cast(?wxMenuItem_Check, <>). %% @equiv enable(This, []) -spec enable(This) -> 'ok' when This::wxMenuItem(). enable(This) when is_record(This, wx_ref) -> enable(This, []). %% @doc See external documentation. -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), MOpts = fun({enable, Enable}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Enable)):32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), wxe_util:cast(?wxMenuItem_Enable, <>). %% @doc See external documentation. -spec getBitmap(This) -> wxBitmap:wxBitmap() when This::wxMenuItem(). getBitmap(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetBitmap, <>). %% @doc See external documentation. -spec getHelp(This) -> unicode:charlist() when This::wxMenuItem(). getHelp(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetHelp, <>). %% @doc See external documentation. -spec getId(This) -> integer() when This::wxMenuItem(). getId(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetId, <>). %% @doc See external documentation. %%
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, <>). %% @doc See external documentation. -spec getLabel(This) -> unicode:charlist() when This::wxMenuItem(). getLabel(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetLabel, <>). %% @doc See external documentation. -spec getLabelFromText(Text) -> unicode:charlist() when Text::unicode:chardata(). 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>>). %% @doc See external documentation. -spec getMenu(This) -> wxMenu:wxMenu() when This::wxMenuItem(). getMenu(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetMenu, <>). %% @doc See external documentation. -spec getText(This) -> unicode:charlist() when This::wxMenuItem(). getText(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetText, <>). %% @doc See external documentation. -spec getSubMenu(This) -> wxMenu:wxMenu() when This::wxMenuItem(). getSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_GetSubMenu, <>). %% @doc See external documentation. -spec isCheckable(This) -> boolean() when This::wxMenuItem(). isCheckable(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsCheckable, <>). %% @doc See external documentation. -spec isChecked(This) -> boolean() when This::wxMenuItem(). isChecked(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsChecked, <>). %% @doc See external documentation. -spec isEnabled(This) -> boolean() when This::wxMenuItem(). isEnabled(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsEnabled, <>). %% @doc See external documentation. -spec isSeparator(This) -> boolean() when This::wxMenuItem(). isSeparator(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsSeparator, <>). %% @doc See external documentation. -spec isSubMenu(This) -> boolean() when This::wxMenuItem(). isSubMenu(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxMenuItem), wxe_util:call(?wxMenuItem_IsSubMenu, <>). %% @doc See external documentation. -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, <>). %% @doc See external documentation. -spec setHelp(This, Str) -> 'ok' when This::wxMenuItem(), Str::unicode:chardata(). setHelp(#wx_ref{type=ThisT,ref=ThisRef},Str) when is_list(Str) -> ?CLASS(ThisT,wxMenuItem), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxMenuItem_SetHelp, <>). %% @doc See external documentation. -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, <>). %% @doc See external documentation. -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, <>). %% @doc See external documentation. -spec setText(This, Str) -> 'ok' when This::wxMenuItem(), Str::unicode:chardata(). setText(#wx_ref{type=ThisT,ref=ThisRef},Str) when is_list(Str) -> ?CLASS(ThisT,wxMenuItem), Str_UC = unicode:characters_to_binary([Str,0]), wxe_util:cast(?wxMenuItem_SetText, <>). %% @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), ok.