]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Some BC++ fixes
[wxWidgets.git] / src / msw / listctrl.cpp
index f6deb429ebaef2bc69da251b9e20b3e5d2110751..acb319062b9a0a156d994b6a29c79b6d2388b2b7 100644 (file)
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
-    #include "wx/textctrl.h"
-    #include "wx/imaglist.h"
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/settings.h"
 #endif
 
     #include "wx/intl.h"
     #include "wx/log.h"
     #include "wx/settings.h"
 #endif
 
+#include "wx/textctrl.h"
+#include "wx/imaglist.h"
+
 #include "wx/listctrl.h"
 
 #include "wx/msw/private.h"
 #include "wx/listctrl.h"
 
 #include "wx/msw/private.h"
@@ -208,8 +209,7 @@ bool wxListCtrl::DoCreateControl(int x, int y, int w, int h)
 
     if ( !m_hWnd )
     {
 
     if ( !m_hWnd )
     {
-        wxLogError(_("Can't create list control window, check "
-                     "that comctl32.dll is installed."));
+        wxLogError(_("Can't create list control window, check that comctl32.dll is installed."));
 
         return FALSE;
     }
 
         return FALSE;
     }
@@ -951,7 +951,7 @@ bool wxListCtrl::DeleteAllColumns()
     {
         if ( ListView_DeleteColumn(GetHwnd(), 0) == 0 )
         {
     {
         if ( ListView_DeleteColumn(GetHwnd(), 0) == 0 )
         {
-            wxLogLastError("ListView_DeleteColumn");
+            wxLogLastError(wxT("ListView_DeleteColumn"));
 
             return FALSE;
         }
 
             return FALSE;
         }
@@ -1039,7 +1039,7 @@ long wxListCtrl::FindItem(long start, const wxString& str, bool partial)
 
     findInfo.flags = LVFI_STRING;
     if ( partial )
 
     findInfo.flags = LVFI_STRING;
     if ( partial )
-        findInfo.flags |= LVFI_STRING;
+        findInfo.flags |= LVFI_PARTIAL;
     findInfo.psz = WXSTRINGCAST str;
 
     return ListView_FindItem(GetHwnd(), (int) start, & findInfo);
     findInfo.psz = WXSTRINGCAST str;
 
     return ListView_FindItem(GetHwnd(), (int) start, & findInfo);
@@ -1435,7 +1435,12 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                     event.m_code = wxCharCodeMSWToWX(wVKey);
                 }
 
                     event.m_code = wxCharCodeMSWToWX(wVKey);
                 }
 
-                event.m_item.m_data = GetItemData(lItem);
+                if ( lItem != -1 )
+                {
+                    // fill the other fields too
+                    event.m_item.m_text = GetItemText(lItem);
+                    event.m_item.m_data = GetItemData(lItem);
+                }
             }
             break;
 
             }
             break;
 
@@ -1457,6 +1462,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 
             eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
             event.m_itemIndex = nmLV->iItem;
 
             eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
             event.m_itemIndex = nmLV->iItem;
+            event.m_item.m_text = GetItemText(nmLV->iItem);
             event.m_item.m_data = GetItemData(nmLV->iItem);
             break;
 
             event.m_item.m_data = GetItemData(nmLV->iItem);
             break;