MinWin API Reference

minwin

app
button
canvas
combo
component
dialog
event
font
geometry
group
icon
image
label
layout
listbox
menu
multidg
paint
peer
peerimpl
scroll
text
window

minwin.layout

Defines a LayoutManager interface and some layout managers.

interface LayoutManager;
Interface for positioning out children in a component.

abstract void layout(Component c);
Position children of c. Can reuse cached information from previous preferredSize() or layout() calls.

abstract Point preferredSize(Component c);
Compute preferred layout size. Does not reuse cached information.

abstract void reset();
Clear cache if present.

enum Dir;
Enumeration of possible layout directions.

Horizontal
Flow left to right, then right to left.

Vertical
Flow top to bottom, then bottom to top.

class FlowLayout: minwin.layout.LayoutManager;
A layout manager that positiions children in a row vertically or horizontally.

The "flow" refers to the direction along which the children are being positioned and "side" refers to the orthogonal direction.

Dir dir;
Read/write property for the orientation and direction of the flow.

int flowGap;
Read/write property for the gap in pixels between children.

int sideGap;
Read/write property for the gap in pixels around the sides of the children.

bool sideStretch;
If true stretch the children sides to be the same size.

int flowReverse;
Read/write property for the number of items to position before flipping to the other side of the component and reversing direction.

double endGap;
Gap at the ends of the layout. If the value is greater than one it is in absolute pixels. If the value is less than one it is the percentage of extra space between the actual size and the preferred size.

this(Dir dir = cast(Dir)1);
Construct a FlowLayout in the requested direction.

void layout(Component c);
Position children in a row in the specified direction possibly flipping sides to position from the other side of the component.

Point preferredSize(Component c);
Compute preferred layout size and caches result.

void reset();
Clear the preferred size cache.

class TableLayout: minwin.layout.LayoutManager;
A layout manager that positiions children in a grid.

double[] colScales;
Read/write property for the spacing of the columns.

double[] rowScales;
Read/write property for the spacing of the rows.

this(double[] colScales, double[] rowScales, int gap = 0);
Construct a TableLayout with extra width distributed among the columns according to colScales and the extra height among the rows according to rowScales. The scale values must be between 0 and 1 and must total 1. The gap is the space in pixels to leave between children.

void layout(Component c);
Position children in the grid starting from the upper left and moving initially along the first row.

Point preferredSize(Component c);
Compute preferred layout size and caches result.

void reset();
Clear the cache of preferred size.

enum Loc;
Enumeration for the location of a child in a BorderLayout.

North


South


East


West


Center


class BorderLayout: minwin.layout.LayoutManager;
A layout manager that positiions children like Java's BorderLayout

North
WestCenterEast
South


Component[Loc] location;
Read/write property of the locations of children to position.

void layout(Component c);
Position children according to their locations. If a child is not in the location array it is not positioned.

Point preferredSize(Component c);
Compute preferred layout size.

void reset();
Clear the cache if any.