Canvas Toolkit
← Class index

CFlowLayout

Layouts · extends CLayout

Left-to-right flow layout with wrapping and width-dependent height. Preferred widths are retained; an oversized item shrinks only to its policy minimum. Empty stretch items are ignored. Rows never distribute spare width to their items.

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

Declared members

horizontalSpacing(): number;
verticalSpacing(): number;
rowAlignment(): CAlignment;
setSpacing(spacing: number): void;

Sets both axes, replacing any independent spacing overrides.

setHorizontalSpacing(spacing: number): void;
setVerticalSpacing(spacing: number): void;
setRowAlignment(alignment: CAlignment): void;
hasHeightForWidth(): boolean;
sizeHint(): CSize;

Preferred unwrapped size, including contents margins.

heightForWidth(width: number): number;
rowCount(width?: number): number;

Number of nonempty rows at the given outer width.

update(): void;