>).
%% @spec (This::wxImageList(),Bitmap::wxBitmap:wxBitmap(),X::term()) -> integer()
%% @doc See external documentation.
%%
Alternatives:
%%
%% add(This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), Mask::wxBitmap:wxBitmap()) -> integer()
%%
%%
%% add(This::wxImageList(), Bitmap::wxBitmap:wxBitmap(), MaskColour::wx:colour()) -> integer()
%%
add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef},#wx_ref{type=MaskT,ref=MaskRef}) ->
?CLASS(ThisT,wxImageList),
?CLASS(BitmapT,wxBitmap),
?CLASS(MaskT,wxBitmap),
wxe_util:call(?wxImageList_Add_2_0,
<>);
add(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=BitmapT,ref=BitmapRef},MaskColour)
when tuple_size(MaskColour) =:= 3; tuple_size(MaskColour) =:= 4 ->
?CLASS(ThisT,wxImageList),
?CLASS(BitmapT,wxBitmap),
wxe_util:call(?wxImageList_Add_2_1,
<>).
%% @spec (This::wxImageList(), Width::integer(), Height::integer()) -> bool()
%% @equiv create(This,Width,Height, [])
create(This,Width,Height)
when is_record(This, wx_ref),is_integer(Width),is_integer(Height) ->
create(This,Width,Height, []).
%% @spec (This::wxImageList(), Width::integer(), Height::integer(), [Option]) -> bool()
%% Option = {mask, bool()} | {initialCount, integer()}
%% @doc See external documentation.
create(#wx_ref{type=ThisT,ref=ThisRef},Width,Height, Options)
when is_integer(Width),is_integer(Height),is_list(Options) ->
?CLASS(ThisT,wxImageList),
MOpts = fun({mask, Mask}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Mask)):32/?UI>>|Acc];
({initialCount, InitialCount}, Acc) -> [<<2:32/?UI,InitialCount:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxImageList_Create,
<>).
%% @spec (This::wxImageList(), Index::integer(), Dc::wxDC:wxDC(), X::integer(), Y::integer()) -> bool()
%% @equiv draw(This,Index,Dc,X,Y, [])
draw(This,Index,Dc,X,Y)
when is_record(This, wx_ref),is_integer(Index),is_record(Dc, wx_ref),is_integer(X),is_integer(Y) ->
draw(This,Index,Dc,X,Y, []).
%% @spec (This::wxImageList(), Index::integer(), Dc::wxDC:wxDC(), X::integer(), Y::integer(), [Option]) -> bool()
%% Option = {flags, integer()} | {solidBackground, bool()}
%% @doc See external documentation.
draw(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=DcT,ref=DcRef},X,Y, Options)
when is_integer(Index),is_integer(X),is_integer(Y),is_list(Options) ->
?CLASS(ThisT,wxImageList),
?CLASS(DcT,wxDC),
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
({solidBackground, SolidBackground}, Acc) -> [<<2:32/?UI,(wxe_util:from_bool(SolidBackground)):32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:call(?wxImageList_Draw,
<>).
%% @spec (This::wxImageList(), Index::integer()) -> wxBitmap:wxBitmap()
%% @doc See external documentation.
getBitmap(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetBitmap,
<>).
%% @spec (This::wxImageList(), Index::integer()) -> wxIcon:wxIcon()
%% @doc See external documentation.
getIcon(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetIcon,
<>).
%% @spec (This::wxImageList()) -> integer()
%% @doc See external documentation.
getImageCount(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetImageCount,
<>).
%% @spec (This::wxImageList(), Index::integer()) -> {bool(),Width::integer(),Height::integer()}
%% @doc See external documentation.
getSize(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_GetSize,
<>).
%% @spec (This::wxImageList(), Index::integer()) -> bool()
%% @doc See external documentation.
remove(#wx_ref{type=ThisT,ref=ThisRef},Index)
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_Remove,
<>).
%% @spec (This::wxImageList()) -> bool()
%% @doc See external documentation.
removeAll(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxImageList),
wxe_util:call(?wxImageList_RemoveAll,
<>).
%% @spec (This::wxImageList(), Index::integer(), Bitmap::wxBitmap:wxBitmap()) -> bool()
%% @doc See external documentation.
replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=BitmapT,ref=BitmapRef})
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
?CLASS(BitmapT,wxBitmap),
wxe_util:call(?wxImageList_Replace_2,
<>).
%% @spec (This::wxImageList(), Index::integer(), Bitmap::wxBitmap:wxBitmap(), Mask::wxBitmap:wxBitmap()) -> bool()
%% @doc See external documentation.
replace(#wx_ref{type=ThisT,ref=ThisRef},Index,#wx_ref{type=BitmapT,ref=BitmapRef},#wx_ref{type=MaskT,ref=MaskRef})
when is_integer(Index) ->
?CLASS(ThisT,wxImageList),
?CLASS(BitmapT,wxBitmap),
?CLASS(MaskT,wxBitmap),
wxe_util:call(?wxImageList_Replace_3,
<>).
%% @spec (This::wxImageList()) -> ok
%% @doc Destroys this object, do not use object again
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxImageList),
wxe_util:destroy(?DESTROY_OBJECT,Obj),
ok.