-#if wxMAC_USE_THEME_BORDER
- SInt32 border = 0 ;
- GetThemeMetric( kThemeMetricEditTextFrameOutset , &border ) ;
- InsetRect( &rect , border , border );
- DrawThemeEditTextFrame(&rect,IsEnabled() ? kThemeStateActive : kThemeStateInactive) ;
-#else
- RGBColor white = { 0xFFFF, 0xFFFF , 0xFFFF } ;
- RGBColor face = { 0xDDDD, 0xDDDD , 0xDDDD } ;
-
- bool sunken = HasFlag( wxSUNKEN_BORDER ) ;
- RGBForeColor( &face );
- MoveTo( left + 0 , top + h - 2 );
- LineTo( left + 0 , top + 0 );
- LineTo( left + w - 2 , top + 0 );
-
- MoveTo( left + 2 , top + h - 3 );
- LineTo( left + w - 3 , top + h - 3 );
- LineTo( left + w - 3 , top + 2 );
-
- RGBForeColor( sunken ? &face : &darkShadow );
- MoveTo( left + 0 , top + h - 1 );
- LineTo( left + w - 1 , top + h - 1 );
- LineTo( left + w - 1 , top + 0 );
-
- RGBForeColor( sunken ? &lightShadow : &white );
- MoveTo( left + 1 , top + h - 3 );
- LineTo( left + 1, top + 1 );
- LineTo( left + w - 3 , top + 1 );
-
- RGBForeColor( sunken ? &white : &lightShadow );
- MoveTo( left + 1 , top + h - 2 );
- LineTo( left + w - 2 , top + h - 2 );
- LineTo( left + w - 2 , top + 1 );
-
- RGBForeColor( sunken ? &darkShadow : &face );
- MoveTo( left + 2 , top + h - 4 );
- LineTo( left + 2 , top + 2 );
- LineTo( left + w - 4 , top + 2 );
-#endif
+ CGRect cgrect = CGRectMake( rect.left , rect.top , rect.right - rect.left ,
+ rect.bottom - rect.top ) ;
+
+ HIThemeFrameDrawInfo info ;
+ memset( &info, 0 , sizeof(info) ) ;
+
+ info.version = 0 ;
+ info.kind = 0 ;
+ info.state = IsEnabled() ? kThemeStateActive : kThemeStateInactive ;
+ info.isFocused = hasFocus ;
+
+ CGContextRef cgContext = (CGContextRef) GetParent()->MacGetCGContextRef() ;
+ wxASSERT( cgContext ) ;
+
+ if ( HasFlag(wxRAISED_BORDER) || HasFlag(wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
+ {
+ info.kind = kHIThemeFrameTextFieldSquare ;
+ HIThemeDrawFrame( &cgrect , &info , cgContext , kHIThemeOrientationNormal ) ;
+ }
+ else if ( HasFlag(wxSIMPLE_BORDER) )
+ {
+ info.kind = kHIThemeFrameListBox ;
+ HIThemeDrawFrame( &cgrect , &info , cgContext , kHIThemeOrientationNormal ) ;
+ }
+ else if ( hasFocus )
+ {
+ HIThemeDrawFocusRect( &cgrect , true , cgContext , kHIThemeOrientationNormal ) ;
+ }
+
+ m_peer->GetRect( &rect ) ;
+ if ( hasBothScrollbars )
+ {
+ int size = m_hScrollBar->GetWindowVariant() == wxWINDOW_VARIANT_NORMAL ? 16 : 12 ;
+ CGRect cgrect = CGRectMake( rect.right - size , rect.bottom - size , size , size ) ;
+ CGPoint cgpoint = CGPointMake( rect.right - size , rect.bottom - size ) ;
+ HIThemeGrowBoxDrawInfo info ;
+ memset( &info, 0, sizeof(info) ) ;
+ info.version = 0 ;
+ info.state = IsEnabled() ? kThemeStateActive : kThemeStateInactive ;
+ info.kind = kHIThemeGrowBoxKindNone ;
+ info.size = kHIThemeGrowBoxSizeNormal ;
+ info.direction = kThemeGrowRight | kThemeGrowDown ;
+ HIThemeDrawGrowBox( &cgpoint , &info , cgContext , kHIThemeOrientationNormal ) ;
+ }