fltk.widgets

FLTK Common Widgets

This module provides common widget classes:

  • Box: Simple display widget for text or decoration
  • Button: Clickable button with callback support
  • CheckButton: Checkbox button
  • RadioButton: Radio button (mutually exclusive in group)
  • ToggleButton: Toggle button (maintains on/off state)
  • LightButton: Button with indicator light
  • RepeatButton: Button that auto-repeats when held
  • ReturnButton: Default button (responds to Enter key)
  • RoundButton: Round radio-style button
  • Input: Text input field
  • FloatInput: Floating-point number input
  • IntInput: Integer number input
  • SecretInput: Password input (shows dots)
  • MultilineInput: Multi-line text input
  • FileInput: File path input
  • Output: Read-only text display
  • MultilineOutput: Multi-line read-only text
  • Slider: Basic slider for selecting numeric values
  • ValueSlider: Slider with value display
  • Progress: Progress bar
  • Dial: Circular dial for numeric values
  • Counter: Numeric counter with +/- buttons
  • Roller: Rolling valuator
  • Scrollbar: Scrollbar widget
  • ValueInput: Numeric input field
  • ValueOutput: Numeric output display
  • Adjuster: Valuator with arrow buttons

    Authors

    Dejan Lekić

    License

    BSD-3-Clause

Types 51

classBox : Widget

Simple box widget for displaying text or decoration.

Box widgets are typically used as labels or decorative elements. They can display text and have various border styles.

Example:

auto box = new Box(Boxtype.UP_BOX, 10, 10, 100, 30, "Hello");

Fields
BoxPtr _boxHandleThe underlying box handle
Methods
BoxPtr boxHandle() @safe nothrow @nogcReturns the underlying box handle.
Constructors
this(Boxtype boxtype, int x, int y, int width, int height, string label = null)Creates a new box widget.
this(int x, int y, int width, int height, string label = null)Creates a new flat box widget (no border).
Destructors
~thisDestroys the box and releases resources.
classButton : Widget

Clickable button widget.

Buttons respond to mouse clicks and can trigger callbacks. They can display text labels and various visual states.

Example:

auto button = new Button(10, 10, 100, 30, "Click Me");
button.onClick = () {
   writeln("Button clicked!");
};

Fields
ButtonPtr _buttonHandleThe underlying button handle
Methods
ButtonPtr buttonHandle() @safe nothrow @nogcReturns the underlying button handle.
bool value() const nothrow @nogcGets the button's value (pressed state).
void value(bool pressed) nothrow @nogcSets the button's value (pressed state).
bool pressed() const nothrow @nogcChecks if the button is currently pressed.
void pressed(bool state) nothrow @nogcSets whether the button is pressed.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new button widget.
Destructors
~thisDestroys the button and releases resources.
classInput : Widget

Text input widget.

Input widgets allow users to enter and edit text.

Example:

auto input = new Input(10, 10, 200, 25, "Name:");
input.value = "John Doe";
string text = input.value;

Fields
InputPtr _inputHandleThe underlying input handle
Methods
InputPtr inputHandle() @safe nothrow @nogcReturns the underlying input handle.
string value() constGets the input's text value.
void value(string text)Sets the input's text value.
string text() constGets the text content.
void text(string content)Sets the text content.
void clear()Clears the input field.
bool empty() constChecks if the input is empty.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new input widget.
Destructors
~thisDestroys the input and releases resources.

Slider widget for selecting numeric values.

ValueSlider widgets allow users to select a value from a range by dragging a slider or clicking on the track. The current value is displayed next to the slider.

Example:

auto slider = new ValueSlider(10, 10, 200, 25, "Volume:");
slider.range(-10, 10);
slider.step = 1;
slider.value = 0;
double val = slider.value;

Fields
ValueSliderPtr _sliderHandleThe underlying value slider handle
Methods
ValueSliderPtr sliderHandle() @safe nothrow @nogcReturns the underlying slider handle.
double value() constGets the slider's current value.
void value(double val)Sets the slider's current value.
void minimum(double min)Sets the slider's minimum value.
void maximum(double max)Sets the slider's maximum value.
void range(double min, double max)Sets the slider's range (minimum and maximum).
void step(double s)Sets the slider's step value.
void setHorizontal()Sets the slider to horizontal orientation.
void setVertical()Sets the slider to vertical orientation.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new value slider widget.
Destructors
~thisDestroys the slider and releases resources.

