Sign in Join
FPDoc Onlineexperiment

TControlScrollBar.ScrollHandler procedure

Member of TControlScrollBarprotectedIn unit Forms

Handler for scroll bar movement messages.

Declaration

pascal
procedure 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 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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.