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:
@@ -1226,7 +1226,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event)
|
||||
|
||||
GetItem(info);
|
||||
|
||||
wxListItemAttr *attr = info.GetAttributes();
|
||||
wxItemAttr *attr = info.GetAttributes();
|
||||
if ( !attr || !attr->HasTextColour() )
|
||||
{
|
||||
info.SetTextColour(*wxCYAN);
|
||||
@@ -1416,13 +1416,13 @@ int MyListCtrl::OnGetItemColumnImage(long item, long column) const
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxListItemAttr *MyListCtrl::OnGetItemAttr(long item) const
|
||||
wxItemAttr *MyListCtrl::OnGetItemAttr(long item) const
|
||||
{
|
||||
// test to check that RefreshItem() works correctly: when m_updated is
|
||||
// set to some item and it is refreshed, we highlight the item
|
||||
if ( item == m_updated )
|
||||
{
|
||||
static wxListItemAttr s_attrHighlight(*wxRED, wxNullColour, wxNullFont);
|
||||
static wxItemAttr s_attrHighlight(*wxRED, wxNullColour, wxNullFont);
|
||||
return &s_attrHighlight;
|
||||
}
|
||||
|
||||
|
@@ -84,7 +84,7 @@ private:
|
||||
|
||||
virtual wxString OnGetItemText(long item, long column) const wxOVERRIDE;
|
||||
virtual int OnGetItemColumnImage(long item, long column) const wxOVERRIDE;
|
||||
virtual wxListItemAttr *OnGetItemAttr(long item) const wxOVERRIDE;
|
||||
virtual wxItemAttr *OnGetItemAttr(long item) const wxOVERRIDE;
|
||||
|
||||
long m_updated;
|
||||
|
||||
|
Reference in New Issue
Block a user