4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
18
%% This file is generated DO NOT EDIT
20
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html">wxBrush</a>.
21
%% @type wxBrush(). An object reference, The representation is internal
22
%% and can be changed without notice. It can't be used for comparsion
23
%% stored on disc or distributed for use on other nodes.
27
-export([destroy/1,getColour/1,getStipple/1,getStyle/1,isHatch/1,isOk/1,new/0,
28
new/1,new/2,setColour/2,setColour/4,setStipple/2,setStyle/2]).
31
-export([parent_class/1]).
34
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
36
%% @spec () -> wxBrush()
37
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
39
wxe_util:construct(?wxBrush_new_0,
42
%% @spec (X::term()) -> wxBrush()
43
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
44
%% <br /> Alternatives:
46
%% new(Colour::wx:colour()) -> new(Colour, []) </c></p>
48
%% new(StippleBitmap::wxBitmap:wxBitmap()) -> wxBrush() </c>
52
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4 ->
54
new(#wx_ref{type=StippleBitmapT,ref=StippleBitmapRef}) ->
55
?CLASS(StippleBitmapT,wxBitmap),
56
wxe_util:construct(?wxBrush_new_1,
57
<<StippleBitmapRef:32/?UI>>).
59
%% @spec (Colour::wx:colour(), [Option]) -> wxBrush()
60
%% Option = {style, integer()}
61
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushwxbrush">external documentation</a>.
63
when tuple_size(Colour) =:= 3; tuple_size(Colour) =:= 4,is_list(Options) ->
64
MOpts = fun({style, Style}, Acc) -> [<<1:32/?UI,Style:32/?UI>>|Acc];
65
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
66
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
67
wxe_util:construct(?wxBrush_new_2,
68
<<(wxe_util:colour_bin(Colour)):16/binary, BinOpt/binary>>).
70
%% @spec (This::wxBrush()) -> wx:colour()
71
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushgetcolour">external documentation</a>.
72
getColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
73
?CLASS(ThisT,wxBrush),
74
wxe_util:call(?wxBrush_GetColour,
77
%% @spec (This::wxBrush()) -> wxBitmap:wxBitmap()
78
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushgetstipple">external documentation</a>.
79
getStipple(#wx_ref{type=ThisT,ref=ThisRef}) ->
80
?CLASS(ThisT,wxBrush),
81
wxe_util:call(?wxBrush_GetStipple,
84
%% @spec (This::wxBrush()) -> integer()
85
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushgetstyle">external documentation</a>.
86
getStyle(#wx_ref{type=ThisT,ref=ThisRef}) ->
87
?CLASS(ThisT,wxBrush),
88
wxe_util:call(?wxBrush_GetStyle,
91
%% @spec (This::wxBrush()) -> bool()
92
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushishatch">external documentation</a>.
93
isHatch(#wx_ref{type=ThisT,ref=ThisRef}) ->
94
?CLASS(ThisT,wxBrush),
95
wxe_util:call(?wxBrush_IsHatch,
98
%% @spec (This::wxBrush()) -> bool()
99
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushisok">external documentation</a>.
100
isOk(#wx_ref{type=ThisT,ref=ThisRef}) ->
101
?CLASS(ThisT,wxBrush),
102
wxe_util:call(?wxBrush_IsOk,
105
%% @spec (This::wxBrush(), Col::wx:colour()) -> ok
106
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetcolour">external documentation</a>.
107
setColour(#wx_ref{type=ThisT,ref=ThisRef},Col)
108
when tuple_size(Col) =:= 3; tuple_size(Col) =:= 4 ->
109
?CLASS(ThisT,wxBrush),
110
wxe_util:cast(?wxBrush_SetColour_1,
111
<<ThisRef:32/?UI,(wxe_util:colour_bin(Col)):16/binary>>).
113
%% @spec (This::wxBrush(), R::integer(), G::integer(), B::integer()) -> ok
114
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetcolour">external documentation</a>.
115
setColour(#wx_ref{type=ThisT,ref=ThisRef},R,G,B)
116
when is_integer(R),is_integer(G),is_integer(B) ->
117
?CLASS(ThisT,wxBrush),
118
wxe_util:cast(?wxBrush_SetColour_3,
119
<<ThisRef:32/?UI,R:32/?UI,G:32/?UI,B:32/?UI>>).
121
%% @spec (This::wxBrush(), Stipple::wxBitmap:wxBitmap()) -> ok
122
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetstipple">external documentation</a>.
123
setStipple(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=StippleT,ref=StippleRef}) ->
124
?CLASS(ThisT,wxBrush),
125
?CLASS(StippleT,wxBitmap),
126
wxe_util:cast(?wxBrush_SetStipple,
127
<<ThisRef:32/?UI,StippleRef:32/?UI>>).
129
%% @spec (This::wxBrush(), Style::integer()) -> ok
130
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxbrush.html#wxbrushsetstyle">external documentation</a>.
131
setStyle(#wx_ref{type=ThisT,ref=ThisRef},Style)
132
when is_integer(Style) ->
133
?CLASS(ThisT,wxBrush),
134
wxe_util:cast(?wxBrush_SetStyle,
135
<<ThisRef:32/?UI,Style:32/?UI>>).
137
%% @spec (This::wxBrush()) -> ok
138
%% @doc Destroys this object, do not use object again
139
destroy(Obj=#wx_ref{type=Type}) ->
140
?CLASS(Type,wxBrush),
141
wxe_util:destroy(?DESTROY_OBJECT,Obj),