replacing RgnHandle with HIShapeRef usage
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
5398a2e050
commit
f215225dcf
@ -1059,14 +1059,19 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowse
|
||||
|
||||
// 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;
|
||||
|
@ -917,19 +917,24 @@ void wxMacControl::Lower()
|
||||
|
||||
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;
|
||||
@ -1389,12 +1394,6 @@ void wxMacControl::GetFeatures( UInt32 * features )
|
||||
GetControlFeatures( m_controlRef , features );
|
||||
}
|
||||
|
||||
OSStatus wxMacControl::GetRegion( ControlPartCode partCode , RgnHandle region )
|
||||
{
|
||||
OSStatus err = GetControlRegion( m_controlRef , partCode , region );
|
||||
return err;
|
||||
}
|
||||
|
||||
void wxMacControl::PulseGauge()
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user