#define wxMAC_DEBUG_REDRAW 0
#endif
+// Get the window with the focus
+WXWidget wxWidgetImpl::FindFocus()
+{
+ ControlRef control = NULL ;
+ GetKeyboardFocus( GetUserFocusWindow() , &control ) ;
+ return control;
+}
+
// ---------------------------------------------------------------------------
// Carbon Events
// ---------------------------------------------------------------------------
}
wxMAC_DEFINE_PROC_GETTER( ControlActionUPP , wxMacLiveScrollbarActionProc ) ;
-wxWidgetImplType* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
- long style, long extraStyle)
+wxWidgetImplType* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer,
+ wxWindowMac* WXUNUSED(parent),
+ wxWindowID WXUNUSED(id),
+ const wxPoint& pos,
+ const wxSize& size,
+ long WXUNUSED(style),
+ long WXUNUSED(extraStyle))
{
OSStatus err = noErr;
Rect bounds = wxMacGetBoundsForControl( wxpeer , pos , size ) ;
void wxMacControl::GetContentArea(int &left , int &top , int &width , int &height) const
{
- RgnHandle rgn = NewRgn() ;
- Rect content ;
- if ( GetControlRegion( m_controlRef, kControlContentMetaPart , rgn ) == noErr )
- GetRegionBounds( rgn , &content ) ;
+ HIShapeRef rgn = NULL;
+ Rect content ;
+
+ if ( HIViewCopyShape(m_controlRef, kHIViewContentMetaPart, &rgn) == noErr)
+ {
+ CGRect cgrect;
+ HIShapeGetBounds(rgn, &cgrect);
+ content = (Rect){ cgrect.origin.y, cgrect.origin.x, cgrect.origin.y+cgrect.size.height, cgrect.origin.x+cgrect.size.width };
+ CFRelease(rgn);
+ }
else
{
- GetControlBounds( m_controlRef , &content );
+ GetControlBounds(m_controlRef, &content);
content.right -= content.left;
content.left = 0;
content.bottom -= content.top;
content.top = 0;
}
- DisposeRgn( rgn ) ;
left = content.left;
top = content.top;
flush = kHIThemeTextHorizontalFlushCenter;
else if ( ( windowStyle & wxALIGN_MASK ) & wxALIGN_RIGHT )
flush = kHIThemeTextHorizontalFlushRight;
- HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.MacGetCTFont() );
+ HIViewSetTextFont( m_controlRef , part , (CTFontRef) font.OSXGetCTFont() );
HIViewSetTextHorizontalFlush( m_controlRef, part, flush );
if ( foreground != *wxBLACK || ignoreBlack == false )
{
fontStyle.font = font.MacGetFontNum();
fontStyle.style = font.MacGetFontStyle();
- fontStyle.size = font.MacGetFontSize();
+ fontStyle.size = font.GetPointSize();
fontStyle.flags = kControlUseFontMask | kControlUseFaceMask | kControlUseSizeMask;
}
GetControlFeatures( m_controlRef , features );
}
-OSStatus wxMacControl::GetRegion( ControlPartCode partCode , RgnHandle region )
-{
- OSStatus err = GetControlRegion( m_controlRef , partCode , region );
- return err;
-}
-
void wxMacControl::PulseGauge()
{
}