X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/427ff66291af2d8dd34ff5ee68c81436997144a1..e2a5251d0109a1be6b9ce5c818d89f56ebfaeae1:/src/mac/listbox.cpp?ds=sidebyside diff --git a/src/mac/listbox.cpp b/src/mac/listbox.cpp index 12e2c048bb..656a835b6e 100644 --- a/src/mac/listbox.cpp +++ b/src/mac/listbox.cpp @@ -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); }