Version: 3.1.3
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::wxItemAttr ( )

Default Constructor.

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

const wxColour& wxItemAttr::GetBackgroundColour ( ) const

Returns the currently set background colour.

const wxFont& wxItemAttr::GetFont ( ) const

Returns the currently set font.

const wxColour& wxItemAttr::GetTextColour ( ) const

Returns the currently set text colour.

bool wxItemAttr::HasBackgroundColour ( ) const

Returns true if the currently set background colour is valid.

bool wxItemAttr::HasColours ( ) const

Returns true if either text or background colour is set.

See also
HasBackgroundColour(), HasTextColour()
bool wxItemAttr::HasFont ( ) const

Returns true if the currently set font is valid.

bool wxItemAttr::HasTextColour ( ) const

Returns true if the currently set text colour is valid.

bool wxItemAttr::IsDefault ( ) const

Returns true if this object has no custom attributes set.

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

Compare two item attributes for inequality.

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

Compare two item attributes for equality.

void wxItemAttr::SetBackgroundColour ( const wxColour colour)

Sets a new background colour.

void wxItemAttr::SetFont ( const wxFont font)

Sets a new font.

void wxItemAttr::SetTextColour ( const wxColour colour)

Sets a new text colour.