Class TCastleScrollViewCustom

Unit

Declaration

type TCastleScrollViewCustom = class(TCastleUserInterface)

Description

Abstract user interface with a scrollbar. In most cases you want to use TCastleScrollView in your application, which is a more comfortable descendant of this class.

Hierarchy

Overview

Fields

Protected FScrollbarLeft: Boolean;
Public nested const DefaultKeyScrollSpeed = 200.0;
Public nested const DefaultWheelScrollSpeed = 20.0;

Methods

Protected procedure DoScrollChange; virtual;
Protected function ScrollMin: Single;
Protected function ScrollMax: Single;
Protected function GetPageSize: Single; virtual; abstract;
Protected function GetCompleteSize: Single; virtual; abstract;
Public constructor Create(AOwner: TComponent); override;
Public destructor Destroy; override;
Public procedure RenderOverChildren; override;
Public function Press(const Event: TInputPressRelease): boolean; override;
Public function Release(const Event: TInputPressRelease): boolean; override;
Public function PreviewPress(const Event: TInputPressRelease): boolean; override;
Public function Motion(const Event: TInputMotion): boolean; override;
Public procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override;
Public function EffectiveScrollBarWidth: Single;

Properties

Protected property ScrollbarVisible: Boolean read FScrollbarVisible;
Public property TintScrollBarInactive: TCastleColor read FTintScrollBarInactive write FTintScrollBarInactive;
Published property KeyScrollSpeed: Single read FKeyScrollSpeed write FKeyScrollSpeed default DefaultKeyScrollSpeed;
Published property WheelScrollSpeed: Single read FWheelScrollSpeed write FWheelScrollSpeed default DefaultWheelScrollSpeed;
Published property ScrollBarWidth: Single read FScrollBarWidth write FScrollBarWidth default 0;
Published property ScrollBarLeft: Boolean read FScrollBarLeft write FScrollBarLeft default false;
Published property EnableDragging: Boolean read FEnableDragging write FEnableDragging default false;
Published property Scroll: Single read FScroll write SetScroll default 0;
Published property TintScrollBarInactivePersistent: TCastleColorPersistent read FTintScrollBarInactivePersistent ;

Description

Fields

Protected FScrollbarLeft: Boolean;
 
Public nested const DefaultKeyScrollSpeed = 200.0;
 
Public nested const DefaultWheelScrollSpeed = 20.0;
 

Methods

Protected procedure DoScrollChange; virtual;
 
Protected function ScrollMin: Single;

Minimum sensible value for Scroll, corresponds to scrollbar slider at the top.

Protected function ScrollMax: Single;

Maximum sensible value for Scroll, corresponds to scrollbar slider at the bottom.

Protected function GetPageSize: Single; virtual; abstract;

How much Scroll is represented by the height of the scrollbar slider. Among other things, this determines how much Scroll changes in response to Page Up and Page Down keys.

Protected function GetCompleteSize: Single; virtual; abstract;

How much Scroll is represented by the height of the entire scrollbar (that is, the height of this TCastleScrollViewCustom instance).

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

Scroll bar width, either from ScrollBarWidth or Theme.ScrollBarWidth.

Properties

Protected property ScrollbarVisible: Boolean read FScrollbarVisible;
 
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 KeyScrollSpeed: Single read FKeyScrollSpeed write FKeyScrollSpeed default DefaultKeyScrollSpeed;

Speed of scrolling by arrow 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: Single read FScrollBarWidth write FScrollBarWidth default 0;

Width of the scroll bar. Value of 0 means to use global default in Theme.ScrollBarWidth.

Published property ScrollBarLeft: Boolean read FScrollBarLeft write FScrollBarLeft default false;

Position of the scroll bar.

False

Scroll bar is located on the right side of the ScrollView.

True

Scroll bar is located on the left side of the ScrollView. Pay attention, that additional space is not made for the scroll bar, you have to specify ScrollArea.HorizontalAnchorDelta manually, e.g. ScrollArea.HorizontalAnchorDelta := ScrollBarWidth + Gap;

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.

Published property Scroll: Single read FScroll write SetScroll default 0;

How much do we scroll. Setting it always clamps the value to a sensible range, between ScrollMin and ScrollMax.

In case of TCastleScrollView, setting this moves the TCastleScrollView.ScrollArea vertical anchor, effectively moving the scrolled children. As such, it is expressed in unscaled pixels (just like TCastleUserInterface.VerticalAnchorDelta, TCastleUserInterface.Height, TCastleUserInterface.EffectiveHeight...).

In case of TCastleScrollViewManual, it can correspond to anything you want. You handle TCastleScrollViewManual.OnChange yourself, and interpret this value in whatever way you want.

Published property TintScrollBarInactivePersistent: TCastleColorPersistent read FTintScrollBarInactivePersistent ;

TintScrollBarInactive that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write TintScrollBarInactive directly.

See also
TintScrollBarInactive
Color and alpha tint to use when scrollbar is not used.

Generated by PasDoc 0.16.0.