<--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../../aros.css' --->

Title.mui

MUIC_Title

Superclass

Group.mui

Description

Display a horizontal row of child objects as tab titles and select the
corresponding page in the parent Group. The public Title header defines
only the class name: there are no Title-specific public attributes or
methods. Child objects, their contents and their disposal follow Group
ownership rules.
For the tabbed-page arrangement implemented by AROS Group, use a parent
with MUIA_Frame set to MUIV_Frame_Register and MUIA_Group_PageMode TRUE.
Supply Title as its first child and the page objects afterward, in the
same order as the title children. Group treats the first child as the
persistent title group and excludes it from page numbering. Provide at
least one title and one corresponding page. Title does not create labels
or pages and does not validate their correspondence.
Construction installs a private layout hook, horizontal grouping and
ShowSelState FALSE before caller tags. Preserve the layout hook for this
arrangement. Location is fixed to the top in the constructor. Internal
left-side drawing/layout branches do not constitute a public orientation
API.

Methods

On a changed MUIA_Group_ActivePage tag, Title saves its old tab index,
stores the raw new value, requests an update redraw and sets the
parent's ActivePage before delegating to Group. A live parent is
required for that path. Title starts its own active-tab cache at zero;
it does not initialize that cache from constructor ActivePage tags and
has no getter for the cache. An inherited ActivePage query is not a
query of this private state.
Use valid zero-based indices matching title and page order. Set the
parent Group's ActivePage to use its First, Last, Prev, Next or Advance
interpretation; Title itself does not normalize sentinel values or check
ranges. Parent Group feeds a changed, resolved page back to Title. Do
not rely on an invalid index being rejected or on a raw sentinel sent to
Title leaving its cache coherent.
After successful superclass Setup, Title snapshots the parent background
and registers an IDCMP_MOUSEBUTTONS handler with GUI mode and priority
-7, so contained controls with higher priority can handle input first.
SELECTDOWN inside a title child's rectangle selects that child's index.
Padding outside child rectangles does not select a tab. The handler
returns zero even after selecting; there is no local keyboard-selection
handler.
Cleanup removes the event handler before delegating. Disposal frees the
owned layout hook before delegating child disposal. Follow the normal
Setup/Cleanup/disposal lifecycle; do not dispose during callbacks or
drawing.

Notes

Top layout divides available width among all children after horizontal
spacing, distributing remaining pixels to the earliest children. Each
child is inset four pixels horizontally and vertically. Minimum/default
width is child count times the largest child minimum width plus child
count times horizontal spacing. Height is fixed to the largest child
minimum height plus eight. Calculations use WORD intermediates and do
not ensure the width includes the eight-pixel child inset; provide
usable, nonoverflowing geometry.
Drawing delegates to Group, then draws active and previously active
frames for an update, or all frames for a full draw. Active children
receive the parent background captured at Setup; inactive children
receive MUII_BACKGROUND. These background sets suppress notification but
can request redraw. Later parent background changes are not
automatically recaptured.

Bugs

An empty title group is unsafe: top layout divides by the child count
and drawing dereferences the first child without checking for NULL. Do
not remove the last child while the group can be laid out or drawn.
If superclass construction fails after allocating the layout hook, the
constructor returns failure without freeing that hook.
The conditional builtin dispatcher spells the disposal call
Title_OM_DISPOSE, whereas the definition in this file is
Title__OM_DISPOSE. The external class method list declares OM_DISPOSE
separately. This source discrepancy is not corrected here, and neither
build configuration nor runtime behavior has been validated by this
documentation change.