Horizontal value slider widget.

HorValueSlider is a convenience class that creates a ValueSlider with horizontal orientation as the default. The slider displays its current numeric value.

Example:

auto slider = new HorValueSlider(10, 10, 200, 25, "Volume:");
slider.range(0, 100);
slider.value = 50;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new horizontal value slider widget.

Slider type constants.

These values define the visual style and orientation of slider widgets.

VERT_SLIDER = 0Vertical slider (default)
HOR_SLIDER = 1Horizontal slider
VERT_FILL_SLIDER = 2Vertical filled slider
HOR_FILL_SLIDER = 3Horizontal filled slider
VERT_NICE_SLIDER = 4Vertical slider with nice appearance
HOR_NICE_SLIDER = 5Horizontal slider with nice appearance

Basic slider widget for selecting numeric values.

Slider widgets allow users to select a value from a range by dragging a slider or clicking on the track. Unlike ValueSlider, this widget does not display the current value.

Slider inherits from Valuator and provides all valuator functionality including value, minimum, maximum, step, clamp, round, etc.

Example:

auto slider = new Slider(10, 10, 200, 25, "Volume:");
slider.range(0, 100);
slider.value = 50;
slider.sliderType = SliderType.HOR_SLIDER;

Fields
SliderPtr _sliderHandle
Methods
SliderPtr sliderHandle() @safe nothrow @nogcReturns the underlying slider handle.
SliderType sliderType() const nothrow @nogcGets the slider type.
void sliderType(SliderType type) nothrow @nogcSets the slider type.
void setHorizontal()Sets the slider to horizontal orientation.
void setVertical()Sets the slider to vertical orientation.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new slider widget.
Destructors

Slider widget with a filled track.

FillSlider is a convenience class that creates a Slider with a filled appearance. The track fills from the minimum to the current value, making it useful as a progress or value meter.

Example:

auto slider = new FillSlider(10, 10, 200, 25, "Progress:");
slider.range(0, 100);
slider.value = 75;

Methods
void setHorizontal()Sets the slider to horizontal filled orientation.
void setVertical()Sets the slider to vertical filled orientation.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new filled slider widget.

Slider widget with a nice visual appearance.

NiceSlider is a convenience class that creates a Slider with a nicer looking control knob compared to the standard slider.

Example:

auto slider = new NiceSlider(10, 10, 200, 25, "Volume:");
slider.range(0, 100);
slider.value = 50;

Methods
void setHorizontal()Sets the slider to horizontal nice orientation.
void setVertical()Sets the slider to vertical nice orientation.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new nice slider widget.

Horizontal slider widget.

HorSlider is a convenience class that creates a Slider with horizontal orientation as the default.

Example:

auto slider = new HorSlider(10, 10, 200, 25, "Volume:");
slider.range(0, 100);
slider.value = 50;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new horizontal slider widget.

Horizontal filled slider widget.

HorFillSlider is a convenience class that creates a horizontal slider with a filled appearance. The track fills from the minimum to the current value.

Example:

auto slider = new HorFillSlider(10, 10, 200, 25, "Progress:");
slider.range(0, 100);
slider.value = 75;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new horizontal filled slider widget.

Horizontal nice slider widget.

HorNiceSlider is a convenience class that creates a horizontal slider with a nicer visual appearance.

Example:

auto slider = new HorNiceSlider(10, 10, 200, 25, "Volume:");
slider.range(0, 100);
slider.value = 50;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new horizontal nice slider widget.

Checkbox button widget.

CheckButton widgets display a checkbox that can be checked or unchecked.

Example:

auto check = new CheckButton(10, 10, 100, 25, "Enable");
check.checked = true;
if (check.checked) { ... }

Fields
CheckButtonPtr _checkHandle
Methods
CheckButtonPtr checkHandle() @safe nothrow @nogc
bool checked() const nothrow @nogc
void checked(bool state) nothrow @nogc
bool value() const nothrow @nogcAlias for checked property
void value(bool state) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Radio button widget.

RadioButton widgets are mutually exclusive within a group - only one can be selected at a time.

Example:

auto radio1 = new RadioButton(10, 10, 100, 25, "Option 1");
auto radio2 = new RadioButton(10, 40, 100, 25, "Option 2");
radio1.selected = true;

