]> git.saurik.com Git - wxWidgets.git/commitdiff
replacing RgnHandle with HIShapeRef usage
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 9 Feb 2009 09:41:40 +0000 (09:41 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 9 Feb 2009 09:41:40 +0000 (09:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/databrow.cpp
src/osx/carbon/window.cpp

index d84ee4ba2c37dee2b21406493e9d9d2b04fc3e5e..0c30b68a0f2c738995ba0aaa14bba26270354ef8 100644 (file)
@@ -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;
index 2e9a26ff25b71774fa9755ec07d7326d03542b4f..87c1eb5d8985fe1e7fbb1a32349b35a183e6da46 100644 (file)
@@ -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()
 {
 }