]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/listbox.cpp
fixes for user dash handling (patch 717736)
[wxWidgets.git] / src / mac / listbox.cpp
index 12e2c048bb05dd97ae0c5ad503b6cfd6a552c9cc..656a835b6e0ebbeef39cf02647df78a62d458024 100644 (file)
@@ -620,7 +620,20 @@ wxSize wxListBox::DoGetBestSize() const
         // Find the widest line
         for(int i = 0; i < GetCount(); i++) {
             wxString str(GetString(i));
-            wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ;
+        #if wxUSE_UNICODE
+            Point bounds={0,0} ;
+            SInt16 baseline ;
+            ::GetThemeTextDimensions( wxMacCFStringHolder( str ) ,
+                kThemeCurrentPortFont,
+                kThemeStateActive,
+                false,
+                &bounds,
+                &baseline );
+            wLine = bounds.h ;
+        #else
+            wxCharBuffer text = wxMacStringToCString( str ) ;
+            wLine = ::TextWidth( text , 0 , strlen(text) ) ;
+        #endif
             lbWidth = wxMax(lbWidth, wLine);
         }