]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
do take the toolbar into account for Windows CE, otherwise the menus overlap with...
[wxWidgets.git] / src / mac / carbon / window.cpp
index fef61c1184773dbff01681c101051182edd91eed..c6090ebd8370f9bf9e2f8d7bbdef4bc5c986fb0a 100644 (file)
@@ -1132,6 +1132,30 @@ void wxWindowMac::MacRootWindowToWindow( short *x , short *y ) const
     if ( y ) *y = y1 ;
 }
 
+void wxWindowMac::MacGetContentAreaInset( int &left , int &top , int &right , int &bottom )
+{
+    RgnHandle rgn = NewRgn() ;
+    Rect content ;
+    if ( GetControlRegion( (ControlRef) m_macControl , kControlContentMetaPart , rgn ) == noErr )
+    {
+        GetRegionBounds( rgn , &content ) ;
+        DisposeRgn( rgn ) ;
+    }
+    else
+    {
+        GetControlBounds( (ControlRef) m_macControl , &content ) ;
+    }
+    Rect structure ;
+    GetControlBounds( (ControlRef) m_macControl , &structure ) ;
+#if !TARGET_API_MAC_OSX    
+    OffsetRect( &content , -structure.left , -structure.top ) ;
+#endif
+    left = content.left - structure.left ;
+    top = content.top  - structure.top ;
+    right = structure.right - content.right ;
+    bottom = structure.bottom - content.bottom ;
+}
+
 wxSize wxWindowMac::DoGetSizeFromClientSize( const wxSize & size )  const
 {
     wxSize sizeTotal = size;