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/wxListBox.erl | 62 ++++++++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 23 deletions(-) (limited to 'lib/wx/src/gen/wxListBox.erl') diff --git a/lib/wx/src/gen/wxListBox.erl b/lib/wx/src/gen/wxListBox.erl index cc30bf95e4..5cd8ba8127 100644 --- a/lib/wx/src/gen/wxListBox.erl +++ b/lib/wx/src/gen/wxListBox.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([wxListBox/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 () -> wxListBox() +-type wxListBox() :: wx:wx_object(). %% @doc See external documentation. +-spec new() -> wxListBox(). new() -> wxe_util:construct(?wxListBox_new_0, <<>>). -%% @spec (Parent::wxWindow:wxWindow(), Id::integer()) -> wxListBox() %% @equiv new(Parent,Id, []) +-spec new(Parent, Id) -> wxListBox() 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]) -> wxListBox() -%% 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]) -> wxListBox() 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(?wxListBox_new_3, <>). -%% @spec (This::wxListBox(), 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::wxListBox(), 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::wxListBox(), 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::wxListBox(), 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,wxListBox), @@ -131,23 +144,27 @@ create(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},Id,{P wxe_util:call(?wxListBox_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::wxListBox(), N::integer()) -> ok %% @doc See external documentation. +-spec deselect(This, N) -> ok when + This::wxListBox(), N::integer(). deselect(#wx_ref{type=ThisT,ref=ThisRef},N) when is_integer(N) -> ?CLASS(ThisT,wxListBox), wxe_util:cast(?wxListBox_Deselect, <>). -%% @spec (This::wxListBox()) -> {integer(), ASelections::[integer()]} %% @doc See external documentation. +-spec getSelections(This) -> Result when + Result ::{Res ::integer(), ASelections::[integer()]}, + This::wxListBox(). getSelections(#wx_ref{type=ThisT,ref=ThisRef}) -> ?CLASS(ThisT,wxListBox), wxe_util:call(?wxListBox_GetSelections, <>). -%% @spec (This::wxListBox(), Items::[[string()]], Pos::integer()) -> ok %% @doc See external documentation. +-spec insertItems(This, Items, Pos) -> ok when + This::wxListBox(), Items::[[string()]], Pos::integer(). insertItems(#wx_ref{type=ThisT,ref=ThisRef},Items,Pos) when is_list(Items),is_integer(Pos) -> ?CLASS(ThisT,wxListBox), @@ -156,16 +173,18 @@ insertItems(#wx_ref{type=ThisT,ref=ThisRef},Items,Pos) wxe_util:cast(?wxListBox_InsertItems, <>|| UC_Str <- Items_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Items_UCA])) band 16#7)) band 16#7))/unit:8,Pos:32/?UI>>). -%% @spec (This::wxListBox(), N::integer()) -> bool() %% @doc See external documentation. +-spec isSelected(This, N) -> boolean() when + This::wxListBox(), N::integer(). isSelected(#wx_ref{type=ThisT,ref=ThisRef},N) when is_integer(N) -> ?CLASS(ThisT,wxListBox), wxe_util:call(?wxListBox_IsSelected, <>). -%% @spec (This::wxListBox(), Items::[[string()]]) -> ok %% @doc See external documentation. +-spec set(This, Items) -> ok when + This::wxListBox(), Items::[[string()]]. set(#wx_ref{type=ThisT,ref=ThisRef},Items) when is_list(Items) -> ?CLASS(ThisT,wxListBox), @@ -174,23 +193,20 @@ set(#wx_ref{type=ThisT,ref=ThisRef},Items) wxe_util:cast(?wxListBox_Set, <>|| UC_Str <- Items_UCA>>)/binary, 0:(((8- ((0 + lists:sum([byte_size(S)+4||S<-Items_UCA])) band 16#7)) band 16#7))/unit:8>>). -%% @spec (This::wxListBox(), Point::{X::integer(), Y::integer()}) -> integer() %% @doc See external documentation. +-spec hitTest(This, Point) -> integer() when + This::wxListBox(), Point::{X::integer(), Y::integer()}. hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY}) when is_integer(PointX),is_integer(PointY) -> ?CLASS(ThisT,wxListBox), wxe_util:call(?wxListBox_HitTest, <>). -%% @spec (This::wxListBox(),X::integer()|string()) -> ok %% @doc See external documentation. -%%
Alternatives: -%%

-%% setFirstItem(This::wxListBox(), N::integer()) -> ok -%%

-%%

-%% setFirstItem(This::wxListBox(), S::string()) -> ok -%%

+-spec setFirstItem(This, N) -> ok when + This::wxListBox(), N::integer(); + (This, S) -> ok when + This::wxListBox(), S::string(). setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},N) when is_integer(N) -> ?CLASS(ThisT,wxListBox), @@ -203,8 +219,8 @@ setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},S) wxe_util:cast(?wxListBox_SetFirstItem_1_1, <>). -%% @spec (This::wxListBox()) -> ok %% @doc Destroys this object, do not use object again +-spec destroy(This::wxListBox) -> ok. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxListBox), 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/wxListBox.erl | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/wx/src/gen/wxListBox.erl') diff --git a/lib/wx/src/gen/wxListBox.erl b/lib/wx/src/gen/wxListBox.erl index 5cd8ba8127..d09f37811d 100644 --- a/lib/wx/src/gen/wxListBox.erl +++ b/lib/wx/src/gen/wxListBox.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::wxListBox(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]]. + This::wxListBox(), 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::wxListBox(), Parent::wxWindow:wxWindow(), Id::integer(), Pos::{X::integer(), Y::integer()}, Size::{W::integer(), H::integer()}, Choices::[[string()]], + This::wxListBox(), 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) @@ -164,7 +164,7 @@ getSelections(#wx_ref{type=ThisT,ref=ThisRef}) -> %% @doc See external documentation. -spec insertItems(This, Items, Pos) -> ok when - This::wxListBox(), Items::[[string()]], Pos::integer(). + This::wxListBox(), Items::[[unicode:chardata()]], Pos::integer(). insertItems(#wx_ref{type=ThisT,ref=ThisRef},Items,Pos) when is_list(Items),is_integer(Pos) -> ?CLASS(ThisT,wxListBox), @@ -184,7 +184,7 @@ isSelected(#wx_ref{type=ThisT,ref=ThisRef},N) %% @doc See external documentation. -spec set(This, Items) -> ok when - This::wxListBox(), Items::[[string()]]. + This::wxListBox(), Items::[[unicode:chardata()]]. set(#wx_ref{type=ThisT,ref=ThisRef},Items) when is_list(Items) -> ?CLASS(ThisT,wxListBox), @@ -206,7 +206,7 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY}) -spec setFirstItem(This, N) -> ok when This::wxListBox(), N::integer(); (This, S) -> ok when - This::wxListBox(), S::string(). + This::wxListBox(), S::unicode:chardata(). setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},N) when is_integer(N) -> ?CLASS(ThisT,wxListBox), @@ -220,7 +220,7 @@ setFirstItem(#wx_ref{type=ThisT,ref=ThisRef},S) <>). %% @doc Destroys this object, do not use object again --spec destroy(This::wxListBox) -> ok. +-spec destroy(This::wxListBox()) -> ok. destroy(Obj=#wx_ref{type=Type}) -> ?CLASS(Type,wxListBox), wxe_util:destroy(?DESTROY_OBJECT,Obj), -- cgit v1.2.3 From ec9ee1b76343c146cec17d0642dd9d1db7bbf3d6 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 24 Feb 2012 11:53:41 +0100 Subject: [wx] Doc overloaded functions edoc do not handle overloaded type-specs, so doc them manually --- lib/wx/src/gen/wxListBox.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/wx/src/gen/wxListBox.erl') diff --git a/lib/wx/src/gen/wxListBox.erl b/lib/wx/src/gen/wxListBox.erl index d09f37811d..bcaf5fad3b 100644 --- a/lib/wx/src/gen/wxListBox.erl +++ b/lib/wx/src/gen/wxListBox.erl @@ -203,6 +203,10 @@ hitTest(#wx_ref{type=ThisT,ref=ThisRef},{PointX,PointY}) <>). %% @doc See external documentation. +%%
Also:
+%% setFirstItem(This, S) -> ok when
+%% This::wxListBox(), S::unicode:chardata().
+%% -spec setFirstItem(This, N) -> ok when This::wxListBox(), N::integer(); (This, S) -> ok when -- cgit v1.2.3