%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%
%% %CopyrightEnd%
%% This file is generated DO NOT EDIT
%% @doc See external documentation: wxTextAttr.
%% @type wxTextAttr(). An object reference, The representation is internal
%% and can be changed without notice. It can't be used for comparsion
%% stored on disc or distributed for use on other nodes.
-module(wxTextAttr).
-include("wxe.hrl").
-export([destroy/1,getAlignment/1,getBackgroundColour/1,getFlags/1,getFont/1,
getLeftIndent/1,getLeftSubIndent/1,getRightIndent/1,getTabs/1,getTextColour/1,
hasBackgroundColour/1,hasFont/1,hasTextColour/1,isDefault/1,new/0,
new/1,new/2,setAlignment/2,setBackgroundColour/2,setFlags/2,setFont/2,
setFont/3,setLeftIndent/2,setLeftIndent/3,setRightIndent/2,setTabs/2,
setTextColour/2]).
%% inherited exports
-export([parent_class/1]).
-export_type([wxTextAttr/0]).
%% @hidden
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
-type wxTextAttr() :: wx:wx_object().
%% @doc See external documentation.
-spec new() -> wxTextAttr().
new() ->
wxe_util:construct(?wxTextAttr_new_0,
<<>>).
%% @equiv new(ColText, [])
-spec new(ColText) -> wxTextAttr() when
ColText::wx:wx_colour().
new(ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
new(ColText, []).
%% @doc See external documentation.
%%
Alignment = ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
-spec new(ColText, [Option]) -> wxTextAttr() when
ColText::wx:wx_colour(),
Option :: {'colBack', wx:wx_colour()}
| {'font', wxFont:wxFont()}
| {'alignment', wx:wx_enum()}.
new(ColText, Options)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4,is_list(Options) ->
MOpts = fun({colBack, ColBack}, Acc) -> [<<1:32/?UI,(wxe_util:colour_bin(ColBack)):16/binary,0:32>>|Acc];
({font, #wx_ref{type=FontT,ref=FontRef}}, Acc) -> ?CLASS(FontT,wxFont),[<<2:32/?UI,FontRef:32/?UI>>|Acc];
({alignment, Alignment}, Acc) -> [<<3:32/?UI,Alignment:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:construct(?wxTextAttr_new_2,
<<(wxe_util:colour_bin(ColText)):16/binary, BinOpt/binary>>).
%% @doc See external documentation.
%%
Res = ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
-spec getAlignment(This) -> wx:wx_enum() when
This::wxTextAttr().
getAlignment(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetAlignment,
<>).
%% @doc See external documentation.
-spec getBackgroundColour(This) -> wx:wx_colour4() when
This::wxTextAttr().
getBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetBackgroundColour,
<>).
%% @doc See external documentation.
-spec getFont(This) -> wxFont:wxFont() when
This::wxTextAttr().
getFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetFont,
<>).
%% @doc See external documentation.
-spec getLeftIndent(This) -> integer() when
This::wxTextAttr().
getLeftIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetLeftIndent,
<>).
%% @doc See external documentation.
-spec getLeftSubIndent(This) -> integer() when
This::wxTextAttr().
getLeftSubIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetLeftSubIndent,
<>).
%% @doc See external documentation.
-spec getRightIndent(This) -> integer() when
This::wxTextAttr().
getRightIndent(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetRightIndent,
<>).
%% @doc See external documentation.
-spec getTabs(This) -> [integer()] when
This::wxTextAttr().
getTabs(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetTabs,
<>).
%% @doc See external documentation.
-spec getTextColour(This) -> wx:wx_colour4() when
This::wxTextAttr().
getTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetTextColour,
<>).
%% @doc See external documentation.
-spec hasBackgroundColour(This) -> boolean() when
This::wxTextAttr().
hasBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_HasBackgroundColour,
<>).
%% @doc See external documentation.
-spec hasFont(This) -> boolean() when
This::wxTextAttr().
hasFont(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_HasFont,
<>).
%% @doc See external documentation.
-spec hasTextColour(This) -> boolean() when
This::wxTextAttr().
hasTextColour(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_HasTextColour,
<>).
%% @doc See external documentation.
-spec getFlags(This) -> integer() when
This::wxTextAttr().
getFlags(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_GetFlags,
<>).
%% @doc See external documentation.
-spec isDefault(This) -> boolean() when
This::wxTextAttr().
isDefault(#wx_ref{type=ThisT,ref=ThisRef}) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:call(?wxTextAttr_IsDefault,
<>).
%% @doc See external documentation.
%%
Alignment = ?wxTEXT_ALIGNMENT_DEFAULT | ?wxTEXT_ALIGNMENT_LEFT | ?wxTEXT_ALIGNMENT_CENTRE | ?wxTEXT_ALIGNMENT_CENTER | ?wxTEXT_ALIGNMENT_RIGHT | ?wxTEXT_ALIGNMENT_JUSTIFIED
-spec setAlignment(This, Alignment) -> 'ok' when
This::wxTextAttr(), Alignment::wx:wx_enum().
setAlignment(#wx_ref{type=ThisT,ref=ThisRef},Alignment)
when is_integer(Alignment) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetAlignment,
<>).
%% @doc See external documentation.
-spec setBackgroundColour(This, ColBack) -> 'ok' when
This::wxTextAttr(), ColBack::wx:wx_colour().
setBackgroundColour(#wx_ref{type=ThisT,ref=ThisRef},ColBack)
when tuple_size(ColBack) =:= 3; tuple_size(ColBack) =:= 4 ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetBackgroundColour,
<>).
%% @doc See external documentation.
-spec setFlags(This, Flags) -> 'ok' when
This::wxTextAttr(), Flags::integer().
setFlags(#wx_ref{type=ThisT,ref=ThisRef},Flags)
when is_integer(Flags) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetFlags,
<>).
%% @equiv setFont(This,Font, [])
-spec setFont(This, Font) -> 'ok' when
This::wxTextAttr(), Font::wxFont:wxFont().
setFont(This,Font)
when is_record(This, wx_ref),is_record(Font, wx_ref) ->
setFont(This,Font, []).
%% @doc See external documentation.
-spec setFont(This, Font, [Option]) -> 'ok' when
This::wxTextAttr(), Font::wxFont:wxFont(),
Option :: {'flags', integer()}.
setFont(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=FontT,ref=FontRef}, Options)
when is_list(Options) ->
?CLASS(ThisT,wxTextAttr),
?CLASS(FontT,wxFont),
MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxTextAttr_SetFont,
<>).
%% @equiv setLeftIndent(This,Indent, [])
-spec setLeftIndent(This, Indent) -> 'ok' when
This::wxTextAttr(), Indent::integer().
setLeftIndent(This,Indent)
when is_record(This, wx_ref),is_integer(Indent) ->
setLeftIndent(This,Indent, []).
%% @doc See external documentation.
-spec setLeftIndent(This, Indent, [Option]) -> 'ok' when
This::wxTextAttr(), Indent::integer(),
Option :: {'subIndent', integer()}.
setLeftIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent, Options)
when is_integer(Indent),is_list(Options) ->
?CLASS(ThisT,wxTextAttr),
MOpts = fun({subIndent, SubIndent}, Acc) -> [<<1:32/?UI,SubIndent:32/?UI>>|Acc];
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
wxe_util:cast(?wxTextAttr_SetLeftIndent,
<>).
%% @doc See external documentation.
-spec setRightIndent(This, Indent) -> 'ok' when
This::wxTextAttr(), Indent::integer().
setRightIndent(#wx_ref{type=ThisT,ref=ThisRef},Indent)
when is_integer(Indent) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetRightIndent,
<>).
%% @doc See external documentation.
-spec setTabs(This, Tabs) -> 'ok' when
This::wxTextAttr(), Tabs::[integer()].
setTabs(#wx_ref{type=ThisT,ref=ThisRef},Tabs)
when is_list(Tabs) ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetTabs,
<> || C <- Tabs>>)/binary, 0:(((0+length(Tabs)) rem 2)*32)>>).
%% @doc See external documentation.
-spec setTextColour(This, ColText) -> 'ok' when
This::wxTextAttr(), ColText::wx:wx_colour().
setTextColour(#wx_ref{type=ThisT,ref=ThisRef},ColText)
when tuple_size(ColText) =:= 3; tuple_size(ColText) =:= 4 ->
?CLASS(ThisT,wxTextAttr),
wxe_util:cast(?wxTextAttr_SetTextColour,
<>).
%% @doc Destroys this object, do not use object again
-spec destroy(This::wxTextAttr()) -> 'ok'.
destroy(Obj=#wx_ref{type=Type}) ->
?CLASS(Type,wxTextAttr),
wxe_util:destroy(?wxTextAttr_destroy,Obj),
ok.