Skip to content
ModernUI A DaneTrades developer library

Layout

Layout classes arrange controls and own child elements. They usually do not emit app-level events.

Controls And Helpers

Control/helper Use it for Emits events
MuiElement Base class for all visible/interactive objects. None by itself
MuiContainer Base child-owning container. None by default
MuiPage Simple titled page container. None by default
MuiWindow Movable chart-hosted window. None by default
MuiSubWindow Secondary window. None by default
MuiPanel Simple panel container. None by default
MuiScrollView Scrollable content area. Internal wheel handling
MuiGrid Grid layout. None by default
MuiWrapRow Wrapping horizontal row. None by default
MuiSplitter Resizable split pane. None by default
MuiSpacer Empty layout spacer. None by default
MuiDivider Divider/spacing element. None by default
MuiAlignPanel Align one child inside a box. None by default
MuiAbsolutePanel Absolute-positioned container. None by default
MuiFormRow Label/control form row. None by default

Common Layout Concepts

Concept Meaning
Child ownership Containers own the controls attached to them.
FullWidth(true) Allows an element to stretch across available width.
Flex(...) Lets an element consume flexible space in supported layouts.
Fixed size SetFixedSize(...) sets predictable layout size.
Scroll views Use for content that exceeds the visible area.
Mui::Row / Mui::Column Factory helpers set layout.direction on a MuiContainer.

Layout classes do not emit app-level events (wheel/scroll handling stays internal). Child ownership follows Ownership and lifetime: parent.Add(child) transfers ownership to the parent.


MuiContainer

Purpose

Base child-owning layout node. Stacks children horizontally or vertically, supports margins, flex growth, and fixed sizes.

Source: Core/Container.mqh (extends MuiElement).

Create It

UI build fragment
MuiContainer *col=Mui::Column(parent,10.0);
MuiContainer *row=Mui::Row(parent,8.0);
MuiContainer *box=new MuiContainer();
parent.Add(box);
box.layout.direction=MUI_STACK_VERTICAL;
box.layout.spacing=12.0;

Events

None by default.

Common API

API Purpose
Add(child) Attach and own a child element.
Clear() Remove and destroy all children.
layout.direction, layout.spacing Stack axis and gap (MUI_STACK_HORIZONTAL / MUI_STACK_VERTICAL).
FullWidth(true) Stretch to parent width in supported parents.
Flex(weight) Share remaining space along the stack main axis.
SetFixedSize(w, h) Fixed layout size when needed.
Margin(top, right, bottom, left) Outer inset in logical units.

Notes

  • Prefer Mui::Row / Mui::Column over manual direction setup for readability.

Related


MuiPage

Purpose

Simple titled page shell (title + subtitle) used for multi-page apps.

Source: Core/UI.mqh. Factory: Mui::Page(title, subtitle).

Create It

UI build fragment
MuiPage *page=Mui::Page("Settings","Account preferences");
parent.Add(page);

Events

None by default.

Common Setters

Title/subtitle set via constructor or page APIs in source; add body content with page.Add(...).

Related


MuiWindow

Purpose

Movable, resizable chart-hosted window with title bar, optional header strip, optional overflow scroll body, and owned content stack.

Source: Layout/Window.mqh. Factory: Mui::Window(parent, title, x, y, w, h).

Create It

UI build fragment
MuiWindow *win=Mui::Window(parent,"Dashboard",40,40,720,480);
MuiContainer *body=win.Content();
Mui::Label(body,"Overview");
Mui::PinHeaderToWindowTop(win,hdr,48.0);
win.OverflowScroll(true);

Events

None by default. Window chrome (close/minimize) is internal unless you wire custom handlers on child controls.

Common Setters

Setter Purpose
Content() Body MuiContainer (vertical stack, spacing 10 by default).
Add(child) Shortcut for Content()->Add(...).
SetRect(x, y, w, h) Position and size in logical units.
OverflowScroll(true) Scroll body when content exceeds inner height.
BodyScrollY / BodyScrollY(y) Read/set inner scroll offset.
Header(el) Optional strip below title bar (ownership transfers).
HeaderHeight, Title, LeftIcon, Minimized, Closed Chrome state.

Notes

  • Mui::PinStatusBarToWindowBottom docks a MuiStatusBar outside the scroll body.

Related


MuiSubWindow

Purpose

Secondary floating window (lighter than main MuiWindow) for dialogs or tool panels.

Source: Layout/SubWindow.mqh. Factory: Mui::SubWindow(title, x, y, w, h).

Create It

UI build fragment
MuiSubWindow *dlg=Mui::SubWindow("Details",120,120,520,320);
dlg.Add(Mui::Label(dlg,"Content"));

Events

None by default.

Common Setters

Setter Purpose
SetRect, Title, Add Same general pattern as MuiWindow (see source).

Related


MuiPanel

Purpose

Simple panel container with theme padding/radius — used for grouped sections and Mui::Section blocks.

Source: Layout/Panel.mqh. Factory: Mui::Panel(parent, w, h), Mui::Section(...).

Create It

UI build fragment
MuiPanel *panel=Mui::Panel(parent,0,0);
panel.Add(Mui::Label(panel,"Group title"));

Events

None by default.

Common Setters

Setter Purpose
Add(child) Section content (owned).
SetFixedSize, FullWidth Layout sizing.

