## wxTextAttr

wxTextAttr represents the attributes, or style, for a range of text in a wxTextCtrl.

Derived from

No base class

Include files

<wx/textctrl.h>

Members

wxTextAttr::wxTextAttr
wxTextAttr::GetBackgroundColour
wxTextAttr::GetFont
wxTextAttr::GetTextColour
wxTextAttr::HasBackgroundColour
wxTextAttr::HasFont
wxTextAttr::HasTextColour
wxTextAttr::IsDefault

### wxTextAttr::wxTextAttr

wxTextAttr()

wxTextAttr(const wxColour& colText, const wxColour& colBack = wxNullColour, const wxFont& font = wxNullFont)

The constructors initialize one or more of the text foreground and background colours and font. The values not initialized in the constructor can be set later, otherwise wxTextCtrl::SetStyle will use the default values for them.

### wxTextAttr::GetBackgroundColour

const wxColour& GetBackgroundColour() const

Return the background colour specified by this attribute.

### wxTextAttr::GetFont

const wxFont& GetFont() const

Return the text font specified by this attribute.

### wxTextAttr::GetTextColour

const wxColour& GetTextColour() const

Return the text colour specified by this attribute.

### wxTextAttr::HasBackgroundColour

bool HasBackgroundColour() const

Returns `TRUE` if this style specifies the background colour to use.

### wxTextAttr::HasFont

bool HasFont() const

Returns `TRUE` if this style specifies the font to use.

### wxTextAttr::HasTextColour

bool HasTextColour() const

Returns `TRUE` if this style specifies the foreground colour to use.

### wxTextAttr::IsDefault

bool IsDefault() const

Returns `TRUE` if this style specifies any non-default attributes.