Fields
RadioButtonPtr _radioHandle
Methods
RadioButtonPtr radioHandle() @safe nothrow @nogc
bool selected() const nothrow @nogc
void selected(bool state) nothrow @nogc
bool value() const nothrow @nogcAlias for selected property
void value(bool state) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Toggle button widget.

ToggleButton widgets maintain an on/off state when clicked.

Example:

auto toggle = new ToggleButton(10, 10, 100, 25, "Toggle");
toggle.on = true;
if (toggle.on) { ... }

Fields
ToggleButtonPtr _toggleHandle
Methods
ToggleButtonPtr toggleHandle() @safe nothrow @nogc
bool on() const nothrow @nogc
void on(bool state) nothrow @nogc
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Light button widget with indicator light.

LightButton widgets display an indicator light that shows on/off state visually.

Example:

auto light = new LightButton(10, 10, 100, 25, "Enable");
light.on = true;  // turns indicator on

Fields
LightButtonPtr _lightHandle
Methods
LightButtonPtr lightHandle() @safe nothrow @nogc
bool on() const nothrow @nogc
void on(bool state) nothrow @nogc
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Radio light button widget.

RadioLightButton widgets are light buttons with radio button behavior, meaning they are mutually exclusive within a group. When one radio light button is selected, others in the same group are automatically deselected.

Example:

auto option1 = new RadioLightButton(10, 10, 100, 25, "Option 1");
auto option2 = new RadioLightButton(10, 40, 100, 25, "Option 2");
option1.on = true;  // selects option1, deselects others in group

Fields
RadioLightButtonPtr _radioLightHandle
Methods
RadioLightButtonPtr radioLightHandle() @safe nothrow @nogcReturns the underlying radio light button handle.
bool on() const nothrow @nogcGets or sets the on/off state of the button.
void on(bool state) nothrow @nogcditto
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogcditto
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new radio light button widget.
Destructors

Radio round button widget.

RadioRoundButton widgets are round buttons with radio button behavior, meaning they are mutually exclusive within a group. When one radio round button is selected, others in the same group are automatically deselected.

Example:

auto option1 = new RadioRoundButton(10, 10, 100, 25, "Option 1");
auto option2 = new RadioRoundButton(10, 40, 100, 25, "Option 2");
option1.on = true;  // selects option1, deselects others in group

Fields
RadioRoundButtonPtr _radioRoundHandle
Methods
RadioRoundButtonPtr radioRoundHandle() @safe nothrow @nogcReturns the underlying radio round button handle.
bool on() const nothrow @nogcGets or sets the on/off state of the button.
void on(bool state) nothrow @nogcditto
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogcditto
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new radio round button widget.
Destructors

Toggle light button widget.

ToggleLightButton widgets are light buttons that maintain on/off state. Unlike radio buttons, multiple toggle light buttons can be on at the same time.

Example:

auto option1 = new ToggleLightButton(10, 10, 100, 25, "Option 1");
auto option2 = new ToggleLightButton(10, 40, 100, 25, "Option 2");
option1.on = true;  // both can be on simultaneously
option2.on = true;

Fields
ToggleLightButtonPtr _toggleLightHandle
Methods
ToggleLightButtonPtr toggleLightHandle() @safe nothrow @nogcReturns the underlying toggle light button handle.
bool on() const nothrow @nogcGets or sets the on/off state of the button.
void on(bool state) nothrow @nogcditto
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogcditto
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new toggle light button widget.
Destructors

Toggle round button widget.

ToggleRoundButton widgets are round buttons that maintain on/off state. Unlike radio buttons, multiple toggle round buttons can be on at the same time.

Example:

auto option1 = new ToggleRoundButton(10, 10, 100, 25, "Option 1");
auto option2 = new ToggleRoundButton(10, 40, 100, 25, "Option 2");
option1.on = true;  // both can be on simultaneously
option2.on = true;

Fields
ToggleRoundButtonPtr _toggleRoundHandle
Methods
ToggleRoundButtonPtr toggleRoundHandle() @safe nothrow @nogcReturns the underlying toggle round button handle.
bool on() const nothrow @nogcGets or sets the on/off state of the button.
void on(bool state) nothrow @nogcditto
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogcditto
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new toggle round button widget.
Destructors

Repeat button widget.

RepeatButton widgets auto-repeat their callback when held down.

Example:

auto repeat = new RepeatButton(10, 10, 100, 25, "Hold Me");
repeat.onClick = { count++; };  // called repeatedly while held

