class PScrollBar: public PControl

A scroll bar control for visually setting an integer value.

Inheritance:


Public Methods

[more] PScrollBar ( PInteractor * parent, PSCROLLBAR_VALUE max, PSCROLLBAR_VALUE min, PSCROLLBAR_VALUE val, PSCROLLBAR_VALUE sml, PSCROLLBAR_VALUE lge )
Create a new scroll bar control with the specified default parameters for controlling the scroll bars operation.
[more] PScrollBar ( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PSCROLLBAR_VALUE * valuePtr )
Create control from interactor layout with the specified control ID.
[more]virtual ~PScrollBar ()
Destroy the scroll bar.
[more]virtual void TransferValue ( int option )
This function transfers the value of the control to or from the variable pointed to by the value pointer member variable.
[more]void SetValue ( PSCROLLBAR_VALUE val, BOOL redraw = TRUE )
Set the current thumb position of the scroll bar.
[more]PSCROLLBAR_VALUE GetValue () const
Get the current thumb position of the scroll bar.
[more]PSCROLLBAR_VALUE* GetValuePointer () const
Get the current value pointer associated with the control.
[more]void SetValuePointer ( PSCROLLBAR_VALUE * ptr )
Set the current value pointer associated with the control.
[more]void SetMaximum ( PSCROLLBAR_VALUE val, BOOL redraw = TRUE )
Set the maximum thumb position of the scroll bar.
[more]PSCROLLBAR_VALUE GetMaximum () const
Get the maximum thumb position of the scroll bar.
[more]void SetMinimum ( PSCROLLBAR_VALUE val, BOOL redraw = TRUE )
Set the minimum thumb position of the scroll bar.
[more]PSCROLLBAR_VALUE GetMinimum () const
Get the minimum thumb position of the scroll bar.
[more]void SetSmallNudge ( PSCROLLBAR_VALUE val )
Set the the amount by which the up and down arrows will move the thumb each time the are clicked.
[more]PSCROLLBAR_VALUE GetSmallNudge () const
Get the the amount by with the up and down arrows will move the thumb.
[more]void SetLargeNudge ( PSCROLLBAR_VALUE val )
Set the the amount by which clicking above or below the thumb will move it.
[more]PSCROLLBAR_VALUE GetLargeNudge () const
Get the the amount by which clicking above or below the thumb will move it.

Public

[more] PNotifier codes
[more] Codes passed to the notification function on changes of state.
[more] Overrides from class PControl
[more] New functions for class

Protected

[more]PSCROLLBAR_VALUE Member variables


Inherited from PControl:

Public Fields

oPRESOURCE_ID controlID

Public Methods

ovirtual PBalloon* OnBalloonHelp()
ovirtual BOOL IsTabStop() const
oPRESOURCE_ID GetControlID() const
ovoid SetControlID( PRESOURCE_ID theID )
oconst PNotifier& GetNotifier() const
oBOOL WillNotifyOnStateUpdate() const
ovoid SetNotifier( const PNotifier & func, BOOL notifyForStateUpdate = FALSE )
oconst PString& GetBalloonHelp() const
ovoid SetBalloonHelp( const PString & text )
ovirtual void DefaultDimensions()
ovirtual void UpdateMyCommandSources()

Public

Overrides from class PInteractor

Protected Fields

oPNotifier callback
ovoid* valuePointer
oBOOL notifyForStateUpdate
oPString balloonHelpText

Protected

Overrides from class PInteractor


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 ShowAll()
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 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 _SetDimensions( PDIMENSION width, PDIMENSION height, CoordinateSystem coords )
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

Protected

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


Documentation

A scroll bar control for visually setting an integer value.

The exact appearance of a scroll bar is platform dependent. However certain functionality exists for all platforms. These are that the scroll bar allows values between a minimum and maximum to be set via small nudges (typically a up or down arrow), large nudges (typically the page up or down area to either side of the thumb) or by explicitly setting a value (typically by dragging the thumb).

This is an abstract class combining the common functionality of PHorizontalScrollBar and PVerticalScrollBar controls.

o PScrollBar( PInteractor * parent, PSCROLLBAR_VALUE max, PSCROLLBAR_VALUE min, PSCROLLBAR_VALUE val, PSCROLLBAR_VALUE sml, PSCROLLBAR_VALUE lge )
Create a new scroll bar control with the specified default parameters for controlling the scroll bars operation.
Parameters:
parent - Interactor into which the control is placed.
max - Maximum value for scroll bar.
min - Minimum value for scroll bar.
val - Initial value for scroll bar.
sml - Amount to move with the nudge button.
lge - Amount to move with the paging area.

