- Point bounds;
-#if wxOSX_USE_CARBON
- Rect bestsize = { 0 , 0 , 0 , 0 } ;
-
- // try the built-in best size if available
- Boolean former = m_peer->GetData<Boolean>( kControlStaticTextIsMultilineTag);
- m_peer->SetData( kControlStaticTextIsMultilineTag, (Boolean)0 );
- m_peer->GetBestRect( &bestsize ) ;
- m_peer->SetData( kControlStaticTextIsMultilineTag, former );
- if ( !EmptyRect( &bestsize ) )
- {
- bounds.h = bestsize.right - bestsize.left ;
- bounds.v = bestsize.bottom - bestsize.top ;
- }
- else
-#endif
- {
-#if wxOSX_USE_CARBON
- ControlFontStyleRec controlFont;
- OSStatus err = m_peer->GetData<ControlFontStyleRec>( kControlEntireControl, kControlFontStyleTag, &controlFont );
- verify_noerr( err );
-
- wxCFStringRef str( m_label, GetFont().GetEncoding() );
-
-#if wxOSX_USE_ATSU_TEXT
- SInt16 baseline;
- if ( m_font.MacGetThemeFontID() != kThemeCurrentPortFont )
- {
- err = GetThemeTextDimensions(
- (!m_label.empty() ? (CFStringRef)str : CFSTR(" ")),
- m_font.MacGetThemeFontID(), kThemeStateActive, false, &bounds, &baseline );
- verify_noerr( err );
- }
- else
-#endif
-#endif
- {
- wxClientDC dc(const_cast<wxStaticText*>(this));
- wxCoord width, height ;
- dc.GetTextExtent( m_label , &width, &height);
- bounds.h = width;
- bounds.v = height;
- }