Fields
RepeatButtonPtr _repeatHandle
Methods
RepeatButtonPtr repeatHandle() @safe nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Return button widget (default button).

ReturnButton widgets respond to the Enter key as the default button. They display a special visual indicator (typically a border).

Example:

auto ok = new ReturnButton(10, 10, 100, 25, "OK");
ok.onClick = { window.hide(); };  // activated by Enter key

Fields
ReturnButtonPtr _returnHandle
Methods
ReturnButtonPtr returnHandle() @safe nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Round button widget.

RoundButton widgets have a round radio-style appearance. They can be used as radio buttons with visual round indicators.

Example:

auto round = new RoundButton(10, 10, 100, 25, "Option");
round.on = true;  // selects the button

Fields
RoundButtonPtr _roundHandle
Methods
RoundButtonPtr roundHandle() @safe nothrow @nogc
bool on() const nothrow @nogc
void on(bool state) nothrow @nogc
bool value() const nothrow @nogcAlias for on property
void value(bool state) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Float input widget.

FloatInput widgets accept only floating-point numbers.

Example:

auto floatIn = new FloatInput(10, 10, 100, 25, "Value:");
floatIn.value = "3.14";

Fields
FloatInputPtr _floatInputHandle
Methods
FloatInputPtr floatInputHandle() @safe nothrow @nogc
string value() const
void value(string text)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Integer input widget.

IntInput widgets accept only integer numbers.

Example:

auto intIn = new IntInput(10, 10, 100, 25, "Count:");
intIn.value = "42";

Fields
IntInputPtr _intInputHandle
Methods
IntInputPtr intInputHandle() @safe nothrow @nogc
string value() const
void value(string text)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Secret input widget (password field).

SecretInput widgets display dots/asterisks instead of actual characters, suitable for password entry.

Example:

auto password = new SecretInput(10, 10, 200, 25, "Password:");
password.value = "secret123";

Fields
SecretInputPtr _secretInputHandle
Methods
SecretInputPtr secretInputHandle() @safe nothrow @nogc
string value() const
void value(string text)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Multiline input widget.

MultilineInput widgets accept multiple lines of text.

Example:

auto multi = new MultilineInput(10, 10, 200, 100, "Notes:");
multi.value = "Line 1\nLine 2\nLine 3";

Fields
MultilineInputPtr _multilineInputHandle
Methods
string value() const
void value(string text)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

File input widget.

FileInput widgets provide file path input with navigation support.

Example:

auto fileIn = new FileInput(10, 10, 300, 25, "File:");
fileIn.value = "/home/user/document.txt";

Fields
FileInputPtr _fileInputHandle
Methods
FileInputPtr fileInputHandle() @safe nothrow @nogc
string value() const
void value(string text)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Multiline output widget (read-only).

MultilineOutput widgets display multiple lines of read-only text.

Example:

auto multiOut = new MultilineOutput(10, 10, 200, 100, "Log:");
multiOut.value = "Line 1\nLine 2\nLine 3";

Fields
MultilineOutputPtr _multilineOutputHandle
Methods
string value() const
void value(string text)
string text() constAlias for value property
void text(string content)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Dial type constants.

These values define the visual style of dial widgets.

NORMAL = 0Normal dial with a dot indicator
LINE = 1Dial with a line indicator
FILL = 2Dial with a filled arc indicator
classDial : Valuator

Dial widget for selecting numeric values.

Dial widgets provide a circular dial interface for selecting values. The dial can be styled as normal (dot), line, or filled arc.

Dial inherits from Valuator and provides all valuator functionality including value, minimum, maximum, step, clamp, round, etc.

Example:

auto dial = new Dial(10, 10, 100, 100, "Volume:");
dial.range(0, 100);
dial.value = 50;
dial.dialType = DialType.FILL;

Fields
DialPtr _dialHandle
Methods
DialPtr dialHandle() @safe nothrow @nogcReturns the underlying dial handle.
DialType dialType() const nothrow @nogcGets the dial type.
void dialType(DialType type) nothrow @nogcSets the dial type.
short angle1() const nothrow @nogcGets the first angle (start angle for the dial arc).
void angle1(short angle) nothrow @nogcSets the first angle.
short angle2() const nothrow @nogcGets the second angle (end angle for the dial arc).
void angle2(short angle) nothrow @nogcSets the second angle.
void angles(short a1, short a2) nothrow @nogcSets both angles at once.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new dial widget.
Destructors
classFillDial : Dial

