]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Include wx/menu.h according to precompiled headers of wx/wx.h (with other minor clean...
[wxWidgets.git] / src / msw / listctrl.cpp
index 3524895a5f687b2b4938490a1663d7cb2e7cd093..33c6741c598186090c68dbabd29690c19557dbb9 100644 (file)
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/settings.h"
+    #include "wx/dcclient.h"
 #endif
 
 #include "wx/textctrl.h"
 #include "wx/imaglist.h"
 #include "wx/listctrl.h"
-#include "wx/dcclient.h"
 
 #include "wx/msw/private.h"
 
@@ -761,6 +761,10 @@ bool wxListCtrl::GetItem(wxListItem& info) const
 // Sets information about the item
 bool wxListCtrl::SetItem(wxListItem& info)
 {
+    const long id = info.GetId();
+    wxCHECK_MSG( id >= 0 && id < GetItemCount(), false,
+                 _T("invalid item index in SetItem") );
+
     LV_ITEM item;
     wxConvertToMSWListItem(this, info, item);
 
@@ -773,7 +777,7 @@ bool wxListCtrl::SetItem(wxListItem& info)
     {
         // get internal item data
         // perhaps a cache here ?
-        wxListItemInternalData *data = wxGetInternalData(this, info.m_itemId);
+        wxListItemInternalData *data = wxGetInternalData(this, id);
 
         if (! data)
         {
@@ -1063,11 +1067,15 @@ wxSize wxListCtrl::GetItemSpacing() const
     return wxSize(LOWORD(spacing), HIWORD(spacing));
 }
 
+#if WXWIN_COMPATIBILITY_2_6
+
 int wxListCtrl::GetItemSpacing(bool isSmall) const
 {
     return ListView_GetItemSpacing(GetHwnd(), (BOOL) isSmall);
 }
 
+#endif // WXWIN_COMPATIBILITY_2_6
+
 void wxListCtrl::SetItemTextColour( long item, const wxColour &col )
 {
     wxListItem info;
@@ -3049,7 +3057,7 @@ static void wxConvertToMSWListCol(HWND hwndList,
 #ifdef NM_CUSTOMDRAW // _WIN32_IE >= 0x0300
     if ( item.m_mask & wxLIST_MASK_IMAGE )
     {
-        if ( wxTheApp->GetComCtl32Version() >= 470 )
+        if ( wxApp::GetComCtl32Version() >= 470 )
         {
             lvCol.mask |= LVCF_IMAGE;