]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Separated out book control sizing code
[wxWidgets.git] / src / msw / listbox.cpp
index 07b6aaebf2ad70d0d5868e8deea130919a6d2f4f..1f8a77955d1dc60cc3a1bd615e77391d53a4aafe 100644 (file)
@@ -348,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
@@ -772,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;
 }