Make the colours in the demo a bit more logical.

Make the colours of the items in the "attributes" column blue/green/red in
order instead of making all odd items blue and all even and divisible by 3
ones green while making the rest of them red -- it was a bit difficult to
figure out how it worked before.

Also correct wxDataViewItemAttr::SetItalic() check: comparing the remainder of
the division by 2 with 5 didn't risk to work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-10-12 13:59:39 +00:00
parent de40d73647
commit 77ea22ef1c

View File

@@ -433,9 +433,9 @@ bool MyListModel::GetAttrByRow( unsigned int row, unsigned int col,
if (row < m_array.GetCount())
{
attr.SetColour( (row%2) == 0 ? *wxBLUE :
((row%3) == 0 ? *wxGREEN : *wxRED) );
attr.SetItalic( (row%2) == 5 );
attr.SetColour( (row%3) == 0 ? *wxBLUE :
((row%3) == 1 ? *wxGREEN : *wxRED) );
attr.SetItalic( (row%10) == 5 );
}
return true;