Add wxItemAttr::HasColours() and IsDefault() accessors
They are trivial but useful to have as testing for HasBackgroundColour() || HasTextColour() || HasFont() is too verbose.
This commit is contained in:
@@ -39,6 +39,9 @@ public:
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
|
||||
bool HasFont() const { return m_font.IsOk(); }
|
||||
|
||||
bool HasColours() const { return HasTextColour() || HasBackgroundColour(); }
|
||||
bool IsDefault() const { return !HasColours() && !HasFont(); }
|
||||
|
||||
const wxColour& GetTextColour() const { return m_colText; }
|
||||
const wxColour& GetBackgroundColour() const { return m_colBack; }
|
||||
const wxFont& GetFont() const { return m_font; }
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
@see @ref overview_listctrl
|
||||
|
||||
@since 3.1.1 (previous versions had the identical wxListItemAttr class)
|
||||
@since 3.1.1 (previous versions had a similar wxListItemAttr class)
|
||||
*/
|
||||
class wxItemAttr
|
||||
{
|
||||
@@ -55,6 +55,13 @@ public:
|
||||
*/
|
||||
bool HasBackgroundColour() const;
|
||||
|
||||
/**
|
||||
Returns @true if either text or background colour is set.
|
||||
|
||||
@see HasBackgroundColour(), HasTextColour()
|
||||
*/
|
||||
bool HasColours() const;
|
||||
|
||||
/**
|
||||
Returns @true if the currently set font is valid.
|
||||
*/
|
||||
@@ -65,6 +72,11 @@ public:
|
||||
*/
|
||||
bool HasTextColour() const;
|
||||
|
||||
/**
|
||||
Returns @true if this object has no custom attributes set.
|
||||
*/
|
||||
bool IsDefault() const;
|
||||
|
||||
/**
|
||||
Sets a new background color.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user