Canvas Toolkit
← Class index

CDoubleSpinBox

Widgets · extends CWidget

Implements a spin box for floating-point values.

import { CDoubleSpinBox } from "canvas-toolkit-lib";

Declared members

readonly valueChanged: CSignal<[number]>;

Signal emitted when the value changes.

constructor(parent?: CWidget | null);

Creates a new instance.

minimum(): number;

Returns the minimum value.

maximum(): number;

Returns the maximum value.

value(): number;

Returns the current value.

singleStep(): number;

Returns the step used by the buttons, arrow keys and mouse wheel.

decimals(): number;

Returns the number of digits shown after the decimal point.

setMinimum(minimum: number): void;

Sets the minimum value.

setMaximum(maximum: number): void;

Sets the maximum value.

setRange(minimum: number, maximum: number): void;

Sets the permitted value range.

setValue(value: number): void;

Sets the current value.

setSingleStep(step: number): void;

Sets the step used by the buttons, arrow keys and mouse wheel.

setDecimals(decimals: number): void;

Sets the number of digits shown after the decimal point.

stepUp(): void;

Increases the current value by one step.

stepDown(): void;

Decreases the current value by one step.

lineEdit(): CLineEdit;

Returns the embedded line editor.

setGeometry(x: number, y: number, width: number, height: number): void;

Sets the geometry.

sizeHint(): CSize;

Returns the preferred size of the widget.

protected keyPressEvent(event: CKeyEvent): void;

Handles keyboard stepping and commits edited text.

protected wheelEvent(event: CWheelEvent): void;

Handles mouse-wheel stepping.