class PScroller: public PInteractor

An interactor that has support for scroll bars so that its logical contents may be larger than the drawable bounds.

Inheritance:


Public Fields

[more]PVerticalScrollBar* vScroll
Vertical scroll bar child interactors for scrollable window

Public Methods

[more] PScroller ( PInteractor * parent )
Create an interactor that has scroll bars and will automatically scroll a PScrollable interactor when scrolled by the user.
[more]PScrollable& GetContents ()
Get the scrollable that the scroller scrolls.
[more]PVerticalScrollBar& GetVerticalScrollBar () const
Get the vertical scroll bar in the scroller.
[more]PHorizontalScrollBar& GetHorizontalScrollBar () const
Get the horizontal scroll bar in the scroller.
[more]virtual void ShowAll ()
Show the interactor and all child and grandchild etc interactors.

Public

[more] New functions for class

Protected Fields

[more]PHorizontalScrollBar* hScroll
Horizontal scroll bar child interactors for scrollable window

Protected Methods

[more]virtual void _SetDimensions ( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Set the dimensions of the scroller interactor.

Protected

[more] Overrides from class PInteractor
[more] Member variables


Inherited from PInteractor:

Public Classes

oenum PositionOrigin
oenum CoordinateSystem
oenum AutoAdjustType

Public Fields

oPCursor cursor

Public Methods

ovirtual Comparison Compare( const PObject & obj ) const
oPInteractor* GetParent() const
oBOOL IsChild( PInteractor * parent ) const
oPINDEX GetNumChildren()
oPInteractor& operator[]( PINDEX index )
ovirtual void UpdateCommandSources()
ovirtual void SetFont( const PFont & newFont, BOOL toChildren = TRUE )
oconst PRealFont& GetFont()
oPDIMENSION ToPixelsDX( PDIMENSION x ) const
oPDIMENSION ToPixelsDY( PDIMENSION y ) const
oPORDINATE ToPixelsX( PORDINATE x ) const
oPORDINATE ToPixelsY( PORDINATE y ) const
oPDim ToPixels( const PDim & dim ) const
oPPoint ToPixels( const PPoint & pt ) const
oPRect ToPixels( const PRect & r ) const
oPDIMENSION FromPixelsDX( PDIMENSION x ) const
oPDIMENSION FromPixelsDY( PDIMENSION y ) const
oPORDINATE FromPixelsX( PORDINATE x ) const
oPORDINATE FromPixelsY( PORDINATE y ) const
oPDim FromPixels( const PDim & dim ) const
oPPoint FromPixels( const PPoint & pt ) const
oPRect FromPixels( const PRect & r ) const
ovoid SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin = TopLeftParent, PositionOrigin yOrigin = TopLeftParent )
oPPoint GetPosition( CoordinateSystem coords ) const
oPPoint ToScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
oPPoint FromScreen( PORDINATE x, PORDINATE y, CoordinateSystem coords ) const
ovoid SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
oPDim GetDimensions( CoordinateSystem coords ) const
oPRect GetStructureBounds( CoordinateSystem coords ) const
ovirtual PRect GetDrawingBounds( CoordinateSystem coords ) const
ovoid AutoAdjustBounds( PRect & bounds, AutoAdjustType type = AdjustBounds )
oBOOL ContainsPoint( const PPoint & pt, CoordinateSystem coords ) const
oPInteractor* FindInteractor( const PPoint & pt, CoordinateSystem coords ) const
ovirtual void Enable( BOOL enabled = TRUE )
ovoid Disable()
oBOOL IsEnabled() const
ovirtual void Show( BOOL visible = TRUE )
ovoid Hide()
oBOOL IsVisible() const
ovirtual void BringToTop()
ovirtual BOOL IsOnTop() const
ovoid Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovoid Update()
ovoid GrabMouse()
ovoid ReleaseMouse()
oBOOL HasMouse() const
ovoid GrabFocus()
oBOOL HasFocus() const
ovirtual void SetCursor( const PCursor & newCursor )
oPCursor GetCursor() const
ovoid SetCursorToParent( BOOL useParent = TRUE )
ovoid SetAllCursors( const PCursor & newCursor )
ovoid RestoreAllCursors()
ovoid SetWaitCursor()
ovoid SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCursorPos( CoordinateSystem coords ) const
ovirtual void ShowCursor( BOOL show = TRUE )
ovoid HideCursor()
ovoid SetCaret( const PCaret & newCaret )
oPCaret GetCaret() const
ovoid SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
oPPoint GetCaretPos( CoordinateSystem coords ) const
ovirtual void ShowCaret(BOOL show = TRUE)
ovoid HideCaret()
ovirtual void SetForegroundColour( const PColour & newColour )
oconst PColour& GetForegroundColour() const
ovirtual void SetBackgroundColour( const PColour & newColour )
oconst PColour& GetBackgroundColour() const
oPDim GetBorderSize() const
oconst PColour& GetBorderColour() const
oPCanvas* StartMouseTrack( BOOL wantsCanvas = FALSE )
ovirtual void OnMouseMove( PKeyCode button, const PPoint & where )
ovirtual void OnMouseDown( PKeyCode button, const PPoint & where, BOOL doubleClick )
ovirtual void OnMouseUp( PKeyCode button, const PPoint & where )
ovirtual BOOL OnKeyDown( PKeyCode key, unsigned repeat )
ovirtual void OnKeyUp( PKeyCode key )
ovirtual void OnKeyInput( const PString & str )
ovirtual void OnGainFocus()
ovirtual void OnLostFocus()
ovirtual void OnStartInput()
ovirtual BOOL OnEndInput()
ovirtual void OnRedraw( PCanvas & canvas )
ovirtual void OnControlNotify( PControl & control, int option )
ovirtual void OnSelectHelp()
ovirtual PBalloon* OnBalloonHelp()
ovirtual void OnMouseTrack( PCanvas * canvas, const PPoint & where, BOOL lastTrack )
ovirtual void _SetPosition( PORDINATE x, PORDINATE y, PositionOrigin xOrigin, PositionOrigin yOrigin )

