X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2f1ae4143271ae63a17e052a1a471d16e9cd8c44..6ba636000f13b4bf7d3e7dcfad429713085f6700:/src/mac/window.cpp diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 3dd198b369..d2696fe6e0 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -1246,6 +1246,20 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) InvalWindowRgn( GetMacRootWindow() , updateRgn ) ; DisposeRgn( updateRgn ) ; } + + for (wxNode *node = GetChildren().First(); node; node = node->Next()) + { + wxWindow *child = (wxWindow*)node->Data(); + if (child == m_vScrollBar) continue; + if (child == m_hScrollBar) continue; + if (child->IsTopLevel()) continue; + int x,y; + child->GetPosition( &x, &y ); + int w,h; + child->GetSize( &w, &h ); + child->SetSize( x+dx, y+dy, w, h ); + } + } void wxWindow::MacOnScroll(wxScrollEvent &event ) @@ -1741,6 +1755,7 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time) RgnHandle newupdate = NewRgn() ; wxSize point = GetClientSize() ; wxPoint origin = GetClientAreaOrigin() ; + SetRectRgn( newupdate , origin.x , origin.y , origin.x + point.x , origin.y+point.y ) ; SectRgn( newupdate , m_macUpdateRgn , newupdate ) ; OffsetRgn( newupdate , -origin.x , -origin.y ) ; @@ -1754,13 +1769,10 @@ void wxWindow::MacRedraw( RgnHandle updatergn , long time) event.SetEventObject(this); GetEventHandler()->ProcessEvent(event); } - { - } - RgnHandle childupdate = NewRgn() ; - + for (wxNode *node = GetChildren().First(); node; node = node->Next()) { wxWindow *child = (wxWindow*)node->Data(); @@ -2344,3 +2356,21 @@ wxMacDrawingClientHelper::~wxMacDrawingClientHelper() if ( m_formerPort != m_currentPort ) SetPort( m_formerPort ) ; } + +// Find the wxWindow at the current mouse position, returning the mouse +// position. +wxWindow* wxFindWindowAtPointer(wxPoint& pt) +{ + pt = wxGetMousePosition(); + wxWindow* found = wxFindWindowAtPoint(pt); + return found; +} + +// Get the current mouse position. +wxPoint wxGetMousePosition() +{ + int x, y; + wxGetMousePosition(& x, & y); + return wxPoint(x, y); +} +