Dial widget with a filled arc indicator.

FillDial is a convenience class that creates a Dial with the FILL type preset. The dial draws a filled arc from the minimum position to the current value.

Example:

auto dial = new FillDial(10, 10, 100, 100, "Level:");
dial.range(0, 100);
dial.value = 75;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new filled dial widget.
classLineDial : Dial

Dial widget with a line indicator.

LineDial is a convenience class that creates a Dial with the LINE type preset. The dial draws a line from the center to indicate the current value.

Example:

auto dial = new LineDial(10, 10, 100, 100, "Position:");
dial.range(0, 360);
dial.value = 180;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new line dial widget.

Counter type constants.

These values define the visual style of counter widgets.

NORMAL = 0Counter with 4 arrow buttons (fast increment/decrement)
SIMPLE = 1Counter with only 2 arrow buttons (simple)

Counter widget with increment/decrement buttons.

Counter widgets provide +/- buttons for adjusting numeric values. The NORMAL type has 4 buttons (including fast increment), while the SIMPLE type has only 2 buttons.

Example:

auto counter = new Counter(10, 10, 150, 25, "Count:");
counter.value = 10;
counter.step = 1;

Fields
CounterPtr _counterHandle
Methods
CounterPtr counterHandle() @safe nothrow @nogc
double value() const nothrow @nogc
void value(double v) nothrow @nogc
double minimum() const nothrow @nogc
void minimum(double v) nothrow @nogc
double maximum() const nothrow @nogc
void maximum(double v) nothrow @nogc
void step(double s) nothrow @nogc
CounterType counterType() const nothrow @nogcGets the counter type.
void counterType(CounterType type) nothrow @nogcSets the counter type.
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Simple counter widget with only 2 buttons.

SimpleCounter is a convenience class that creates a Counter with the SIMPLE type preset. Unlike the normal counter, it has only two buttons (+/-) without the fast increment buttons.

Example:

auto counter = new SimpleCounter(10, 10, 150, 25, "Count:");
counter.value = 10;
counter.step = 1;

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new simple counter widget.

2D positioner widget for selecting X/Y coordinates.

Positioner provides a 2D input interface where the user can click and drag to select X and Y coordinate values simultaneously. The crosshairs indicate the current position.

Example:

auto pos = new Positioner(10, 10, 100, 100, "Position:");
pos.xbounds(0, 100);
pos.ybounds(0, 100);
pos.xvalue = 50;
pos.yvalue = 50;

Fields
PositionerPtr _posHandle
Methods
PositionerPtr positionerHandle() @safe nothrow @nogcReturns the underlying positioner handle.
double xvalue() const nothrow @nogcGets the X axis value.
bool xvalue(double val) nothrow @nogcSets the X axis value.
double yvalue() const nothrow @nogcGets the Y axis value.
bool yvalue(double val) nothrow @nogcSets the Y axis value.
bool value(double x, double y) nothrow @nogcSets both X and Y values at once.
double xminimum() const nothrow @nogcGets the X axis minimum.
void xminimum(double val) nothrow @nogcSets the X axis minimum.
double xmaximum() const nothrow @nogcGets the X axis maximum.
void xmaximum(double val) nothrow @nogcSets the X axis maximum.
void xbounds(double min, double max) nothrow @nogcSets both X axis bounds.
double yminimum() const nothrow @nogcGets the Y axis minimum.
void yminimum(double val) nothrow @nogcSets the Y axis minimum.
double ymaximum() const nothrow @nogcGets the Y axis maximum.
void ymaximum(double val) nothrow @nogcSets the Y axis maximum.
void ybounds(double min, double max) nothrow @nogcSets both Y axis bounds.
void xstep(double val) nothrow @nogcSets the X axis step value.
void ystep(double val) nothrow @nogcSets the Y axis step value.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new positioner widget.
Destructors
classRoller : Widget

Roller widget for selecting numeric values.

Roller widgets provide a rolling drum-style interface.

Example:

auto roller = new Roller(10, 10, 25, 100, "Value:");
roller.value = 50;

Fields
RollerPtr _rollerHandle
Methods
RollerPtr rollerHandle() @safe nothrow @nogc
double value() const nothrow @nogc
void value(double v) nothrow @nogc
double minimum() const nothrow @nogc
void minimum(double v) nothrow @nogc
double maximum() const nothrow @nogc
void maximum(double v) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Scrollbar widget.

