diff options
Diffstat (limited to 'lib/wx/src/gen/wxXmlResource.erl')
-rw-r--r-- | lib/wx/src/gen/wxXmlResource.erl | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/lib/wx/src/gen/wxXmlResource.erl b/lib/wx/src/gen/wxXmlResource.erl index fec9a5b4a9..51f6231f48 100644 --- a/lib/wx/src/gen/wxXmlResource.erl +++ b/lib/wx/src/gen/wxXmlResource.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2013. All Rights Reserved. +%% 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. @@ -48,8 +48,8 @@ new() -> %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourcewxxmlresource">external documentation</a>. -spec new([Option]) -> wxXmlResource() when - Option :: {flags, integer()} - | {domain, unicode:chardata()}. + Option :: {'flags', integer()} + | {'domain', unicode:chardata()}. new(Options) when is_list(Options) -> MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; @@ -62,10 +62,10 @@ new(Options) %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourcewxxmlresource">external documentation</a>. -spec new(Filemask, [Option]) -> wxXmlResource() when Filemask::unicode:chardata(), - Option :: {flags, integer()} - | {domain, unicode:chardata()}. + Option :: {'flags', integer()} + | {'domain', unicode:chardata()}. new(Filemask, Options) - when is_list(Filemask),is_list(Options) -> + when ?is_chardata(Filemask),is_list(Options) -> Filemask_UC = unicode:characters_to_binary([Filemask,0]), MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; ({domain, Domain}, Acc) -> Domain_UC = unicode:characters_to_binary([Domain,0]),[<<2:32/?UI,(byte_size(Domain_UC)):32/?UI,(Domain_UC)/binary, 0:(((8- ((0+byte_size(Domain_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; @@ -79,15 +79,15 @@ new(Filemask, Options) This::wxXmlResource(), Name::unicode:chardata(), Control::wxWindow:wxWindow(). attachUnknownControl(This,Name,Control) - when is_record(This, wx_ref),is_list(Name),is_record(Control, wx_ref) -> + when is_record(This, wx_ref),?is_chardata(Name),is_record(Control, wx_ref) -> attachUnknownControl(This,Name,Control, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourceattachunknowncontrol">external documentation</a>. -spec attachUnknownControl(This, Name, Control, [Option]) -> boolean() when This::wxXmlResource(), Name::unicode:chardata(), Control::wxWindow:wxWindow(), - Option :: {parent, wxWindow:wxWindow()}. + Option :: {'parent', wxWindow:wxWindow()}. attachUnknownControl(#wx_ref{type=ThisT,ref=ThisRef},Name,#wx_ref{type=ControlT,ref=ControlRef}, Options) - when is_list(Name),is_list(Options) -> + when ?is_chardata(Name),is_list(Options) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), ?CLASS(ControlT,wxWindow), @@ -98,7 +98,7 @@ attachUnknownControl(#wx_ref{type=ThisT,ref=ThisRef},Name,#wx_ref{type=ControlT, <<ThisRef:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8,ControlRef:32/?UI, 0:32,BinOpt/binary>>). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourceclearhandlers">external documentation</a>. --spec clearHandlers(This) -> ok when +-spec clearHandlers(This) -> 'ok' when This::wxXmlResource(). clearHandlers(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxXmlResource), @@ -147,7 +147,7 @@ getXRCID(Str_id) %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourcegetxrcid">external documentation</a>. -spec getXRCID(Str_id, [Option]) -> integer() when Str_id::[unicode:chardata()], - Option :: {value_if_not_found, integer()}. + Option :: {'value_if_not_found', integer()}. getXRCID(Str_id, Options) when is_list(Str_id),is_list(Options) -> Str_id_UC = unicode:characters_to_binary([Str_id,0]), @@ -158,7 +158,7 @@ getXRCID(Str_id, Options) <<(byte_size(Str_id_UC)):32/?UI,(Str_id_UC)/binary, 0:(((8- ((4+byte_size(Str_id_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourceinitallhandlers">external documentation</a>. --spec initAllHandlers(This) -> ok when +-spec initAllHandlers(This) -> 'ok' when This::wxXmlResource(). initAllHandlers(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxXmlResource), @@ -169,7 +169,7 @@ initAllHandlers(#wx_ref{type=ThisT,ref=ThisRef}) -> -spec load(This, Filemask) -> boolean() when This::wxXmlResource(), Filemask::unicode:chardata(). load(#wx_ref{type=ThisT,ref=ThisRef},Filemask) - when is_list(Filemask) -> + when ?is_chardata(Filemask) -> ?CLASS(ThisT,wxXmlResource), Filemask_UC = unicode:characters_to_binary([Filemask,0]), wxe_util:call(?wxXmlResource_Load, @@ -179,7 +179,7 @@ load(#wx_ref{type=ThisT,ref=ThisRef},Filemask) -spec loadBitmap(This, Name) -> wxBitmap:wxBitmap() when This::wxXmlResource(), Name::unicode:chardata(). loadBitmap(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadBitmap, @@ -189,7 +189,7 @@ loadBitmap(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadDialog(This, Parent, Name) -> wxDialog:wxDialog() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -200,7 +200,7 @@ loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},N -spec loadDialog(This, Dlg, Parent, Name) -> boolean() when This::wxXmlResource(), Dlg::wxDialog:wxDialog(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DlgT,ref=DlgRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(DlgT,wxDialog), ?CLASS(ParentT,wxWindow), @@ -212,7 +212,7 @@ loadDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=DlgT,ref=DlgRef},#wx_ref -spec loadFrame(This, Parent, Name) -> wxFrame:wxFrame() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -223,7 +223,7 @@ loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Na -spec loadFrame(This, Frame, Parent, Name) -> boolean() when This::wxXmlResource(), Frame::wxFrame:wxFrame(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(FrameT,wxFrame), ?CLASS(ParentT,wxWindow), @@ -235,7 +235,7 @@ loadFrame(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FrameT,ref=FrameRef},#wx_ -spec loadIcon(This, Name) -> wxIcon:wxIcon() when This::wxXmlResource(), Name::unicode:chardata(). loadIcon(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadIcon, @@ -245,7 +245,7 @@ loadIcon(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadMenu(This, Name) -> wxMenu:wxMenu() when This::wxXmlResource(), Name::unicode:chardata(). loadMenu(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadMenu, @@ -255,7 +255,7 @@ loadMenu(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadMenuBar(This, Name) -> wxMenuBar:wxMenuBar() when This::wxXmlResource(), Name::unicode:chardata(). loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), Name_UC = unicode:characters_to_binary([Name,0]), wxe_util:call(?wxXmlResource_LoadMenuBar_1, @@ -265,7 +265,7 @@ loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},Name) -spec loadMenuBar(This, Parent, Name) -> wxMenuBar:wxMenuBar() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -276,7 +276,7 @@ loadMenuBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}, -spec loadPanel(This, Parent, Name) -> wxPanel:wxPanel() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -287,7 +287,7 @@ loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Na -spec loadPanel(This, Panel, Parent, Name) -> boolean() when This::wxXmlResource(), Panel::wxPanel:wxPanel(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PanelT,ref=PanelRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(PanelT,wxPanel), ?CLASS(ParentT,wxWindow), @@ -299,7 +299,7 @@ loadPanel(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=PanelT,ref=PanelRef},#wx_ -spec loadToolBar(This, Parent, Name) -> wxToolBar:wxToolBar() when This::wxXmlResource(), Parent::wxWindow:wxWindow(), Name::unicode:chardata(). loadToolBar(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Name) - when is_list(Name) -> + when ?is_chardata(Name) -> ?CLASS(ThisT,wxXmlResource), ?CLASS(ParentT,wxWindow), Name_UC = unicode:characters_to_binary([Name,0]), @@ -315,7 +315,7 @@ set(#wx_ref{type=ResT,ref=ResRef}) -> <<ResRef:32/?UI>>). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxxmlresource.html#wxxmlresourcesetflags">external documentation</a>. --spec setFlags(This, Flags) -> ok when +-spec setFlags(This, Flags) -> 'ok' when This::wxXmlResource(), Flags::integer(). setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags) when is_integer(Flags) -> @@ -327,15 +327,13 @@ setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags) -spec unload(This, Filename) -> boolean() when This::wxXmlResource(), Filename::unicode:chardata(). unload(#wx_ref{type=ThisT,ref=ThisRef},Filename) - when is_list(Filename) -> + when ?is_chardata(Filename) -> ?CLASS(ThisT,wxXmlResource), Filename_UC = unicode:characters_to_binary([Filename,0]), wxe_util:call(?wxXmlResource_Unload, <<ThisRef:32/?UI,(byte_size(Filename_UC)):32/?UI,(Filename_UC)/binary, 0:(((8- ((0+byte_size(Filename_UC)) band 16#7)) band 16#7))/unit:8>>). -%% @spec (Window::wxWindow:wxWindow(),Name::string(), Type::atom()) -> wx:wxObject() - %% @doc Looks up a control with Name in a window created with XML %% resources. You can use it to set/get values from controls. %% The object is type casted to <b>Type</b>. @@ -345,6 +343,10 @@ unload(#wx_ref{type=ThisT,ref=ThisRef},Filename) %% true = wxXmlResource:loadDialog(Xrc, Dlg, Frame, "controls_dialog"), <br /> %% LCtrl = xrcctrl(Dlg, "controls_listctrl", wxListCtrl), <br /> %% wxListCtrl:insertColumn(LCtrl, 0, "Name", [{width, 200}]), <br /> +-spec xrcctrl(Window, Name, Type) -> wx:wx_object() when + Window::wxWindow:wxWindow(), + Name::string(), + Type::atom(). xrcctrl(Window = #wx_ref{}, Name, Type) when is_list(Name), is_atom(Type) -> %% Func Id ?wxXmlResource_xrcctrl @@ -353,7 +355,7 @@ xrcctrl(Window = #wx_ref{}, Name, Type) when is_list(Name), is_atom(Type) -> wx:typeCast(Res, Type). %% @doc Destroys this object, do not use object again --spec destroy(This::wxXmlResource()) -> ok. +-spec destroy(This::wxXmlResource()) -> 'ok'. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxXmlResource), wxe_util:destroy(?DESTROY_OBJECT,Obj), |