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:
@@ -1278,14 +1278,14 @@ protected:
|
||||
@c item or @NULL to use the default appearance parameters.
|
||||
|
||||
wxListCtrl will not delete the pointer or keep a reference of it.
|
||||
You can return the same wxListItemAttr pointer for every OnGetItemAttr() call.
|
||||
You can return the same wxItemAttr pointer for every OnGetItemAttr() call.
|
||||
|
||||
The base class version always returns @NULL.
|
||||
|
||||
@see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText(),
|
||||
OnGetItemColumnAttr()
|
||||
*/
|
||||
virtual wxListItemAttr* OnGetItemAttr(long item) const;
|
||||
virtual wxItemAttr* OnGetItemAttr(long item) const;
|
||||
|
||||
/**
|
||||
This function may be overridden in the derived class for a control with
|
||||
@@ -1302,7 +1302,7 @@ protected:
|
||||
@see OnGetItemAttr(), OnGetItemText(),
|
||||
OnGetItemImage(), OnGetItemColumnImage(),
|
||||
*/
|
||||
virtual wxListItemAttr* OnGetItemColumnAttr(long item, long column) const;
|
||||
virtual wxItemAttr* OnGetItemColumnAttr(long item, long column) const;
|
||||
|
||||
/**
|
||||
Override this function in the derived class for a control with
|
||||
@@ -1513,80 +1513,6 @@ wxEventType wxEVT_LIST_ITEM_CHECKED;
|
||||
wxEventType wxEVT_LIST_ITEM_UNCHECKED;
|
||||
|
||||
|
||||
/**
|
||||
@class wxListItemAttr
|
||||
|
||||
Represents the attributes (color, font, ...) of a wxListCtrl's wxListItem.
|
||||
|
||||
@library{wxcore}
|
||||
@category{data}
|
||||
|
||||
@see @ref overview_listctrl, wxListCtrl, wxListItem
|
||||
*/
|
||||
class wxListItemAttr
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Default Constructor.
|
||||
*/
|
||||
wxListItemAttr();
|
||||
|
||||
/**
|
||||
Construct a wxListItemAttr with the specified foreground and
|
||||
background colors and font.
|
||||
*/
|
||||
wxListItemAttr(const wxColour& colText,
|
||||
const wxColour& colBack,
|
||||
const wxFont& font);
|
||||
|
||||
/**
|
||||
Returns the currently set background color.
|
||||
*/
|
||||
const wxColour& GetBackgroundColour() const;
|
||||
|
||||
/**
|
||||
Returns the currently set font.
|
||||
*/
|
||||
const wxFont& GetFont() const;
|
||||
|
||||
/**
|
||||
Returns the currently set text color.
|
||||
*/
|
||||
const wxColour& GetTextColour() const;
|
||||
|
||||
/**
|
||||
Returns @true if the currently set background color is valid.
|
||||
*/
|
||||
bool HasBackgroundColour() const;
|
||||
|
||||
/**
|
||||
Returns @true if the currently set font is valid.
|
||||
*/
|
||||
bool HasFont() const;
|
||||
|
||||
/**
|
||||
Returns @true if the currently set text color is valid.
|
||||
*/
|
||||
bool HasTextColour() const;
|
||||
|
||||
/**
|
||||
Sets a new background color.
|
||||
*/
|
||||
void SetBackgroundColour(const wxColour& colour);
|
||||
|
||||
/**
|
||||
Sets a new font.
|
||||
*/
|
||||
void SetFont(const wxFont& font);
|
||||
|
||||
/**
|
||||
Sets a new text color.
|
||||
*/
|
||||
void SetTextColour(const wxColour& colour);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxListView
|
||||
|
||||
|
Reference in New Issue
Block a user