DoGetBestSize fix, the lbWidth was not getting updated because of a
misplaced #endif git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -246,6 +246,7 @@ wxSize wxListBox::DoGetBestSize() const
|
|||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
wxClientDC dc(const_cast<wxListBox*>(this));
|
wxClientDC dc(const_cast<wxListBox*>(this));
|
||||||
|
dc.SetFont(GetFont());
|
||||||
#else
|
#else
|
||||||
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef)MacGetTopLevelWindowRef() ) );
|
wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef)MacGetTopLevelWindowRef() ) );
|
||||||
|
|
||||||
@@ -288,9 +289,8 @@ wxSize wxListBox::DoGetBestSize() const
|
|||||||
#else
|
#else
|
||||||
wLine = ::TextWidth( str.c_str(), 0, str.length() );
|
wLine = ::TextWidth( str.c_str(), 0, str.length() );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lbWidth = wxMax( lbWidth, wLine );
|
|
||||||
#endif
|
#endif
|
||||||
|
lbWidth = wxMax( lbWidth, wLine );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add room for the scrollbar
|
// Add room for the scrollbar
|
||||||
@@ -300,10 +300,10 @@ wxSize wxListBox::DoGetBestSize() const
|
|||||||
int cy = 12;
|
int cy = 12;
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
wxCoord width, height ;
|
wxCoord width, height ;
|
||||||
dc.GetTextExtent( wxT("X") , &width, &height);
|
dc.GetTextExtent( wxT("XX") , &width, &height);
|
||||||
int cx = width ;
|
int cx = width ;
|
||||||
#else
|
#else
|
||||||
int cx = ::TextWidth( "X", 0, 1 );
|
int cx = ::TextWidth( "XX", 0, 1 );
|
||||||
#endif
|
#endif
|
||||||
lbWidth += cx;
|
lbWidth += cx;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user