Unit 'Forms' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]

TControlScrollBar.ScrollHandler

Handler for scroll bar movement messages.

Declaration

Source position: forms.pp line 114

protected procedure TControlScrollBar.ScrollHandler(

  var Message: TLMScroll

);

Arguments

Message

  

Control message examined in the method.

Description

ScrollHandler is a method used to ensure that the control message in Message is applied to the Position property for the scroll bar. ScrollHandler uses the ScrollCode member from the TLMScroll instance to determine the actions needed in the method. It handles the following ScrollCode values:

SB_LINEUP
Decreases Position by the value in Increment.
SB_LINEDOWN
Increases Position by the value in Increment.
SB_PAGEUP
Decreases Position by the value in Page.
SB_PAGEDOWN
Increases Position by the value in Page.
SB_THUMBPOSITION
Sets Position to the value in the Pos member in Message.
SB_THUMBTRACK
Sets Position to the value in the Pos member in Message when Tracking is enabled. No actions are performed when Tracking is set to False.
SB_TOP
Sets Position to 0 (zero).
SB_BOTTOM
Sets Position to the value in the Range property.

No actions are performed in the method if Message has any other value in its ScrollCode member. No actions are performed in the method at design-time.

ScrollHandler ensures the the new value for the Position property is in the range 0..Range. Calls InvalidateScrollInfo to force scroll bar information to be re-initialized. Calls SetPosition to apply the new value for the Position property and scrolls the associated TScrollingWinControl accordingly. Sets the Result member in Message to 1 to indicate the control message was handled in the method.

ScrollHandler is called when the WMHScroll or WMVScroll methods in the associated TScrollingWinControl instance are used to handle scroll messages.

See also

TControlScrollBar.Increment

  

The small Position increment, applicable to the scroll bar arrows.

TControlScrollBar.Page

  

The slider size, position increment applicable to the scroll bar area beneath the slider.

TControlScrollBar.Position

  

Position of the slider, 0..Range-Page.

TControlScrollBar.Range

  

The virtual size of the Parent Control.

TScrollingWinControl.WMHScroll

  

Delegates scroll messages to the handler for the horizontal scroll bar.

TScrollingWinControl.WMVScroll

  

Delegates scroll messages to the handler for the vertical scroll bar.