- wxASSERT_MSG( m_macControl != NULL , wxT("No valid mac control") ) ;
- if ( m_width == -1 || m_height == -1 )
- {
- Rect bestsize = { 0 , 0 , 0 , 0 } ;
- short baselineoffset ;
-
- UMAGetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
-
- if ( EmptyRect( &bestsize ) )
- {
- baselineoffset = 0;
- bestsize.left = bestsize.top = 0 ;
- bestsize.right = 16 ;
- bestsize.bottom = 16 ;
- if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
- {
- bestsize.bottom = 16 ;
- }
- else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) )
- {
- bestsize.bottom = 24 ;
- }
- }
-
- if ( m_width == -1 )
- {
- if ( IsKindOf( CLASSINFO( wxButton ) ) )
- {
- m_width = m_label.Length() * 8 + 12 ;
- if ( m_width < 70 )
- m_width = 70 ;
- }
- else if ( IsKindOf( CLASSINFO( wxStaticText ) ) )
- {
- m_width = m_label.Length() * 8 ;
- }
- else
- m_width = bestsize.right - bestsize.left ;
-
- m_width += 2 * m_macHorizontalBorder ;
- }
- if ( m_height == -1 )
- {
- m_height = bestsize.bottom - bestsize.top ;
- if ( m_height < 10 )
- m_height = 13 ;
-
- m_height += 2 * m_macVerticalBorder;
- }
-
- wxMacDrawingHelper helper ( wxFindWinFromMacWindow( GetMacRootWindow() ) ) ;
- if ( helper.Ok() )
- {
- UMASizeControl( m_macControl , m_width - 2 * m_macHorizontalBorder, m_height - 2 * m_macVerticalBorder ) ;
- }
- }
+ wxASSERT_MSG( (ControlHandle) m_macControl != NULL , wxT("No valid mac control") ) ;
+ if ( m_width == -1 || m_height == -1 )
+ {
+ Rect bestsize = { 0 , 0 , 0 , 0 } ;
+ short baselineoffset ;
+
+ ::GetBestControlRect( (ControlHandle) m_macControl , &bestsize , &baselineoffset ) ;
+
+ if ( EmptyRect( &bestsize ) )
+ {
+ baselineoffset = 0;
+ bestsize.left = bestsize.top = 0 ;
+ bestsize.right = 16 ;
+ bestsize.bottom = 16 ;
+ if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
+ {
+ bestsize.bottom = 16 ;
+ }
+ else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) )
+ {
+ bestsize.bottom = 24 ;
+ }
+ }
+
+ if ( m_width == -1 )
+ {
+ if ( IsKindOf( CLASSINFO( wxButton ) ) )
+ {
+ m_width = m_label.Length() * 8 + 12 ;
+ if ( m_width < 70 )
+ m_width = 70 ;
+ }
+ else if ( IsKindOf( CLASSINFO( wxStaticText ) ) )
+ {
+ m_width = m_label.Length() * 8 ;
+ }
+ else
+ m_width = bestsize.right - bestsize.left ;
+
+ m_width += 2 * m_macHorizontalBorder + MacGetLeftBorderSize() + MacGetRightBorderSize() ;
+ }
+ if ( m_height == -1 )
+ {
+ m_height = bestsize.bottom - bestsize.top ;
+ if ( m_height < 10 )
+ m_height = 13 ;
+
+ m_height += 2 * m_macVerticalBorder + MacGetTopBorderSize() + MacGetBottomBorderSize() ;
+ }
+ MacUpdateDimensions() ;
+// UMASizeControl( (ControlHandle) m_macControl , m_width - 2 * m_macHorizontalBorder, m_height - 2 * m_macVerticalBorder ) ;
+ }