]> git.saurik.com Git - wxWidgets.git/commitdiff
Make the colours in the demo a bit more logical.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Oct 2009 13:59:39 +0000 (13:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 12 Oct 2009 13:59:39 +0000 (13:59 +0000)
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

index 03c13cd35631618b9b199b646e948df181c932c2..99e2f76edfdae24d6756955b2cd9b888f51c23a1 100644 (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;