wxTextAttr represents the character and paragraph attributes, or style, for a range
of text in a wxTextCtrl or wxRichTextCtrl (not implemented in wx).
When setting up a wxTextAttr object, pass a bitlist mask to setFlags/2 to indicate which style
elements should be changed. As a convenience, when you call a setter such as SetFont, the
relevant bit will be set.
See: wxTextCtrl
wxWidgets docs: wxTextAttr
Summary
Functions
Destroys the object
Returns the alignment flags.
Returns the background colour.
Returns flags indicating which attributes are applicable.
Creates and returns a font specified by the font attributes in the wxTextAttr object.
Returns the font encoding.
Returns the font face name.
Returns the font size in points.
Returns the font style.
Returns true if the font is underlined.
Returns the font weight.
Returns the left indent in tenths of a millimetre.
Returns the left sub-indent in tenths of a millimetre.
Returns the right indent in tenths of a millimeter.
Returns an array of tab stops, each expressed in tenths of a millimeter.
Returns the text foreground colour.
Returns true if the attribute object specifies a background colour.
Returns true if the attribute object specifies any font attributes.
Returns true if the attribute object specifies a text foreground colour.
Returns false if we have any attributes set, true otherwise.
Constructors.
Sets the paragraph alignment.
Sets the background colour.
Sets the flags determining which styles are being specified.
Sets the attributes for the given font.
Sets the font encoding.
Sets the font face name.
Sets the font family.
Sets the font size in pixels.
Sets the font size in points.
Sets the font size in points.
Sets the font style (normal, italic or slanted).
Sets the font underlining (solid line, text colour).
Sets the font weight.
Sets the left indent and left subindent in tenths of a millimetre.
Sets the right indent in tenths of a millimetre.
Sets the tab stops, expressed in tenths of a millimetre.
Sets the text foreground colour.
Types
-type wxTextAttr() :: wx:wx_object().
Functions
destroy(This :: wxTextAttr()) -> ok
Destroys the object
getAlignment(This :: wxTextAttr()) -> wx:wx_enum()
Returns the alignment flags.
See ?wxTextAttrAlignment for a list of available styles.
getBackgroundColour(This :: wxTextAttr()) -> wx:wx_colour4()
Returns the background colour.
getFlags(This :: wxTextAttr()) -> integer()
Returns flags indicating which attributes are applicable.
See setFlags/2 for a list of available flags.
getFont(This :: wxTextAttr()) -> wxFont:wxFont()
Creates and returns a font specified by the font attributes in the wxTextAttr object.
Note that wxTextAttr does not store a wxFont object, so this is only a temporary font.
For greater efficiency, access the font attributes directly.
getFontEncoding(This :: wxTextAttr()) -> wx:wx_enum()
Returns the font encoding.
getFontFaceName(This :: wxTextAttr()) -> unicode:charlist()
Returns the font face name.
getFontSize(This :: wxTextAttr()) -> integer()
Returns the font size in points.
getFontStyle(This :: wxTextAttr()) -> wx:wx_enum()
Returns the font style.
getFontUnderlined(This :: wxTextAttr()) -> boolean()
Returns true if the font is underlined.
getFontWeight(This :: wxTextAttr()) -> wx:wx_enum()
Returns the font weight.
getLeftIndent(This :: wxTextAttr()) -> integer()
Returns the left indent in tenths of a millimetre.
getLeftSubIndent(This :: wxTextAttr()) -> integer()
Returns the left sub-indent in tenths of a millimetre.
getRightIndent(This :: wxTextAttr()) -> integer()
Returns the right indent in tenths of a millimeter.
getTabs(This :: wxTextAttr()) -> [integer()]
Returns an array of tab stops, each expressed in tenths of a millimeter.
Each stop is measured from the left margin and therefore each value must be larger than the last.
getTextColour(This :: wxTextAttr()) -> wx:wx_colour4()
Returns the text foreground colour.
hasBackgroundColour(This :: wxTextAttr()) -> boolean()
Returns true if the attribute object specifies a background colour.
hasFont(This :: wxTextAttr()) -> boolean()
Returns true if the attribute object specifies any font attributes.
hasTextColour(This :: wxTextAttr()) -> boolean()
Returns true if the attribute object specifies a text foreground colour.
isDefault(This :: wxTextAttr()) -> boolean()
Returns false if we have any attributes set, true otherwise.
new() -> wxTextAttr()
Constructors.
-spec new(ColText) -> wxTextAttr() when ColText :: wx:wx_colour(); (Attr) -> wxTextAttr() when Attr :: wxTextAttr().
new(ColText :: wx:wx_colour(), Options :: [Option]) -> wxTextAttr()
Types
Option = {colBack, wx:wx_colour()} | {font, wxFont:wxFont()} | {alignment, wx:wx_enum()}
setAlignment(This :: wxTextAttr(), Alignment :: wx:wx_enum()) -> ok
Sets the paragraph alignment.
See ?wxTextAttrAlignment enumeration values.
Of these, wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented. In future justification may be supported when printing or previewing, only.
setBackgroundColour(This :: wxTextAttr(), ColBack :: wx:wx_colour()) -> ok
Sets the background colour.
setFlags(This :: wxTextAttr(), Flags :: integer()) -> ok
Sets the flags determining which styles are being specified.
The ?wxTextAttrFlags values can be passed in a bitlist.
-spec setFont(This, Font) -> ok when This :: wxTextAttr(), Font :: wxFont:wxFont().
-spec setFont(This, Font, [Option]) -> ok when This :: wxTextAttr(), Font :: wxFont:wxFont(), Option :: {flags, integer()}.
Sets the attributes for the given font.
Note that wxTextAttr does not store an actual wxFont object.
setFontEncoding(This :: wxTextAttr(), Encoding :: wx:wx_enum()) -> ok
Sets the font encoding.
setFontFaceName(This :: wxTextAttr(), FaceName :: unicode:chardata()) -> ok
Sets the font face name.
setFontFamily(This :: wxTextAttr(), Family :: wx:wx_enum()) -> ok
Sets the font family.
setFontPixelSize(This :: wxTextAttr(), PixelSize :: integer()) -> ok
Sets the font size in pixels.
setFontPointSize(This :: wxTextAttr(), PointSize :: integer()) -> ok
Sets the font size in points.
setFontSize(This :: wxTextAttr(), PointSize :: integer()) -> ok
Sets the font size in points.
setFontStyle(This :: wxTextAttr(), FontStyle :: wx:wx_enum()) -> ok
Sets the font style (normal, italic or slanted).
setFontUnderlined(This :: wxTextAttr(), Underlined :: boolean()) -> ok
Sets the font underlining (solid line, text colour).
setFontWeight(This :: wxTextAttr(), FontWeight :: wx:wx_enum()) -> ok
Sets the font weight.
-spec setLeftIndent(This, Indent) -> ok when This :: wxTextAttr(), Indent :: integer().
-spec setLeftIndent(This, Indent, [Option]) -> ok when This :: wxTextAttr(), Indent :: integer(), Option :: {subIndent, integer()}.
Sets the left indent and left subindent in tenths of a millimetre.
The sub-indent is an offset from the left of the paragraph, and is used for all but the first line in a paragraph.
A positive value will cause the first line to appear to the left of the subsequent lines, and a negative value will cause the first line to be indented relative to the subsequent lines.
wxRichTextBuffer (not implemented in wx) uses indentation to render a bulleted item.
The left indent is the distance between the margin and the bullet. The content of the
paragraph, including the first line, starts at leftMargin + leftSubIndent. So the distance
between the left edge of the bullet and the left of the actual paragraph is leftSubIndent.
setRightIndent(This :: wxTextAttr(), Indent :: integer()) -> ok
Sets the right indent in tenths of a millimetre.
setTabs(This :: wxTextAttr(), Tabs :: [integer()]) -> ok
Sets the tab stops, expressed in tenths of a millimetre.
Each stop is measured from the left margin and therefore each value must be larger than the last.
setTextColour(This :: wxTextAttr(), ColText :: wx:wx_colour()) -> ok
Sets the text foreground colour.