Add possibility to set item background in generic wxDataViewCtrl.

Added wxDataViewItemAttr::SetBackgroundColour() and code to honour it in the
generic implementation of wxDataViewCtrl.

Closes #12621.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-12-19 12:54:38 +00:00
parent 02106526ea
commit 1c959a62ce
6 changed files with 63 additions and 2 deletions

View File

@@ -143,6 +143,7 @@ public:
void SetColour(const wxColour& colour) { m_colour = colour; }
void SetBold( bool set ) { m_bold = set; }
void SetItalic( bool set ) { m_italic = set; }
void SetBackgroundColour(const wxColour& colour) { m_bgColour = colour; }
// accessors
bool HasColour() const { return m_colour.IsOk(); }
@@ -152,7 +153,10 @@ public:
bool GetBold() const { return m_bold; }
bool GetItalic() const { return m_italic; }
bool IsDefault() const { return !(HasColour() || HasFont()); }
bool HasBackgroundColour() const { return m_bgColour.IsOk(); }
const wxColour& GetBackgroundColour() const { return m_bgColour; }
bool IsDefault() const { return !(HasColour() || HasFont() || HasBackgroundColour()); }
// Return the font based on the given one with this attribute applied to it.
wxFont GetEffectiveFont(const wxFont& font) const;
@@ -161,6 +165,7 @@ private:
wxColour m_colour;
bool m_bold;
bool m_italic;
wxColour m_bgColour;
};