Version: 3.3.0
wxItemAttr Class Reference

#include <wx/itemattr.h>

Detailed Description

Represents the attributes (colour, font, ...) of an item of a control with multiple items such as e.g.

wxListCtrl.

Library:  wxCore
Category:  Data Structures
See also
wxListCtrl Overview
Since
3.1.1 (previous versions had a similar wxListItemAttr class)

Public Member Functions

 wxItemAttr ()
 Default Constructor. More...
 
 wxItemAttr (const wxColour &colText, const wxColour &colBack, const wxFont &font)
 Construct a wxItemAttr with the specified foreground and background colours and font. More...
 
bool operator== (const wxItemAttr &other) const
 Compare two item attributes for equality. More...
 
bool operator!= (const wxItemAttr &other) const
 Compare two item attributes for inequality. More...
 
const wxColourGetBackgroundColour () const
 Returns the currently set background colour. More...
 
const wxFontGetFont () const
 Returns the currently set font. More...
 
const wxColourGetTextColour () const
 Returns the currently set text colour. More...
 
bool HasBackgroundColour () const
 Returns true if the currently set background colour is valid. More...
 
bool HasColours () const
 Returns true if either text or background colour is set. More...
 
bool HasFont () const
 Returns true if the currently set font is valid. More...
 
bool HasTextColour () const
 Returns true if the currently set text colour is valid. More...
 
bool IsDefault () const
 Returns true if this object has no custom attributes set. More...
 
void SetBackgroundColour (const wxColour &colour)
 Sets a new background colour. More...
 
void SetFont (const wxFont &font)
 Sets a new font. More...
 
void SetTextColour (const wxColour &colour)
 Sets a new text colour. More...
 

Constructor & Destructor Documentation

◆ wxItemAttr() [1/2]

wxItemAttr::wxItemAttr ( )

Default Constructor.

◆ wxItemAttr() [2/2]

wxItemAttr::wxItemAttr ( const wxColour colText,
const wxColour colBack,
const wxFont font 
)

Construct a wxItemAttr with the specified foreground and background colours and font.

Member Function Documentation

◆ GetBackgroundColour()

const wxColour& wxItemAttr::GetBackgroundColour ( ) const

Returns the currently set background colour.

◆ GetFont()

const wxFont& wxItemAttr::GetFont ( ) const

Returns the currently set font.

◆ GetTextColour()

const wxColour& wxItemAttr::GetTextColour ( ) const

Returns the currently set text colour.

◆ HasBackgroundColour()

bool wxItemAttr::HasBackgroundColour ( ) const

Returns true if the currently set background colour is valid.

◆ HasColours()

bool wxItemAttr::HasColours ( ) const

Returns true if either text or background colour is set.

See also
HasBackgroundColour(), HasTextColour()

◆ HasFont()

bool wxItemAttr::HasFont ( ) const

Returns true if the currently set font is valid.

◆ HasTextColour()

bool wxItemAttr::HasTextColour ( ) const

Returns true if the currently set text colour is valid.

◆ IsDefault()

bool wxItemAttr::IsDefault ( ) const

Returns true if this object has no custom attributes set.

◆ operator!=()

bool wxItemAttr::operator!= ( const wxItemAttr other) const

Compare two item attributes for inequality.

◆ operator==()

bool wxItemAttr::operator== ( const wxItemAttr other) const

Compare two item attributes for equality.

◆ SetBackgroundColour()

void wxItemAttr::SetBackgroundColour ( const wxColour colour)

Sets a new background colour.

◆ SetFont()

void wxItemAttr::SetFont ( const wxFont font)

Sets a new font.

◆ SetTextColour()

void wxItemAttr::SetTextColour ( const wxColour colour)

Sets a new text colour.