]> git.saurik.com Git - wxWidgets.git/commitdiff
Final fix from '[ 1473731 ] wxColourBase and wxString <-> wxColour implementation'.
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 16 Jun 2006 10:42:07 +0000 (10:42 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 16 Jun 2006 10:42:07 +0000 (10:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/htlbox/htlbox.cpp

index 0522932c5ec88584932985be2d390e99c95b1ec1..a5a87d34312d9231f1cdbe15c636dc49034b2515 100644 (file)
@@ -475,13 +475,16 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const
     return s;
 #else
     int level = n % 6 + 1;
-    wxString label = wxString::Format(_T("<h%d><font color=#%2x%2x%2x>")
+
+    wxColour clr(abs((int)n - 192) % 256,
+                 abs((int)n - 256) % 256,
+                 abs((int)n - 128) % 256);
+
+    wxString label = wxString::Format(_T("<h%d><font color=%s>")
                                       _T("Item</font> <b>%lu</b>")
                                       _T("</h%d>"),
                                       level,
-                                      abs((int)n - 192) % 256,
-                                      abs((int)n - 256) % 256,
-                                      abs((int)n - 128) % 256,
+                                      clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(),
                                       (unsigned long)n, level);
     if ( n == 1 )
     {