X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7cb14cec900098b866f58804e5f6e899cb158ea..3ce369e6876c49ad7a101ad222048bd5446b7125:/docs/latex/wx/scrolwin.tex diff --git a/docs/latex/wx/scrolwin.tex b/docs/latex/wx/scrolwin.tex index 91b5fc2b86..e8a364b900 100644 --- a/docs/latex/wx/scrolwin.tex +++ b/docs/latex/wx/scrolwin.tex @@ -14,8 +14,23 @@ If you don't wish to calculate your own scrolling, you must call PrepareDC when within OnDraw, to set the device origin for the device context according to the current scroll position. +A wxScrolledWindow will normally scroll itself and therefore its child windows as well. It +might however be desired to scroll a different window than itself: e.g. when designing a +spreadsheet, you'll normally only have to scroll the (usually white) cell area, whereas the +(usually grey) label area will scroll very differently. For this special purpose, you can +call \helpref{SetTargetWindow}{wxscrolledwindowsettargetwindow} which means that pressing +the scrollbars will scroll a different window. + +Note that the underlying system knows nothing about scrolling coordinates, so that all system +functions (mouse events, expose events, refresh calls etc) as well as the position of subwindows +are relative to the "physical" origin of the scrolled window. If the user insert a child window at +position (10,10) and scrolls the window down 100 pixels (moving the child window out of the visible +area), the child window will report a position of (10,-90). + + \wxheading{Derived from} +\helpref{wxPanel}{wxpanel}\\ \helpref{wxWindow}{wxwindow}\\ \helpref{wxEvtHandler}{wxevthandler}\\ \helpref{wxObject}{wxobject} @@ -138,7 +153,9 @@ Enable or disable physical scrolling in the given direction. Physical scrolling is the physical transfer of bits up or down the screen when a scroll event occurs. If the application scrolls by a variable amount (e.g. if there are different font sizes) then physical -scrolling will not work, and you should switch it off. +scrolling will not work, and you should switch it off. Note that you +will have to reposition child windows yourself, if physical scrolling +is disabled. \wxheading{Parameters} @@ -314,6 +331,13 @@ scroll steps may be variable according to the position in the document, it will necessary to derive a new class from wxWindow, overriding {\bf OnSize} and adjusting the scrollbars appropriately. +\membersection{wxScrolledWindow::SetTargetWindow}\label{wxscrolledwindowsettargetwindow} + +\func{void}{SetTargetWindow}{\param{wxWindow* }{window}} + +Call this function to tell wxScrolledWindow to perform the actually scrolling on +a different window (not on itself). + \membersection{wxScrolledWindow::ViewStart}\label{wxscrolledwindowviewstart} \constfunc{void}{ViewStart}{\param{int* }{x}, \param{int* }{ y}}