o PScrollBar( PInteractorLayout * parent, PRESOURCE_ID ctlID, const PNotifier & notify, PSCROLLBAR_VALUE * valuePtr )
Create control from interactor layout with the specified control ID.
Parameters:
parent - Interactor into which the box is placed.
ctlID - Identifier for the control in the layout.
notify - Function to call when changes state.
valuePtr - Variable to change to the scrollbar value.

ovirtual ~PScrollBar()
Destroy the scroll bar.

o PNotifier codes

o Codes passed to the notification function on changes of state.
Codes passed to the notification function on changes of state.

A change to a scroll bar may proceed for some time, for example if the mouse button is pressed in the down arrow and held down. An auto-repeat would occur to continually change the scroll bar value until it is released.

o EndTrack
A scroll bar value change operation has been ended by the user.

o StartTrack
A scroll bar value change operation has been initiated by the user.

o Tracking
A scroll bar value change operation is in progress by the user.

o Overrides from class PControl

ovirtual void TransferValue( int option )
This function transfers the value of the control to or from the variable pointed to by the value pointer member variable.
Parameters:
option - Transfer value option. When this is -1 when the function transfers the value from the value pointer into the control. This is called in PDialog::OnInit() function. When option is zero then the function transfers the value from the control to the value pointer variable. This is called just before the callback function every time the scroll bar value changes.

o New functions for class

ovoid SetValue( PSCROLLBAR_VALUE val, BOOL redraw = TRUE )
Set the current thumb position of the scroll bar. If the redraw parameter is TRUE then this will be updated on the screen immediately (within OS constraints).
Parameters:
val - New value for scroll bar.
redraw - Whether to update the screen.

oPSCROLLBAR_VALUE GetValue() const
Get the current thumb position of the scroll bar.

Returns:
current scroll bar value.

oPSCROLLBAR_VALUE* GetValuePointer() const
Get the current value pointer associated with the control. The variable pointed to by this is autamatically updated with the current value of the scroll bar.

Returns:
value pointer associated with the control.

ovoid SetValuePointer( PSCROLLBAR_VALUE * ptr )
Set the current value pointer associated with the control. The variable pointed to by this is autamatically updated with the current value of the scroll bar.

ovoid SetMaximum( PSCROLLBAR_VALUE val, BOOL redraw = TRUE )
Set the maximum thumb position of the scroll bar. If the redraw parameter is TRUE then this will be updated on the screen immediately (within OS constraints).
Parameters:
val - New maximum value for the scroll bar.
redraw - Whether to update the screen.

oPSCROLLBAR_VALUE GetMaximum() const
Get the maximum thumb position of the scroll bar.

Returns:
current scroll bar maximum.

ovoid SetMinimum( PSCROLLBAR_VALUE val, BOOL redraw = TRUE )
Set the minimum thumb position of the scroll bar. If the redraw parameter is TRUE then this will be updated on the screen immediately (within OS constraints).
Parameters:
val - New minimum value for the scroll bar.
redraw - Whether to update the screen.

oPSCROLLBAR_VALUE GetMinimum() const
Get the minimum thumb position of the scroll bar.

Returns:
current scroll bar minimum.

ovoid SetSmallNudge( PSCROLLBAR_VALUE val )
Set the the amount by which the up and down arrows will move the thumb each time the are clicked. The up and down arrow keys do the same thing if the scroll bar has the focus.
Parameters:
val - New nudge value for small increments.

oPSCROLLBAR_VALUE GetSmallNudge() const
Get the the amount by with the up and down arrows will move the thumb.

Returns:
small nudge value.

ovoid SetLargeNudge( PSCROLLBAR_VALUE val )
Set the the amount by which clicking above or below the thumb will move it. The page up and page down keys do the same thing if the scroll bar has the focus.
Parameters:
val - New nudge value for large increments.

oPSCROLLBAR_VALUE GetLargeNudge() const
Get the the amount by which clicking above or below the thumb will move it.

Returns:
large nudge value.

oPSCROLLBAR_VALUE Member variables


Direct child classes:
PHorizontalScrollBar

Alphabetic index HTML hierarchy of classes or Java



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