fltk.layout

FLTK Layout Widgets

This module provides layout container widgets:

  • Pack: Automatic widget arrangement (horizontal or vertical)
  • Tabs: Tabbed container with multiple pages
  • Scroll: Scrollable container for content larger than view
  • Tile: Resizable tile container (drag borders to resize)
  • Wizard: Step-by-step wizard with prev/next navigation
  • Spinner: Numeric input with increment/decrement buttons

    Authors

    Dejan Lekić

    License

    BSD-3-Clause

Types 6

classPack : Group

Pack layout widget for automatic widget arrangement.

Pack arranges its children automatically in a horizontal or vertical line, with optional spacing between widgets.

Example:

auto pack = new Pack(10, 10, 300, 200);
pack.setVertical();
pack.spacing = 5;
pack.begin();
auto btn1 = new Button(0, 0, 100, 25, "Button 1");
auto btn2 = new Button(0, 0, 100, 25, "Button 2");
pack.end();

Fields
PackPtr _packHandle
Methods
PackPtr packHandle() @safe nothrow @nogc
void spacing(int pixels)Sets the spacing between children.
void setHorizontal()Sets the pack to horizontal layout.
void setVertical()Sets the pack to vertical layout.
void begin()
void end()
Constructors
this(int x, int y, int width, int height, string label = null)Creates a new pack widget.
Destructors
classTabs : Group

Tabs container widget with multiple pages.

Tabs displays a tabbed interface where each child widget represents a page. The child's label becomes the tab label.

Example:

auto tabs = new Tabs(10, 10, 300, 200);
tabs.begin();
auto page1 = new Group(15, 35, 290, 165, "Page 1");
page1.end();
auto page2 = new Group(15, 35, 290, 165, "Page 2");
page2.end();
tabs.end();

Fields
TabsPtr _tabsHandle
Methods
TabsPtr tabsHandle() @safe nothrow @nogc
WidgetPtr selectedTab()Gets the currently selected tab.
void selectedTab(Widget tab)Sets the currently selected tab.
void begin()
void end()
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors
classScroll : Group

Scrollable container widget.

Scroll provides a scrollable view for content that is larger than the visible area. Scrollbars appear automatically when needed.

Example:

auto scroll = new Scroll(10, 10, 200, 150);
scroll.begin();
auto bigBox = new Box(0, 0, 400, 400, "Large content");
scroll.end();
scroll.scrollTo(100, 100);

Fields
ScrollPtr _scrollHandle
Methods
ScrollPtr scrollHandle() @safe nothrow @nogc
void scrollTo(int x, int y)Scrolls to a specific position.
int xposition()Gets the current horizontal scroll position.
int yposition()Gets the current vertical scroll position.
void begin()
void end()
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors
classTile : Group

Tile container widget with resizable children.

Tile allows users to resize children by dragging the borders between them.

Example:

auto tile = new Tile(10, 10, 400, 300);
tile.begin();
auto left = new Box(0, 0, 200, 300, "Left");
auto right = new Box(200, 0, 200, 300, "Right");
tile.end();

Fields
TilePtr _tileHandle
Methods
TilePtr tileHandle() @safe nothrow @nogc
void end()
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors
classWizard : Group

Wizard container widget for step-by-step interfaces.

Wizard shows one child at a time, with next/prev navigation for creating step-by-step wizards or slideshows.

Example:

auto wizard = new Wizard(10, 10, 300, 200);
wizard.begin();
auto page1 = new Group(0, 0, 300, 200);
auto page2 = new Group(0, 0, 300, 200);
wizard.end();
wizard.next();  // show page2

Fields
WizardPtr _wizardHandle
Methods
WizardPtr wizardHandle() @safe nothrow @nogc
void next()Shows the next page.
void prev()Shows the previous page.
void end()
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors

Spinner widget with input field and increment/decrement buttons.

Spinner combines a numeric input field with buttons for incrementing and decrementing the value.

Example:

auto spinner = new Spinner(10, 10, 100, 25, "Value:");
spinner.minimum = 0;
spinner.maximum = 100;
spinner.value = 50;
spinner.step = 1;

Fields
SpinnerPtr _spinnerHandle
Methods
SpinnerPtr spinnerHandle() @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
Constructors
this(int x, int y, int width, int height, string label = null)
Destructors