]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Some compilers don't define SIZE_T (e.g. dmc) so use size_t instead.
[wxWidgets.git] / src / msw / listbox.cpp
index c799cf3479f025848aab58b9bece27e74b1389f0..1f8a77955d1dc60cc3a1bd615e77391d53a4aafe 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "listbox.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
@@ -352,9 +348,13 @@ void wxListBox::DoSetItems(const wxArrayString& choices, void** clientData)
     InvalidateBestSize();
 }
 
-int wxListBox::FindString(const wxString& s) const
+int wxListBox::FindString(const wxString& s, bool bCase) const
 {
-    int pos = ListBox_FindStringExact(GetHwnd(), (WPARAM)-1, s);
+    // back to base class search for not native search type
+    if (bCase)
+       return wxItemContainerImmutable::FindString( s, bCase );
+
+    int pos = ListBox_FindStringExact(GetHwnd(), -1, s);
     if (pos == LB_ERR)
         return wxNOT_FOUND;
     else
@@ -776,16 +776,19 @@ bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item)
     HDC hdc = CreateIC(wxT("DISPLAY"), NULL, NULL, 0);
 #endif
 
-    wxDC dc;
-    dc.SetHDC((WXHDC)hdc);
-    dc.SetFont(GetFont());
-
-    pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
-    pStruct->itemWidth  = dc.GetCharWidth();
+    {
+        wxDCTemp dc((WXHDC)hdc);
+        dc.SetFont(GetFont());
 
-    dc.SetHDC(0);
+        pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
+        pStruct->itemWidth  = dc.GetCharWidth();
+    }
 
+#ifdef __WXWINCE__
+    ReleaseDC(NULL, hdc);
+#else
     DeleteDC(hdc);
+#endif
 
     return true;
 }