]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
fix for VC (also ok with Borland and DMC)
[wxWidgets.git] / src / msw / listctrl.cpp
index 3769867501d607527e8ce923fbc4abf5430dc2a0..c371406b3e43277c3c43c812185ecea269972af0 100644 (file)
@@ -1092,6 +1092,24 @@ wxColour wxListCtrl::GetItemBackgroundColour( long item ) const
     return col;
 }
 
+void wxListCtrl::SetItemFont( long item, const wxFont &f )
+{
+    wxListItem info;
+    info.m_itemId = item;
+    info.SetFont( f );
+    SetItem( info );
+}
+
+wxFont wxListCtrl::GetItemFont( long item ) const
+{
+    wxFont f;
+    wxListItemInternalData *data = wxGetInternalData(this, item);
+    if ( data && data->attr )
+        f = data->attr->GetFont();
+
+    return f;
+}
+
 // Gets the number of selected items in the list control
 int wxListCtrl::GetSelectedItemCount() const
 {
@@ -2810,7 +2828,8 @@ static void wxConvertToMSWListCol(int WXUNUSED(col), const wxListItem& item,
             //
             // we don't use LVCFMT_COL_HAS_IMAGES because it doesn't seem to
             // make any difference in my tests -- but maybe we should?
-            lvCol.fmt |= LVCFMT_BITMAP_ON_RIGHT | LVCFMT_IMAGE;
+            if ( item.m_image != -1 )
+                lvCol.fmt |= LVCFMT_BITMAP_ON_RIGHT | LVCFMT_IMAGE;
 
             lvCol.iImage = item.m_image;
         }