X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/81762e79b83c061ebeb05053bdeae2939aa036c7..a9c1265fcad7d69e22647c6a598c91cbfb26faee:/src/univ/winuniv.cpp?ds=sidebyside diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 0f5b590014..33de114721 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -763,6 +763,14 @@ int wxWindow::GetScrollRange(int orient) const void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) { + // use native scrolling when available and do it in generic way + // otherwise: +#ifdef __WXX11__ + + wxWindowNative::ScrollWindow(dx, dy, rect); + +#else + // before scrolling it, ensure that we don't have any unpainted areas Update(); @@ -779,6 +787,21 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) r = ScrollNoRefresh(0, dy, rect); Refresh(TRUE /* erase bkgnd */, &r); } + + // scroll children accordingly: + wxPoint offset(dx, dy); + + for (wxWindowList::Node *node = GetChildren().GetFirst(); + node; node = node->GetNext()) + { + wxWindow *child = node->GetData(); + if ( child != m_scrollbarVert && child != m_scrollbarHorz && + (rect == NULL || rect->Intersects(child->GetRect())) ) + { + child->Move(child->GetPosition() + offset); + } + } +#endif } wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) @@ -1092,3 +1115,29 @@ void wxWindow::OnKeyUp(wxKeyEvent& event) #endif // wxUSE_MENUS +// ---------------------------------------------------------------------------- +// MSW-specific section +// ---------------------------------------------------------------------------- + +#ifdef __WXMSW__ + +#include "wx/msw/private.h" + +long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) +{ + if ( message == WM_NCHITTEST ) + { + // the windows which contain the other windows should let the mouse + // events through, otherwise a window inside a static box would + // never get any events at all + if ( IsStaticBox() ) + { + return HTTRANSPARENT; + } + } + + return wxWindowNative::MSWWindowProc(message, wParam, lParam); +} + +#endif // __WXMSW__ +