]> git.saurik.com Git - wxWidgets.git/commitdiff
drawing the border based on the native control's border, as things like calctrl may...
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 7 Aug 2004 13:27:32 +0000 (13:27 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 7 Aug 2004 13:27:32 +0000 (13:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp

index 82980b387fc1702195f8fd131f49d40d14f10e32..199f23f20858087a89341376cdba22ab3bdb86b7 100644 (file)
@@ -2198,9 +2198,24 @@ void wxWindowMac::MacPaintBorders( int left , int top )
     if( IsTopLevel() )
         return ;
         
-    int w , h ;
-    GetSize( &w , &h ) ;
-    Rect rect = { top , left , h + top , w + left } ;
+    Rect rect ;
+    m_peer->GetRect( &rect ) ; 
+    InsetRect( &rect, -MacGetLeftBorderSize() , -MacGetTopBorderSize() ) ;
+
+    if ( !IsTopLevel() )
+    {
+        wxTopLevelWindowMac* top = MacGetTopLevelWindow();
+        if (top)
+        {
+            wxPoint pt(0,0) ;
+            wxMacControl::Convert( &pt , GetParent()->m_peer , top->m_peer ) ;
+            rect.left += pt.x ;
+            rect.right += pt.x ;
+            rect.top += pt.y ;
+            rect.bottom += pt.y ;
+        }
+    }
+    
     if (HasFlag(wxRAISED_BORDER) || HasFlag( wxSUNKEN_BORDER) || HasFlag(wxDOUBLE_BORDER) )
     {
         Rect srect = rect ;