Public

Overrides from class PObject

System callback functions.

Protected Fields

oPApplication* owner
oPInteractor* parent
oPInteractorList children
oPRealFont font
oPCursor savedCursor
oPCaret caret
oPPoint caretPosition
oint caretVisible
oPColour foregroundColour
oPColour backgroundColour
oPInteractor* mouseTrackInteractor
oPInteractorCanvas* mouseTrackCanvas

Protected Methods

ovirtual void _Invalidate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _Validate( PORDINATE x, PORDINATE y, PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
ovirtual void _SetCursorPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void _SetCaretPos( PORDINATE x, PORDINATE y, CoordinateSystem coords )
ovirtual void SetFocusInteractor( PInteractor * interactor )
ovirtual PInteractor* GetFocusInteractor() const
ovirtual void UpdateMyCommandSources()

Protected

o Flag to indicate that the parent interactor layouts cursor should be used with this interactor.


Documentation

An interactor that has support for scroll bars so that its logical contents may be larger than the drawable bounds. This works in conjunction with the PScrollable 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 PScrollable::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.

Note that the last child interactor that is a descendent of the PScrollable class is the contents" that is scrolled by the scroller.

o PScroller( PInteractor * parent )
Create an interactor that has scroll bars and will automatically scroll a PScrollable interactor when scrolled by the user.
Parameters:
parent - Interactor into which the scroller is put.

o New functions for class

oPScrollable& GetContents()
Get the scrollable that the scroller scrolls. If no PScrollable interactor has been created with this instance of PScroller as its parent, this function will assert.

Returns:
reference to contents of scroller interactor.

oPVerticalScrollBar& GetVerticalScrollBar() const
Get the vertical scroll bar in the scroller. This will allow the user to customise the usage of the scroller, eg hide the scroll bar as only one dimension is scrollable.

Returns:
reference to vertical scroll bar.

oPHorizontalScrollBar& GetHorizontalScrollBar() const
Get the horizontal scroll bar in the scroller. This will allow the user to customise the usage of the scroller, eg hide the scroll bar as only one dimension is scrollable.

Returns:
reference to horizontal scroll bar.

o Overrides from class PInteractor

ovirtual void ShowAll()
Show the interactor and all child and grandchild etc interactors.

This enabled the interactor tree in post order, ie all children have their PInteractor::ShowAll() function called and then the interactor itself is shown using the PInteractor::Show() function.

ovirtual void _SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
Set the dimensions of the scroller interactor. This will automatically adjust the position and dimensions of the scroll bars and the contents interactor.

When scaling is used (coords == LocalCoords), the coordinates used are 1/4 average font width and 1/8 the font height.

Parameters:
width - New width for scroller.
height - New height for scroller.
coords - Coordinate system to use.

o Member variables

oPVerticalScrollBar* vScroll
Vertical scroll bar child interactors for scrollable window

oPHorizontalScrollBar* hScroll
Horizontal scroll bar child interactors for scrollable window


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.