X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/427ff66291af2d8dd34ff5ee68c81436997144a1..e2a5251d0109a1be6b9ce5c818d89f56ebfaeae1:/src/mac/carbon/choice.cpp diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index 19f8e405d2..37f432cff0 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -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