// try to determine the content's size (drawable part):
Rect content;
- RgnHandle rgn(NewRgn());
+ HIShapeRef rgn = NULL;
+
UInt16 headerHeight;
- if (this->GetRegion(kControlContentMetaPart,rgn) == noErr)
- GetRegionBounds(rgn,&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);
- ::DisposeRgn(rgn);
// space for the header
this->GetHeaderButtonHeight(&headerHeight);
content.top += headerHeight;
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;
GetControlFeatures( m_controlRef , features );
}
-OSStatus wxMacControl::GetRegion( ControlPartCode partCode , RgnHandle region )
-{
- OSStatus err = GetControlRegion( m_controlRef , partCode , region );
- return err;
-}
-
void wxMacControl::PulseGauge()
{
}