From 77ea22ef1cd3cb0acd3d3f2943506c527a3002de Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Oct 2009 13:59:39 +0000 Subject: [PATCH] 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 --- samples/dataview/mymodels.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/dataview/mymodels.cpp b/samples/dataview/mymodels.cpp index 03c13cd356..99e2f76edf 100644 --- a/samples/dataview/mymodels.cpp +++ b/samples/dataview/mymodels.cpp @@ -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; -- 2.47.2