- Point bounds;
-
-#if wxOSX_USE_ATSU_TEXT
- OSStatus err = noErr;
- wxCFStringRef str( m_label, GetFont().GetEncoding() );
-
- 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
- {
- wxClientDC dc(const_cast<wxStaticText*>(this));
- wxCoord width, height ;
- dc.GetMultiLineTextExtent( m_label , &width, &height);
- // FIXME: The calculations returned by this function are too small
- // for some strings, so we adjust manually.
- bounds.h = width+12;
- bounds.v = height+4;
- }
-
- if ( m_label.empty() )
- bounds.h = 0;
-
- bounds.h += MacGetLeftBorderSize() + MacGetRightBorderSize();
- bounds.v += MacGetTopBorderSize() + MacGetBottomBorderSize();
-
- return wxSize( bounds.h, bounds.v );