]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/choice.cpp
added direct HICommand updating
[wxWidgets.git] / src / mac / carbon / choice.cpp
index 19f8e405d288a387c2e3271845829da4dcd31a1c..37f432cff0a318b36131d7f4eb29fc6729424649 100644 (file)
@@ -238,7 +238,20 @@ wxSize wxChoice::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);
         }
         // Add room for the popup arrow