Scrollbar widgets for scrolling content.

Example:

auto scrollbar = new Scrollbar(10, 10, 20, 200);
scrollbar.value = 0;

Fields
ScrollbarPtr _scrollbarHandle
Methods
ScrollbarPtr scrollbarHandle() @safe nothrow @nogc
double value() const nothrow @nogc
void value(double v) nothrow @nogc
double minimum() const nothrow @nogc
void minimum(double v) nothrow @nogc
double maximum() const nothrow @nogc
void maximum(double v) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Value input widget for numeric values.

ValueInput widgets provide a text field for entering numeric values.

Example:

auto input = new ValueInput(10, 10, 100, 25, "Value:");
input.value = 42.5;

Fields
ValueInputPtr _valueInputHandle
Methods
ValueInputPtr valueInputHandle() @safe nothrow @nogc
double value() const nothrow @nogc
void value(double v) nothrow @nogc
double minimum() const nothrow @nogc
void minimum(double v) nothrow @nogc
double maximum() const nothrow @nogc
void maximum(double v) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Value output widget for displaying numeric values.

ValueOutput widgets display read-only numeric values.

Example:

auto output = new ValueOutput(10, 10, 100, 25, "Result:");
output.value = 123.45;

Fields
ValueOutputPtr _valueOutputHandle
Methods
ValueOutputPtr valueOutputHandle() @safe nothrow @nogc
double value() const nothrow @nogc
void value(double v) nothrow @nogc
double minimum() const nothrow @nogc
void minimum(double v) nothrow @nogc
double maximum() const nothrow @nogc
void maximum(double v) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Adjuster widget with arrow buttons.

Adjuster widgets provide arrows for incrementing/decrementing values.

Example:

auto adjuster = new Adjuster(10, 10, 75, 25, "Adjust:");
adjuster.value = 0.5;

Fields
AdjusterPtr _adjusterHandle
Methods
AdjusterPtr adjusterHandle() @safe nothrow @nogc
double value() const nothrow @nogc
void value(double v) nothrow @nogc
double minimum() const nothrow @nogc
void minimum(double v) nothrow @nogc
double maximum() const nothrow @nogc
void maximum(double v) nothrow @nogc
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors
classOutput : Widget

Read-only text output widget.

Output widgets display text that cannot be edited by the user.

Example:

auto output = new Output(10, 10, 200, 25, "Status:");
output.value = "Ready";

Fields
OutputPtr _outputHandle
Methods
OutputPtr outputHandle() @safe nothrow @nogc
string value() const
void value(string text)
string text() constAlias for value property
void text(string content)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Progress bar widget.

Progress widgets display a progress bar showing completion percentage.

Example:

auto progress = new Progress(10, 10, 200, 25, "Loading:");
progress.minimum = 0;
progress.maximum = 100;
progress.value = 50;

Fields
ProgressPtr _progressHandle
Methods
ProgressPtr progressHandle() @safe nothrow @nogc
double value() const
void value(double val)
void minimum(double min)
void maximum(double max)
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors
enumChartType : ubyte

Chart type enumeration.

Defines the visual style of a Chart widget.

BAR = 0Vertical bar chart
HORBAR = 1Horizontal bar chart
LINE = 2Line chart with vertices at sample values
FILL = 3Filled chart from bottom to sample values
SPIKE = 4Spike chart with vertical lines
PIE = 5Pie chart with proportional slices
SPECIALPIE = 6Pie chart with first slice separated
classChart : Widget

Chart widget for displaying simple charts.

Chart widgets display data as bar charts, line charts, pie charts, etc. Data values can be added, inserted, replaced, and cleared dynamically.

Example:

auto chart = new Chart(10, 10, 300, 200, "Sales");
chart.chartType = ChartType.BAR;
chart.add(10.0, "Q1");
chart.add(25.0, "Q2");
chart.add(15.0, "Q3");
chart.add(30.0, "Q4");

