From a181c06152a3c935fdf63659322020fb7625b577 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 16 Feb 2012 11:04:18 +0100 Subject: [wx] Generated types for all wx classes --- lib/wx/src/gen/wxChoice.erl | 46 +++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'lib/wx/src/gen/wxChoice.erl') diff --git a/lib/wx/src/gen/wxChoice.erl b/lib/wx/src/gen/wxChoice.erl index fa967d8487..983e74e65a 100644 --- a/lib/wx/src/gen/wxChoice.erl +++ b/lib/wx/src/gen/wxChoice.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2011. 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 @@ -74,6 +74,7 @@ show/1,show/2,thaw/1,transferDataFromWindow/1,transferDataToWindow/1, update/1,updateWindowUI/1,updateWindowUI/2,validate/1,warpPointer/3]). +-export_type([wxChoice/0]). %% @hidden parent_class(wxControlWithItems) -> true; parent_class(wxControl) -> true; @@ -81,21 +82,29 @@ parent_class(wxWindow) -> true; parent_class(wxEvtHandler) -> true; parent_class(_Class) -> erlang:error({badtype, ?MODULE}). -%% @spec () -> wxChoice() +-type wxChoice() :: wx:wx_object(). %% @doc See external documentation. +-spec new() -> wxChoice(). new() -> wxe_util:construct(?wxChoice_new_0, <<>>). -%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxChoice() %% @equiv new(Parent,Id, []) +-spec new(Parent, Id) -> wxChoice() when + Parent::wxWindow:wxWindow(), Id::integer(). + new(Parent,Id) when is_record(Parent, wx_ref),is_integer(Id) -> new(Parent,Id, []). -%% @spec (Parent::wxWindow:wxWindow(), Id::integer(), [Option]) -> wxChoice() -%% Option = {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} | {choices, [[string()]]} | {style, integer()} | {validator, wx:wx()} %% @doc See external documentation. +-spec new(Parent, Id, [Option]) -> wxChoice() when + Parent::wxWindow:wxWindow(), Id::integer(), + Option :: {pos, {X::integer(), Y::integer()}} + | {size, {W::integer(), H::integer()}} + | {choices, [[string()]]} + | {style, integer()} + | {validator, wx:wx()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) when is_integer(Id),is_list(Options) -> ?CLASS(ParentT,wxWindow), @@ -109,15 +118,19 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) wxe_util:construct(?wxChoice_new_3, <>). -%% @spec (This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]) -> bool() %% @equiv create(This,Parent,Id,Pos,Size,Choices, []) +-spec create(This, Parent, Id, Pos, Size, Choices) -> boolean() when + This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]. + create(This,Parent,Id,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> create(This,Parent,Id,Pos,Size,Choices, []). -%% @spec (This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], [Option]) -> bool() -%% Option = {style, integer()} | {validator, wx:wx()} %% @doc See external documentation. +-spec create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean() when + This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], + Option :: {style, integer()} + | {validator, wx:wx()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{PosX,PosY},{SizeW,SizeH},Choices, Options) when is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices),is_list(Options) -> ?CLASS(ThisT,wxChoice), @@ -131,30 +144,35 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{P wxe_util:call(?wxChoice_Create, <>|| UC_Str <- Choices_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Choices_UCA])) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>). -%% @spec (This::wxChoice(), N::integer()) -> ok %% @doc See external documentation. +-spec delete(This, N) -> ok when + This::wxChoice(), N::integer(). delete(#wx_ref{type=ThisT,ref=ThisRef},N) when is_integer(N) -> ?CLASS(ThisT,wxChoice), wxe_util:cast(?wxChoice_Delete, <>). -%% @spec (This::wxChoice()) -> integer() %% @doc See external documentation. +-spec getColumns(This) -> integer() when + This::wxChoice(). getColumns(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxChoice), wxe_util:call(?wxChoice_GetColumns, <>). -%% @spec (This::wxChoice()) -> ok %% @equiv setColumns(This, []) +-spec setColumns(This) -> ok when + This::wxChoice(). + setColumns(This) when is_record(This, wx_ref) -> setColumns(This, []). -%% @spec (This::wxChoice(), [Option]) -> ok -%% Option = {n, integer()} %% @doc See external documentation. +-spec setColumns(This, [Option]) -> ok when + This::wxChoice(), + Option :: {n, integer()}. setColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options) when is_list(Options) -> ?CLASS(ThisT,wxChoice), @@ -164,8 +182,8 @@ setColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options) wxe_util:cast(?wxChoice_SetColumns, <>). -%% @spec (This::wxChoice()) -> ok %% @doc Destroys this object, do not use object again +-spec destroy(This::wxChoice) -> ok. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxChoice), wxe_util:destroy(?DESTROY_OBJECT,Obj), -- cgit v1.2.3 From 217343d158afe60a5a6a15e8b894b6fd62611ad3 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 21 Feb 2012 16:05:37 +0100 Subject: [wx] Fix spec errors --- lib/wx/src/gen/wxChoice.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/wx/src/gen/wxChoice.erl') diff --git a/lib/wx/src/gen/wxChoice.erl b/lib/wx/src/gen/wxChoice.erl index 983e74e65a..b9cac3926c 100644 --- a/lib/wx/src/gen/wxChoice.erl +++ b/lib/wx/src/gen/wxChoice.erl @@ -102,7 +102,7 @@ new(Parent,Id) Parent::wxWindow:wxWindow(), Id::integer(), Option :: {pos, {X::integer(), Y::integer()}} | {size, {W::integer(), H::integer()}} - | {choices, [[string()]]} + | {choices, [[unicode:chardata()]]} | {style, integer()} | {validator, wx:wx()}. new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) @@ -120,7 +120,7 @@ new(#wx_ref{type=ParentT,ref=ParentRef},Id, Options) %% @equiv create(This,Parent,Id,Pos,Size,Choices, []) -spec create(This, Parent, Id, Pos, Size, Choices) -> boolean() when - This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]. + This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[unicode:chardata()]]. create(This,Parent,Id,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) when is_record(This, wx_ref),is_record(Parent, wx_ref),is_integer(Id),is_integer(PosX),is_integer(PosY),is_integer(SizeW),is_integer(SizeH),is_list(Choices) -> @@ -128,7 +128,7 @@ create(This,Parent,Id,Pos={PosX,PosY},Size={SizeW,SizeH},Choices) %% @doc See external documentation. -spec create(This, Parent, Id, Pos, Size, Choices, [Option]) -> boolean() when - This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], + This::wxChoice(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[unicode:chardata()]], Option :: {style, integer()} | {validator, wx:wx()}. create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{PosX,PosY},{SizeW,SizeH},Choices, Options) @@ -183,7 +183,7 @@ setColumns(#wx_ref{type=ThisT,ref=ThisRef}, Options) <>). %% @doc Destroys this object, do not use object again --spec destroy(This::wxChoice) -> ok. +-spec destroy(This::wxChoice()) -> ok. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxChoice), wxe_util:destroy(?DESTROY_OBJECT,Obj), -- cgit v1.2.3