]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/htlbox/htlbox.cpp
replacing old core graphics with new graphics context implementation
[wxWidgets.git] / samples / htlbox / htlbox.cpp
index 0522932c5ec88584932985be2d390e99c95b1ec1..f0b76886b17ee9ef4366b73c4c7d3d471c3b6775 100644 (file)
@@ -125,7 +125,7 @@ public:
     void OnLboxSelect(wxCommandEvent& event);
     void OnLboxDClick(wxCommandEvent& event)
     {
-        wxLogMessage(_T("Listbox item %ld double clicked."), event.GetInt());
+        wxLogMessage(_T("Listbox item %d double clicked."), event.GetInt());
     }
 
 private:
@@ -386,7 +386,7 @@ void MyFrame::OnSetSelFgCol(wxCommandEvent& event)
 
 void MyFrame::OnLboxSelect(wxCommandEvent& event)
 {
-    wxLogMessage(_T("Listbox selection is now %ld."), event.GetInt());
+    wxLogMessage(_T("Listbox selection is now %d."), event.GetInt());
 
     if ( m_hlbox->HasMultipleSelection() )
     {
@@ -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((unsigned char)(abs((int)n - 192) % 256),
+                 (unsigned char)(abs((int)n - 256) % 256),
+                 (unsigned char)(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 )
     {