Fields
ChartPtr _chartHandle
Methods
ChartPtr chartHandle() @safe nothrow @nogcReturns the underlying chart handle.
void clear()Clears all data from the chart.
void add(double val, string label = null, uint col = 0)Adds a data value to the chart.
void insert(int index, double val, string label = null, uint col = 0)Inserts a data value at a specific index.
void replace(int index, double val, string label = null, uint col = 0)Replaces a data value at a specific index.
void bounds(out double lower, out double upper) constGets the chart bounds.
void setBounds(double lower, double upper)Sets the chart bounds.
int dataSize() const nothrow @nogcGets the number of data values in the chart.
int maxsize() const nothrow @nogcGets the maximum number of data values for the chart.
void maxsize(int m)Sets the maximum number of data values for the chart.
int textfont() const nothrow @nogcGets the chart's text font.
void textfont(int f)Sets the chart's text font.
int textsize() const nothrow @nogcGets the chart's text size.
void textsize(int s)Sets the chart's text size.
uint textcolor() const nothrow @nogcGets the chart's text color.
void textcolor(uint c)Sets the chart's text color.
bool autosize() const nothrow @nogcGets whether the chart auto-sizes its bounds.
void autosize(bool enabled)Sets whether the chart auto-sizes its bounds.
ChartType chartType() const nothrow @nogcGets the chart type.
void chartType(ChartType t)Sets the chart type.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new chart widget.
Destructors
enumClockType : ubyte

Clock type enumeration.

Defines the visual style of a Clock widget.

SQUARE = 0Square analog clock
ROUND = 1Round analog clock
classClock : Widget

Analog clock widget.

Clock widgets display an analog clock face with hour, minute, and second hands. The clock automatically updates every second to show the current time.

Example:

auto clock = new Clock(10, 10, 200, 200, "Time");
clock.clockType = ClockType.ROUND;

Fields
ClockPtr _clockHandle
Methods
ClockPtr clockHandle() @safe nothrow @nogcReturns the underlying clock handle.
ulong value() const nothrow @nogcGets the clock's value as Unix time.
void value(ulong v)Sets the clock's value as Unix time.
void setTime(int h, int m, int s)Sets the clock's value using hour, minute, second.
int hour() const nothrow @nogcGets the displayed hour.
int minute() const nothrow @nogcGets the displayed minute.
int second() const nothrow @nogcGets the displayed second.
ClockType clockType() const nothrow @nogcGets the clock type.
void clockType(ClockType t)Sets the clock type.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new clock widget.
this(ClockType type, int x, int y, int width, int height, string label = null)Creates a new clock widget with specified type.
Destructors

Round analog clock widget.

RoundClock is a convenience class that creates a Clock with ROUND type preset. It displays a circular analog clock face with hour, minute, and second hands.

Example:

auto clock = new RoundClock(10, 10, 200, 200, "Time");

Constructors
this(int x, int y, int width, int height, string label = null)Creates a new round clock widget.

Color chooser display mode.

Defines how color values are displayed in the ColorChooserWidget.

RGB = 0RGB sliders (0.0-1.0)
BYTE = 1Byte value sliders (0-255)
HEX = 2Hexadecimal input
HSV = 3HSV sliders

Embeddable color chooser widget.

ColorChooserWidget provides a standard RGB color chooser that can be embedded in any window or group. It includes a hue/saturation box, a value slider, and input fields for precise color entry.

The widget supports multiple display modes (RGB, byte, hex, HSV) and provides both RGB and HSV color access methods.

Example:

auto colorChooser = new ColorChooserWidget(10, 10, 300, 200);
colorChooser.rgb(1.0, 0.0, 0.0);  // Set to red
// Later, get the selected color
double r = colorChooser.r;
double g = colorChooser.g;
double b = colorChooser.b;

Fields
ColorChooserPtr _colorChooserHandle
Methods
ColorChooserPtr colorChooserHandle() @safe nothrow @nogcReturns the underlying color chooser handle.
ColorChooserMode mode() const nothrow @nogcGets the color chooser display mode.
void mode(ColorChooserMode m)Sets the color chooser display mode.
double hue() const nothrow @nogcGets the current hue value.
double saturation() const nothrow @nogcGets the current saturation value.
double value() const nothrow @nogcGets the current value/brightness.
double r() const nothrow @nogcGets the current red component.
double g() const nothrow @nogcGets the current green component.
double b() const nothrow @nogcGets the current blue component.
bool hsv(double h, double s, double v)Sets the color using HSV values.
bool rgb(double red, double green, double blue)Sets the color using RGB values.
double[3] hsv2rgb(double h, double s, double v)Converts HSV color values to RGB.
double[3] rgb2hsv(double r, double g, double b)Converts RGB color values to HSV.
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new color chooser widget.
Destructors
~thisDestroys the color chooser and releases resources.