From 9a456218de5b367b857226eb7f2be3cbe1b3f1bb Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 23 May 2002 17:52:55 +0000 Subject: [PATCH] wxButtons no longer leave junk on dialogs when moved. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/window.cpp | 23 +++++++++++++++++++---- src/mac/window.cpp | 23 +++++++++++++++++++---- 2 files changed, 38 insertions(+), 8 deletions(-) diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index d43cb87def..85a70799c9 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -804,16 +804,31 @@ void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y, void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) { if ( MacGetTopLevelWindow() == NULL ) - return ; + return ; - wxPoint client ; - client = GetClientAreaOrigin( ) ; - Rect clientrect = { -client.y , -client.x , m_height - client.y , m_width - client.x} ; + wxPoint client = GetClientAreaOrigin(); + int x1 = -client.x; + int y1 = -client.y; + int x2 = m_width - client.x; + int y2 = m_height - client.y; + + if (IsKindOf( CLASSINFO(wxButton))) + { + // buttons have an "aura" + y1 -= 5; + x1 -= 5; + y2 += 5; + x2 += 5; + } + + Rect clientrect = { y1, x1, y2, x2 }; + if ( rect ) { Rect r = { rect->y , rect->x , rect->y + rect->height , rect->x + rect->width } ; SectRect( &clientrect , &r , &clientrect ) ; } + if ( !EmptyRect( &clientrect ) ) { int top = 0 , left = 0 ; diff --git a/src/mac/window.cpp b/src/mac/window.cpp index d43cb87def..85a70799c9 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -804,16 +804,31 @@ void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y, void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) { if ( MacGetTopLevelWindow() == NULL ) - return ; + return ; - wxPoint client ; - client = GetClientAreaOrigin( ) ; - Rect clientrect = { -client.y , -client.x , m_height - client.y , m_width - client.x} ; + wxPoint client = GetClientAreaOrigin(); + int x1 = -client.x; + int y1 = -client.y; + int x2 = m_width - client.x; + int y2 = m_height - client.y; + + if (IsKindOf( CLASSINFO(wxButton))) + { + // buttons have an "aura" + y1 -= 5; + x1 -= 5; + y2 += 5; + x2 += 5; + } + + Rect clientrect = { y1, x1, y2, x2 }; + if ( rect ) { Rect r = { rect->y , rect->x , rect->y + rect->height , rect->x + rect->width } ; SectRect( &clientrect , &r , &clientrect ) ; } + if ( !EmptyRect( &clientrect ) ) { int top = 0 , left = 0 ; -- 2.45.2