An interactor that has its logical contents larger than the drawable bounds.
![]() | scrollRange The range in which the scrollable is scrolled. |
![]() | PScrollable ( PScroller * parent ) Create a scrollable interactor that will be scrolled by the parent PScroller class. |
![]() | GetDrawingBounds ( CoordinateSystem coords ) const Get the drawing bounds for the scrollable interactor. |
![]() | SetScrollRange ( const PRect & rect ) Set the range in which the scrollable is scrolled. |
![]() | GetScrollRange () const Get the range in which the scrollable is scrolled. |
![]() | SetScaleFactor ( PORDINATE x, PORDINATE y ) Set the scaling factor in pixels for the scroll range. |
![]() | GetScaleFactor () const Get the scaling factor in pixels for the scroll range. |
![]() | GetOrigin () const Get the current origin of the scrollable in the scrolling units. |
![]() | ScrollTo ( PORDINATE x, PORDINATE y ) Scroll the scrollable contents to the new origin specified. |
![]() | ScrollBy ( PORDINATE dx, PORDINATE dy ) Scroll the scrollable contents by the amount specified. |
![]() | OnScroll ( const PPoint & delta ) The system (via the PScroller class) calls this whenever the user has scrolled the window in one of the two dimensions. |
![]() | Overrides from class PInteractor |
![]() | New functions for class |
![]() | System callback functions. |
![]() | scaleFactor Scaling factor in pixels of the scrollBounds. |
![]() | origin Origin into the virtual bounds rectangle that the top left corner of the interactor is currently displaying |
![]() | Member variables |
Overrides from class PObject
An interactor that has its logical contents larger than the drawable bounds. This works in conjunction with the PScroller class to produce a scrolling interactor.The bounds returned by a PCanvas attached to an interactor normally indicate the size of the internal area of the window. With a scrollable interactor the PCanvas may return a larger dimension, as set by the SetScrollRange() function.
The canvas does not know (or care) what is visible and this interactor handles the necessary coordinate adjustments and and bitblt's for scrolling around a large drawable area.
The scrolling mechanism can operate in minimum "quanta". This is smallest number of pixels that can be scrolled. This is set by the
scale factor of the scrollable interactor. For example, a text editor would only ever scroll in whole lines or character widths. So the scale factor is set to the number of pixels for the height of a line and width of a character.Note that the last child interactor that is a descendent of the PScrollable class is the contents" that is scrolled by the PScroller.
When scaling is used (coords == LocalCoords), the
coordinates used are 1/4 average font width and 1/8 the font height.
The default behaviour of this function is to do the bitblt of the
interactors contents by the scrolled amount and invalidate the area
"exposed" by the scrolling.
Overrides from class PInteractor
virtual PRect GetDrawingBounds( CoordinateSystem coords ) const
New functions for class
void SetScrollRange( const PRect & rect )
PRect GetScrollRange() const
void SetScaleFactor( PORDINATE x, PORDINATE y )
y - Set vertical sccroll factor.PPoint GetScaleFactor() const
PPoint GetOrigin() const
void ScrollTo( PORDINATE x, PORDINATE y )
y - Vertical position to scroll to.void ScrollBy( PORDINATE dx, PORDINATE dy )
dy - Amount to scroll vertically. System callback functions.
virtual void OnScroll( const PPoint & delta )
Member variables
PRect scrollRange
PPoint scaleFactor
PPoint origin
Alphabetic index HTML hierarchy of classes or Java