2016-04-16 11:44:19 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/itemattr.h
|
|
|
|
// Purpose: wxItemAttr documentation
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Copyright: (c) 2016 Vadim Zeitlin <vadim@wxwidgets.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxItemAttr
|
|
|
|
|
2016-04-17 11:20:47 -04:00
|
|
|
Represents the attributes (colour, font, ...) of an item of a control with
|
2016-04-16 11:44:19 -04:00
|
|
|
multiple items such as e.g. wxListCtrl.
|
|
|
|
|
|
|
|
@library{wxcore}
|
|
|
|
@category{data}
|
|
|
|
|
|
|
|
@see @ref overview_listctrl
|
|
|
|
|
2016-04-17 11:19:20 -04:00
|
|
|
@since 3.1.1 (previous versions had a similar wxListItemAttr class)
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
class wxItemAttr
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Default Constructor.
|
|
|
|
*/
|
|
|
|
wxItemAttr();
|
|
|
|
|
|
|
|
/**
|
|
|
|
Construct a wxItemAttr with the specified foreground and
|
2016-04-17 11:20:47 -04:00
|
|
|
background colours and font.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
wxItemAttr(const wxColour& colText,
|
|
|
|
const wxColour& colBack,
|
|
|
|
const wxFont& font);
|
|
|
|
|
2016-04-17 11:36:20 -04:00
|
|
|
/**
|
|
|
|
Compare two item attributes for equality.
|
|
|
|
*/
|
|
|
|
bool operator==(const wxItemAttr& other) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Compare two item attributes for inequality.
|
|
|
|
*/
|
|
|
|
bool operator!=(const wxItemAttr& other) const;
|
|
|
|
|
2016-04-16 11:44:19 -04:00
|
|
|
/**
|
2016-04-17 11:20:47 -04:00
|
|
|
Returns the currently set background colour.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
const wxColour& GetBackgroundColour() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the currently set font.
|
|
|
|
*/
|
|
|
|
const wxFont& GetFont() const;
|
|
|
|
|
|
|
|
/**
|
2016-04-17 11:20:47 -04:00
|
|
|
Returns the currently set text colour.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
const wxColour& GetTextColour() const;
|
|
|
|
|
|
|
|
/**
|
2016-04-17 11:20:47 -04:00
|
|
|
Returns @true if the currently set background colour is valid.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
bool HasBackgroundColour() const;
|
|
|
|
|
2016-04-17 11:19:20 -04:00
|
|
|
/**
|
|
|
|
Returns @true if either text or background colour is set.
|
|
|
|
|
|
|
|
@see HasBackgroundColour(), HasTextColour()
|
|
|
|
*/
|
|
|
|
bool HasColours() const;
|
|
|
|
|
2016-04-16 11:44:19 -04:00
|
|
|
/**
|
|
|
|
Returns @true if the currently set font is valid.
|
|
|
|
*/
|
|
|
|
bool HasFont() const;
|
|
|
|
|
|
|
|
/**
|
2016-04-17 11:20:47 -04:00
|
|
|
Returns @true if the currently set text colour is valid.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
bool HasTextColour() const;
|
|
|
|
|
2016-04-17 11:19:20 -04:00
|
|
|
/**
|
|
|
|
Returns @true if this object has no custom attributes set.
|
|
|
|
*/
|
|
|
|
bool IsDefault() const;
|
|
|
|
|
2016-04-16 11:44:19 -04:00
|
|
|
/**
|
2016-04-17 11:20:47 -04:00
|
|
|
Sets a new background colour.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
void SetBackgroundColour(const wxColour& colour);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets a new font.
|
|
|
|
*/
|
|
|
|
void SetFont(const wxFont& font);
|
|
|
|
|
|
|
|
/**
|
2016-04-17 11:20:47 -04:00
|
|
|
Sets a new text colour.
|
2016-04-16 11:44:19 -04:00
|
|
|
*/
|
|
|
|
void SetTextColour(const wxColour& colour);
|
|
|
|
};
|