Related


MuiScrollView

Purpose

Viewport that clips and scrolls child content vertically (and horizontally when enabled), with optional scrollbar.

Source: Layout/ScrollView.mqh. Factory: Mui::Scroll(parent, w, h).

Create It

UI build fragment
MuiScrollView *sv=Mui::Scroll(parent,0,400);
sv.Add(Mui::Column(sv,8.0));

Events

None on the app bus. Wheel and scrollbar interaction are internal.

Common Setters

Setter Purpose
ScrollableY(true/false) Enable vertical scrolling.
ShowScrollbar, ScrollTo(y), ScrollY() Scrollbar visibility and position.
Add(child) Scrollable content (owned).

Notes

  • MuiWindow::OverflowScroll(true) wraps the window body in an internal scroll view.

Related


MuiGrid

Purpose

Dashboard tile grid: fixed equal-width columns, children placed left-to-right then wrap to next row.

Source: Layout/Grid.mqh.

Create It

UI build fragment
MuiGrid *grid=new MuiGrid();
grid.Columns(3);
grid.Gutter(12.0);
parent.Add(grid);
grid.Add(Mui::StatCard(grid,...));

Events

None by default.

Common Setters

Setter Purpose
Columns(1..12) Column count.
Gutter(logical) Horizontal and vertical gap between cells.

Notes

  • Use for stat cards and tiles, not data tables (MuiTableView) or label/input forms.

Related


MuiWrapRow

Purpose

Flow layout: children wrap to new lines when the row runs out of width (chips, badge rows, compact toolbars).

Source: Layout/WrapRow.mqh. Factory: Mui::WrapRow(parent, spacing, lineSpacing).

Create It

UI build fragment
MuiWrapRow *chips=Mui::WrapRow(parent,8.0,8.0);
chips.Add(Mui::Badge(chips,"A",MUI_BADGE_NEUTRAL));

Events

None by default.

Common Setters

Setter Purpose
layout.spacing Horizontal gap between items (set by factory).
lineSpacing Vertical gap between wrapped lines.

Related


MuiSplitter

Purpose

Two-pane resizable split (vertical or horizontal) with draggable divider bar.

Source: Layout/Splitter.mqh. Factory: Mui::Splitter(parent, paneA, paneB, dir, ratio, w, h).

Create It

UI build fragment
MuiSplitter *sp=Mui::Splitter(parent,leftPane,rightPane,MUI_SPLIT_VERTICAL,0.5,0,240);

Events

None by default.

Common Setters

Setter Purpose
SetPanes(a, b) Replace pane elements (owned by splitter).
Direction(MUI_SPLIT_VERTICAL | MUI_SPLIT_HORIZONTAL) Split orientation.
Ratio(0..1) Initial divider position.
BarSize(logical) Divider thickness (minimum 4).

Related


MuiSpacer

Purpose

Empty flexible or fixed gap in stacks.

Source: Layout/Spacer.mqh. Factory: Mui::Spacer(parent, w, h).

Create It

UI build fragment
Mui::Spacer(row,0.0,12.0);

Events

None by default.

Notes

  • Fixed-size gap only. For flexible push-apart space, use a container child with Flex(1.0) (see source comment in Spacer.mqh).

Related


MuiDivider

Purpose

Visual separator line or spacing band between sections.

Source: Layout/Divider.mqh. Factory: Mui::Divider(parent, height).

Create It

UI build fragment
Mui::Divider(col,12.0);

Events

None by default.

Related


MuiAlignPanel

Purpose

Single-child box that aligns one element inside available space (centre, end, etc.).

Source: Layout/AlignPanel.mqh. Factory: Mui::AlignBox(parent, ah, av, w, h).

Create It

UI build fragment
MuiAlignPanel *box=Mui::AlignBox(parent,MUI_ALIGN_CENTER,MUI_ALIGN_MIDDLE,120,32);
box.Add(Mui::Icon(box,MUI_ICON_SETTINGS,20));

Events

None by default.

Notes

  • Holds one primary child; Add replaces or attaches per source behaviour.

Related


MuiAbsolutePanel

Purpose

Absolute-positioned canvas: children use Margin(top, right, bottom, left) as x/y offsets from the panel origin.

Source: Layout/AbsolutePanel.mqh. Factory: Mui::AbsoluteCanvas(parent, w, h).

Create It

UI build fragment
MuiAbsolutePanel *canvas=Mui::AbsoluteCanvas(parent,400,300);
MuiElement *el=Mui::Label(canvas,"Pinned");
el.Margin(24,0,0,16);

Events

None by default.

Notes

  • Use for pixel-precise overlays; prefer stacks (Row/Column) for responsive forms.

Related


MuiFormRow

Purpose

Label + control row for settings forms (fixed label column width).

Source: Layout/FormRow.mqh. Factory: Mui::FormRow(parent, labelText, labelW).

Create It

UI build fragment
MuiFormRow *fr=Mui::FormRow(parent,"Risk %",140.0);
fr.AddControl(Mui::SpinEditHost(parent,...));

Events

None by default.

Common Setters

Setter Purpose
LabelText, LabelWidth Left column label.
AddControl(el) Right-side input (owned by row).
SizePt / FontSize Label typography.

Related


Related Pages