Class TCastleScrollView

Unit

Declaration

type TCastleScrollView = class(TUIControlSizeable)

Description

Children added to ScrollArea can be scrolled vertically. We automatically show a scrollbar, and handle various scrolling inputs to be functional on both desktops and mobile (we handle scrolling by keys, mouse wheel, dragging by scrollbar, dragging the whole area - see EnableDragging).

Hierarchy

Overview

Fields

Public nested const DefaultKeyScrollSpeed = 200.0;
Public nested const DefaultWheelScrollSpeed = 20.0;
Public nested const DefaultScrollBarWidth = 20;

Methods

Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure Render; override;
Public procedure RenderOverChildren; override;
Public function Press(const Event: TInputPressRelease): boolean; override;
Public function Release(const Event: TInputPressRelease): boolean; override;
Public function Motion(const Event: TInputMotion): boolean; override;
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;

Properties

Public property TintScrollBarInactive: TCastleColor read FTintScrollBarInactive write FTintScrollBarInactive;
Published property ScrollArea: TUIControlSizeable read FScrollArea;
Published property KeyScrollSpeed: Single read FKeyScrollSpeed write FKeyScrollSpeed default DefaultKeyScrollSpeed;
Published property WheelScrollSpeed: Single read FWheelScrollSpeed write FWheelScrollSpeed default DefaultWheelScrollSpeed;
Published property ScrollBarWidth: Cardinal read FScrollBarWidth write FScrollBarWidth default DefaultScrollBarWidth;
Published property EnableDragging: boolean read FEnableDragging write FEnableDragging default false;

Description

Fields

Public nested const DefaultKeyScrollSpeed = 200.0;
 
Public nested const DefaultWheelScrollSpeed = 20.0;
 
Public nested const DefaultScrollBarWidth = 20;
 

Methods

Public constructor Create(AOwner: TComponent); override;
 
Public destructor Destroy; override;
 
Public procedure Render; override;
 
Public procedure RenderOverChildren; override;
 
Public function Press(const Event: TInputPressRelease): boolean; override;
 
Public function Release(const Event: TInputPressRelease): boolean; override;
 
Public function Motion(const Event: TInputMotion): boolean; override;
 
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;
 

Properties

Public property TintScrollBarInactive: TCastleColor read FTintScrollBarInactive write FTintScrollBarInactive;

Color and alpha tint to use when scrollbar is not used. May have some alpha, which makes scrollbar "make itself more opaque", and thus noticeable, when you start dragging. By default it's opaque white, which means that no tint is shown.

Published property ScrollArea: TUIControlSizeable read FScrollArea;

Children you add here will be scrolled. Make sure to add some children here, and set proper size of this control, to have a useful scrolling area.

Published property KeyScrollSpeed: Single read FKeyScrollSpeed write FKeyScrollSpeed default DefaultKeyScrollSpeed;

Speed of scrolling by keys, in pixels (before UI scaling) per second.

Published property WheelScrollSpeed: Single read FWheelScrollSpeed write FWheelScrollSpeed default DefaultWheelScrollSpeed;

Speed of scrolling by mouse wheel, in pixels (before UI scaling) per event.

Published property ScrollBarWidth: Cardinal read FScrollBarWidth write FScrollBarWidth default DefaultScrollBarWidth;

Width of the scroll bar.

Published property EnableDragging: boolean read FEnableDragging write FEnableDragging default false;

Enable scrolling by dragging anywhere in the scroll area. This is usually suitable for mobile devices. Note that this doesn't affect the dragging directly by the scrollbar, which is always enabled.


Generated by PasDoc 0.15.0.