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_wxtextattr.html">wxTextAttr</a>.
21
%% @type wxTextAttr(). 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,getAlignment/1,getBackgroundColour/1,getFlags/1,getFont/1,
28
getLeftIndent/1,getLeftSubIndent/1,getRightIndent/1,getTabs/1,getTextColour/1,
29
hasBackgroundColour/1,hasFont/1,hasTextColour/1,isDefault/1,new/0,
30
new/1,new/2,setAlignment/2,setBackgroundColour/2,setFlags/2,setFont/2,
31
setFont/3,setLeftIndent/2,setLeftIndent/3,setRightIndent/2,setTabs/2,
35
-export([parent_class/1]).
38
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
40
%% @spec () -> wxTextAttr()
41
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrwxtextattr">external documentation</a>.
43
wxe_util:construct(?wxTextAttr_new_0,
46
%% @spec (ColText::wx:colour()) -> wxTextAttr()
47
%% @equiv new(ColText, [])
49
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
52
%% @spec (ColText::wx:colour(), [Option]) -> wxTextAttr()
53
%% Option = {colBack, wx:colour()} | {font, wxFont:wxFont()} | {alignment, WxTextAttrAlignment}
54
%% WxTextAttrAlignment = integer()
55
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrwxtextattr">external documentation</a>.
56
%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
58
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4,is_list(Options) ->
59
MOpts = fun({colBack, ColBack}, Acc) -> [<<1:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary,0:32>>|Acc];
60
({font, #wx_ref{type=FontT,ref=FontRef}}, Acc) -> ?CLASS(FontT,wxFont),[<<2:32/?UI,FontRef:32/?UI>>|Acc];
61
({alignment, Alignment}, Acc) -> [<<3:32/?UI,Alignment:32/?UI>>|Acc];
62
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
63
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
64
wxe_util:construct(?wxTextAttr_new_2,
65
<<(wxe_util:colour_bin(ColText)):16/binary, BinOpt/binary>>).
67
%% @spec (This::wxTextAttr()) -> WxTextAttrAlignment
68
%% WxTextAttrAlignment = integer()
69
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetalignment">external documentation</a>.
70
%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
71
getAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
72
?CLASS(ThisT,wxTextAttr),
73
wxe_util:call(?wxTextAttr_GetAlignment,
76
%% @spec (This::wxTextAttr()) -> wx:colour()
77
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetbackgroundcolour">external documentation</a>.
78
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
79
?CLASS(ThisT,wxTextAttr),
80
wxe_util:call(?wxTextAttr_GetBackgroundColour,
83
%% @spec (This::wxTextAttr()) -> wxFont:wxFont()
84
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetfont">external documentation</a>.
85
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
86
?CLASS(ThisT,wxTextAttr),
87
wxe_util:call(?wxTextAttr_GetFont,
90
%% @spec (This::wxTextAttr()) -> integer()
91
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetleftindent">external documentation</a>.
92
getLeftIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
93
?CLASS(ThisT,wxTextAttr),
94
wxe_util:call(?wxTextAttr_GetLeftIndent,
97
%% @spec (This::wxTextAttr()) -> integer()
98
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetleftsubindent">external documentation</a>.
99
getLeftSubIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
100
?CLASS(ThisT,wxTextAttr),
101
wxe_util:call(?wxTextAttr_GetLeftSubIndent,
104
%% @spec (This::wxTextAttr()) -> integer()
105
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetrightindent">external documentation</a>.
106
getRightIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
107
?CLASS(ThisT,wxTextAttr),
108
wxe_util:call(?wxTextAttr_GetRightIndent,
111
%% @spec (This::wxTextAttr()) -> [integer()]
112
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgettabs">external documentation</a>.
113
getTabs(#wx_ref{type=ThisT,ref=ThisRef}) ->
114
?CLASS(ThisT,wxTextAttr),
115
wxe_util:call(?wxTextAttr_GetTabs,
118
%% @spec (This::wxTextAttr()) -> wx:colour()
119
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgettextcolour">external documentation</a>.
120
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
121
?CLASS(ThisT,wxTextAttr),
122
wxe_util:call(?wxTextAttr_GetTextColour,
125
%% @spec (This::wxTextAttr()) -> bool()
126
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhasbackgroundcolour">external documentation</a>.
127
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
128
?CLASS(ThisT,wxTextAttr),
129
wxe_util:call(?wxTextAttr_HasBackgroundColour,
132
%% @spec (This::wxTextAttr()) -> bool()
133
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhasfont">external documentation</a>.
134
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
135
?CLASS(ThisT,wxTextAttr),
136
wxe_util:call(?wxTextAttr_HasFont,
139
%% @spec (This::wxTextAttr()) -> bool()
140
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrhastextcolour">external documentation</a>.
141
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
142
?CLASS(ThisT,wxTextAttr),
143
wxe_util:call(?wxTextAttr_HasTextColour,
146
%% @spec (This::wxTextAttr()) -> integer()
147
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrgetflags">external documentation</a>.
148
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
149
?CLASS(ThisT,wxTextAttr),
150
wxe_util:call(?wxTextAttr_GetFlags,
153
%% @spec (This::wxTextAttr()) -> bool()
154
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrisdefault">external documentation</a>.
155
isDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
156
?CLASS(ThisT,wxTextAttr),
157
wxe_util:call(?wxTextAttr_IsDefault,
160
%% @spec (This::wxTextAttr(), Alignment::WxTextAttrAlignment) -> ok
161
%% WxTextAttrAlignment = integer()
162
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetalignment">external documentation</a>.
163
%%<br /> WxTextAttrAlignment is one of ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
164
setAlignment(#wx_ref{type=ThisT,ref=ThisRef},Alignment)
165
when is_integer(Alignment) ->
166
?CLASS(ThisT,wxTextAttr),
167
wxe_util:cast(?wxTextAttr_SetAlignment,
168
<<ThisRef:32/?UI,Alignment:32/?UI>>).
170
%% @spec (This::wxTextAttr(), ColBack::wx:colour()) -> ok
171
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetbackgroundcolour">external documentation</a>.
172
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
173
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
174
?CLASS(ThisT,wxTextAttr),
175
wxe_util:cast(?wxTextAttr_SetBackgroundColour,
176
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary>>).
178
%% @spec (This::wxTextAttr(), Flags::integer()) -> ok
179
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetflags">external documentation</a>.
180
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
181
when is_integer(Flags) ->
182
?CLASS(ThisT,wxTextAttr),
183
wxe_util:cast(?wxTextAttr_SetFlags,
184
<<ThisRef:32/?UI,Flags:32/?UI>>).
186
%% @spec (This::wxTextAttr(), Font::wxFont:wxFont()) -> ok
187
%% @equiv setFont(This,Font, [])
189
when is_record(This, wx_ref),is_record(Font, wx_ref) ->
190
setFont(This,Font, []).
192
%% @spec (This::wxTextAttr(), Font::wxFont:wxFont(), [Option]) -> ok
193
%% Option = {flags, integer()}
194
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetfont">external documentation</a>.
195
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options)
196
when is_list(Options) ->
197
?CLASS(ThisT,wxTextAttr),
198
?CLASS(FontT,wxFont),
199
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
200
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
201
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
202
wxe_util:cast(?wxTextAttr_SetFont,
203
<<ThisRef:32/?UI,FontRef:32/?UI, BinOpt/binary>>).
205
%% @spec (This::wxTextAttr(), Indent::integer()) -> ok
206
%% @equiv setLeftIndent(This,Indent, [])
207
setLeftIndent(This,Indent)
208
when is_record(This, wx_ref),is_integer(Indent) ->
209
setLeftIndent(This,Indent, []).
211
%% @spec (This::wxTextAttr(), Indent::integer(), [Option]) -> ok
212
%% Option = {subIndent, integer()}
213
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetleftindent">external documentation</a>.
214
setLeftIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent, Options)
215
when is_integer(Indent),is_list(Options) ->
216
?CLASS(ThisT,wxTextAttr),
217
MOpts = fun({subIndent, SubIndent}, Acc) -> [<<1:32/?UI,SubIndent:32/?UI>>|Acc];
218
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
219
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
220
wxe_util:cast(?wxTextAttr_SetLeftIndent,
221
<<ThisRef:32/?UI,Indent:32/?UI, BinOpt/binary>>).
223
%% @spec (This::wxTextAttr(), Indent::integer()) -> ok
224
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsetrightindent">external documentation</a>.
225
setRightIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent)
226
when is_integer(Indent) ->
227
?CLASS(ThisT,wxTextAttr),
228
wxe_util:cast(?wxTextAttr_SetRightIndent,
229
<<ThisRef:32/?UI,Indent:32/?UI>>).
231
%% @spec (This::wxTextAttr(), Tabs::[integer()]) -> ok
232
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsettabs">external documentation</a>.
233
setTabs(#wx_ref{type=ThisT,ref=ThisRef},Tabs)
234
when is_list(Tabs) ->
235
?CLASS(ThisT,wxTextAttr),
236
wxe_util:cast(?wxTextAttr_SetTabs,
237
<<ThisRef:32/?UI,(length(Tabs)):32/?UI,
238
(<< <<C:32/?I>> || C <- Tabs>>)/binary, 0:(((0+length(Tabs)) rem 2)*32)>>).
240
%% @spec (This::wxTextAttr(), ColText::wx:colour()) -> ok
241
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxtextattr.html#wxtextattrsettextcolour">external documentation</a>.
242
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
243
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
244
?CLASS(ThisT,wxTextAttr),
245
wxe_util:cast(?wxTextAttr_SetTextColour,
246
<<ThisRef:32/?UI,(wxe_util:colour_bin(ColText)):16/binary>>).
248
%% @spec (This::wxTextAttr()) -> ok
249
%% @doc Destroys this object, do not use object again
250
destroy(Obj=#wx_ref{type=Type}) ->
251
?CLASS(Type,wxTextAttr),
252
wxe_util:destroy(?wxTextAttr_destroy,Obj),