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
This commit is contained in:
Robert Roebling
2002-05-23 17:52:55 +00:00
parent 91c68292f6
commit 9a456218de
2 changed files with 38 additions and 8 deletions

View File

@@ -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 ;