Class TCastleFloatSlider

Unit

Declaration

type TCastleFloatSlider = class(TCastleAbstractSlider)

Description

Slider to change a float value within a given range.

Hierarchy

Overview

Fields

Public nested const DefaultMin = 0.0;
Public nested const DefaultMax = 1.0;

Methods

Public constructor Create(AOwner: TComponent); overload; override;
Public constructor Create(AOwner: TComponent; const ValuePointer: PSingle; const AMin, AMax: Single; const AOnChange: TNotifyEvent); reintroduce; overload;
Public procedure Render; override;
Public function Press(const Event: TInputPressRelease): boolean; override;
Public function Motion(const Event: TInputMotion): boolean; override;
Public function ValueToStr(const AValue: Single): string; virtual;
Public function RoundAndClamp(const AValue: Single): Single;

Properties

Published property Min: Single read FMin write SetMin default DefaultMin;
Published property Max: Single read FMax write SetMax default DefaultMax;
Published property Value: Single read FValue write SetValue default DefaultMin;
Published property MultipleOf: Single read FMultipleOf write FMultipleOf;

Description

Fields

Public nested const DefaultMin = 0.0;
 
Public nested const DefaultMax = 1.0;
 

Methods

Public constructor Create(AOwner: TComponent); overload; override;
 
Public constructor Create(AOwner: TComponent; const ValuePointer: PSingle; const AMin, AMax: Single; const AOnChange: TNotifyEvent); reintroduce; overload;

An easy way to construct float slider.

Public procedure Render; override;
 
Public function Press(const Event: TInputPressRelease): boolean; override;
 
Public function Motion(const Event: TInputMotion): boolean; override;
 
Public function ValueToStr(const AValue: Single): string; virtual;
 
Public function RoundAndClamp(const AValue: Single): Single;

Round to multiple of MultipleOf, if non-zero, and clamp to Min and Max range.

Properties

Published property Min: Single read FMin write SetMin default DefaultMin;
 
Published property Max: Single read FMax write SetMax default DefaultMax;
 
Published property Value: Single read FValue write SetValue default DefaultMin;

Current value. Usually within Min and Max range, although the general code should be ready for handle any value here (to work even during changes to Min and Max properties).

Published property MultipleOf: Single read FMultipleOf write FMultipleOf;

If non-zero, we force the value selected by user to be a multiple of this value (clamped to Min, Max range). For example, if you set this to 0.25, and slider is between 0..1, then when user clicks around 0.3 — we will pick 0.25. It user clicks around 0.4 — we will pick 0.5.

This only affects values selected by user interactions (clicking, dragging). This does not process the values you set by code to Value property, though you can use RoundAndClamp method on your values yourself.


Generated by PasDoc 0.16.0.