]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
make access specifiers for the virtual functions match their access in the base class...
[wxWidgets.git] / src / msw / listctrl.cpp
index 5a8c4e336386fc2ce065bd466ad3c9d5dce2ca51..9721b5465181345727a196a9815b4b8d1204eb8a 100644 (file)
@@ -24,7 +24,7 @@
     #pragma hdrstop
 #endif
 
     #pragma hdrstop
 #endif
 
-#if wxUSE_LISTCTRL && defined(__WIN95__)
+#if wxUSE_LISTCTRL
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
@@ -371,7 +371,7 @@ bool wxListCtrl::Create(wxWindow *parent,
     if ( InReportView() && wxApp::GetComCtl32Version() >= 470 )
     {
         ::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE,
     if ( InReportView() && wxApp::GetComCtl32Version() >= 470 )
     {
         ::SendMessage(GetHwnd(), LVM_SETEXTENDEDLISTVIEWSTYLE,
-                      0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT);
+                      0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
     }
 
     return true;
     }
 
     return true;
@@ -788,12 +788,15 @@ bool wxListCtrl::SetItem(wxListItem& info)
             data->lParam = info.m_data;
 
         // attributes
             data->lParam = info.m_data;
 
         // attributes
-        if (info.HasAttributes())
+        if ( info.HasAttributes() )
         {
         {
-            if (data->attr)
-                *data->attr = *info.GetAttributes();
+            const wxListItemAttr& attrNew = *info.GetAttributes();
+
+            // don't overwrite the already set attributes if we have them
+            if ( data->attr )
+                data->attr->AssignFrom(attrNew);
             else
             else
-                data->attr = new wxListItemAttr(*info.GetAttributes());
+                data->attr = new wxListItemAttr(attrNew);
         };
     };
 
         };
     };
 
@@ -2250,7 +2253,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 #ifdef NM_CUSTOMDRAW
                     if ( lvi.mask & LVIF_IMAGE )
                     {
 #ifdef NM_CUSTOMDRAW
                     if ( lvi.mask & LVIF_IMAGE )
                     {
-                        lvi.iImage = OnGetItemImage(item);
+                        lvi.iImage = OnGetItemColumnImage(item, lvi.iSubItem);
                     }
 #endif // NM_CUSTOMDRAW
 
                     }
 #endif // NM_CUSTOMDRAW
 
@@ -2516,7 +2519,15 @@ int wxListCtrl::OnGetItemImage(long WXUNUSED(item)) const
 {
     wxCHECK_MSG(!GetImageList(wxIMAGE_LIST_SMALL),
                 -1,
 {
     wxCHECK_MSG(!GetImageList(wxIMAGE_LIST_SMALL),
                 -1,
-                wxT("List control has an image list, OnGetItemImage should be overridden."));
+                wxT("List control has an image list, OnGetItemImage or OnGetItemColumnImage should be overridden."));
+    return -1;
+}
+
+int wxListCtrl::OnGetItemColumnImage(long item, long column) const
+{
+    if (!column)
+        return OnGetItemImage(item);
+
     return -1;
 }
 
     return -1;
 }