From fd926bccac94c6a717d77e75e0ea65a64e333f8a Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 7 Aug 2004 13:27:32 +0000 Subject: [PATCH] drawing the border based on the native control's border, as things like calctrl may override the GetPosition etc. call, so that we'd draw a border around the overall control instead of the day's part git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 82980b387f..199f23f208 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -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 ; -- 2.45.2