Replace wxTreeItemAttr and wxListItemAttr with wxItemAttr
The two existing structs were completely identical, just replace them with a single wxItemAttr. Notice that wxDataViewItemAttr is not quite the same, although pretty similar, so it remains separate for now. It would be nice to combine it with this one too in the future, e.g. to make it simpler to make items bold in a wxListCtrl.
This commit is contained in:
@@ -180,40 +180,6 @@ static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
|
||||
// tree ctrl default name
|
||||
extern WXDLLIMPEXP_DATA_CORE(const char) wxTreeCtrlNameStr[];
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeItemAttr: a structure containing the visual attributes of an item
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTreeItemAttr
|
||||
{
|
||||
public:
|
||||
// ctors
|
||||
wxTreeItemAttr() { }
|
||||
wxTreeItemAttr(const wxColour& colText,
|
||||
const wxColour& colBack,
|
||||
const wxFont& font)
|
||||
: m_colText(colText), m_colBack(colBack), m_font(font) { }
|
||||
|
||||
// setters
|
||||
void SetTextColour(const wxColour& colText) { m_colText = colText; }
|
||||
void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
|
||||
void SetFont(const wxFont& font) { m_font = font; }
|
||||
|
||||
// accessors
|
||||
bool HasTextColour() const { return m_colText.IsOk(); }
|
||||
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
|
||||
bool HasFont() const { return m_font.IsOk(); }
|
||||
|
||||
const wxColour& GetTextColour() const { return m_colText; }
|
||||
const wxColour& GetBackgroundColour() const { return m_colBack; }
|
||||
const wxFont& GetFont() const { return m_font; }
|
||||
|
||||
private:
|
||||
wxColour m_colText,
|
||||
m_colBack;
|
||||
wxFont m_font;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTreeEvent is a special class for all events associated with tree controls
|
||||
//
|
||||
|
Reference in New Issue
Block a user