Class TCastleFloatSlider
Unit
CastleControls
Declaration
type TCastleFloatSlider = class(TCastleAbstractSlider)
Description
Slider to change a float value within a given range.
Hierarchy
Overview
Fields
Methods
|
constructor Create(AOwner: TComponent); overload; override; |
|
constructor Create(AOwner: TComponent; const ValuePointer: PSingle; const AMin, AMax: Single; const AOnChange: TNotifyEvent); reintroduce; overload; |
|
procedure Render; override; |
|
function Press(const Event: TInputPressRelease): boolean; override; |
|
function Motion(const Event: TInputMotion): boolean; override; |
|
function ValueToStr(const AValue: Single): string; virtual; |
|
function RoundAndClamp(const AValue: Single): Single; |
Properties
|
property Min: Single read FMin write SetMin default DefaultMin; |
|
property Max: Single read FMax write SetMax default DefaultMax; |
|
property Value: Single read FValue write SetValue default DefaultMin; |
|
property MultipleOf: Single read FMultipleOf write FMultipleOf; |
Description
Fields
|
nested const DefaultMin = 0.0; |
|
|
nested const DefaultMax = 1.0; |
|
Methods
|
constructor Create(AOwner: TComponent); overload; override; |
|
|
constructor Create(AOwner: TComponent; const ValuePointer: PSingle; const AMin, AMax: Single; const AOnChange: TNotifyEvent); reintroduce; overload; |
An easy way to construct float slider.
|
|
procedure Render; override; |
|
|
function Motion(const Event: TInputMotion): boolean; override; |
|
|
function ValueToStr(const AValue: Single): string; virtual; |
|
|
function RoundAndClamp(const AValue: Single): Single; |
Round to multiple of MultipleOf, if non-zero, and clamp to Min and Max range.
|
Properties
|
property Min: Single read FMin write SetMin default DefaultMin; |
|
|
property Max: Single read FMax write SetMax default DefaultMax; |
|
|
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).
|
|
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.