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:
Vadim Zeitlin
2016-04-16 17:44:19 +02:00
parent c592363e95
commit 246ae58c19
24 changed files with 232 additions and 221 deletions

View File

@@ -168,7 +168,7 @@ void wxListItemData::SetItem( const wxListItem &info )
if ( m_attr )
m_attr->AssignFrom(*info.GetAttributes());
else
m_attr = new wxListItemAttr(*info.GetAttributes());
m_attr = new wxItemAttr(*info.GetAttributes());
}
if ( m_rect )
@@ -654,7 +654,7 @@ int wxListLineData::GetImage( int index ) const
return item->GetImage();
}
wxListItemAttr *wxListLineData::GetAttr() const
wxItemAttr *wxListLineData::GetAttr() const
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
wxCHECK_MSG( node, NULL, wxT("invalid column index in GetAttr()") );
@@ -663,7 +663,7 @@ wxListItemAttr *wxListLineData::GetAttr() const
return item->GetAttr();
}
void wxListLineData::SetAttr(wxListItemAttr *attr)
void wxListLineData::SetAttr(wxItemAttr *attr)
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
wxCHECK_RET( node, wxT("invalid column index in SetAttr()") );
@@ -677,7 +677,7 @@ void wxListLineData::ApplyAttributes(wxDC *dc,
bool highlighted,
bool current)
{
const wxListItemAttr * const attr = GetAttr();
const wxItemAttr * const attr = GetAttr();
wxWindow * const listctrl = m_owner->GetParent();