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

Text.mui

MUIA_Text_Contents

Function

Set or retrieve the displayed text string.

Inputs

Initialize, set and get, STRPTR. Default empty string. Supply readable
NUL-terminated text; setting NULL is equivalent to setting an empty
string.

Notes

The object copies the string. Get returns the stored source text,
including escapes and marker characters, not a rendered-text buffer. Do
not free or modify the returned pointer; it expires on successful
replacement or disposal. Because replacement is copied first, the
current returned pointer can be supplied back to the setter.
Even identical text is copied and reparsed; no equality suppression
occurs. A successful change while set up remeasures the parsed text and
requests redraw without relayout. On copy failure the old value remains,
yet the original tag is forwarded and can trigger notifications. Do not
treat a notification as proof of successful replacement.
At construction, NULL Contents tags are ignored; a failed copy can be
replaced by the final empty-string fallback. Avoid repeated constructor
Contents tags because earlier copies are not freed. Newline bytes create
separate lines; text-engine escape sequences are interpreted.

MUIA_Text_HiChar

Function

Underline the first matching character during text parsing.

Inputs

Initialize only, char stored as TEXT. Default zero disables this mode.

Notes

The text engine compares ordinary bytes against the supplied character
converted with ToLower and ToUpper, underlining the first match and then
disabling further matches. It scans the concatenated PreParse and
Contents, across lines. No local setter or getter exists, and this
attribute does not assign a keyboard shortcut.
HiChar and HiCharIdx share one character field but use separate flags.
If both flags are enabled, HiChar mode wins while using the last stored
character value. Use one mode per object to avoid this interaction.

MUIA_Text_HiCharIdx

Function

Use a marker byte to underline the following byte.

Inputs

Initialize only, char stored as TEXT. Default zero disables this mode.
The value is a marker character, not a numeric position.

Notes

At the first matching ordinary marker byte, the parser removes the
marker from rendered text and underlines the next byte. Later markers
remain ordinary text because highlighting is then disabled. Get of
Contents still returns the original marker-containing string. There is
no local setter or getter and no keyboard binding.
The parser advances once more after consuming the underlined byte,
skipping inspection of the following byte. A marker at end of input or
immediately before the final character can therefore advance beyond the
terminator. Use a marker followed by the character to underline and at
least one further ordinary byte. Do not place escape or newline bytes at
that skipped position. This limitation is in the current text engine,
not a positional-index feature.
HiChar takes precedence when its flag is also enabled, but both
attributes share the same stored character field. Use only one
highlighting mode.

MUIA_Text_PreParse

Function

Set or retrieve text prepended to Contents before parsing.

Inputs

Initialize, set and get, STRPTR. Default empty string. NULL becomes an
empty string on set; construction also falls back to an empty string.

Notes

The string is copied and owned like Contents. Get returns a borrowed
pointer valid until successful replacement or disposal. It normally
supplies formatting escapes, but ordinary characters are rendered too.
No separator is inserted before Contents, and highlighting also scans
ordinary bytes in this prefix.
Each successful set destroys the old parsed text, copies the replacement
into stored state, reparses while set up and requests redraw without
relayout. Allocation failure retains the old value but does not suppress
the forwarded notification tag. Repeated constructor tags overwrite
earlier allocated pointers without freeing them. Supplying the current
getter pointer to the setter is safe because duplication precedes
release.

MUIA_Text_SetMax

Function

Choose whether maximum width follows measured text width.

Inputs

Initialize only, BOOL. Default FALSE. No local setter or getter.

Notes

TRUE retains the superclass maximum width plus measured text width.
FALSE replaces maximum width with MUI_MAXMAX, allowing horizontal
expansion. Minimum and default widths still follow their separate rules.
This controls size negotiation, not string length or allocation size.

MUIA_Text_SetMin

Function

Choose whether text width contributes to minimum width.

Inputs

Initialize only, BOOL. Default TRUE. No local setter or getter.

Notes

AskMinMax first adds measured text width to superclass minimum, default
and maximum widths. If SetMin is FALSE it then sets the entire minimum
width to zero, including the superclass contribution. Default width
still includes text width. Height constraints are unaffected. This
permits a narrower allocation; it does not enable line wrapping.

MUIA_Text_SetVMax

Function

Choose whether maximum height follows measured text height.

Inputs

Initialize only, BOOL. Default TRUE. No local setter or getter.

Notes

AskMinMax uses the greater of parsed text height and font YSize for
minimum and default height. TRUE adds that same height to the superclass
maximum. FALSE adds MUI_MAXMAX to the superclass maximum rather than
replacing it. Width constraints are unaffected. Drawing centers the
parsed text block vertically within the actual content rectangle.

MUIC_Text

Superclass

Area.mui

Description

Display copied text using the Zune text engine. Contents and PreParse
default to empty strings. SetMin and SetVMax default to TRUE; SetMax
defaults to FALSE. No editing, cursor or automatic line wrapping is
implemented by this class. Newline bytes separate text-engine lines.
Version and Revision both return 1.
The object owns separate copies of Contents and PreParse and frees them
on disposal. Setup creates and measures a parsed text object; Cleanup
destroys it and clears its pointer. Complete Cleanup before disposal
because Dispose frees the strings but does not destroy the parsed text.
Getters return borrowed pointers into object-owned storage.

Methods

Successful string setters duplicate the new string before freeing the
old one, rebuild parsed text while set up, and request full redraw. They
do not request parent relayout. Copy failure leaves the old string and
parsed text unchanged, but the original tag still reaches superclass
notification processing. The setter returns the superclass result and
does not report copy failure separately.
Setup returns FALSE on Area failure, otherwise TRUE even if text-engine
allocation fails. Bounds measurement tolerates NULL, but AskMinMax and
Draw dereference the parsed object without checking it. Constructor copy
failure may fall back to an empty string; construction fails only if
either final string remains NULL. Repeated constructor string tags can
leak earlier copies.
Draw calls Area, clips to the content rectangle and centers the parsed
block vertically. Horizontal alignment comes from the text engine. Pure
update requests return zero while the private update field is zero; this
class never sets it to a nonzero value in active code. Normal drawing
returns TRUE and resets that field. Show converts the superclass result
to BOOL; Hide returns it unchanged. Import and Export are local no-ops
returning zero without delegating to Area.

Notes

The public text macros map to escape-byte commands: MUIX_L, MUIX_C and
MUIX_R select left, center and right alignment; MUIX_N resets style;
MUIX_B, MUIX_I and MUIX_U add bold, italic and underline; MUIX_PT and
MUIX_PH select draw-info pen indices 2 and 8. PreParse is concatenated
directly before Contents, with no inserted separator. Alignment and
style state can continue across lines. Parsing is byte-oriented, not
Unicode character indexing.
HiChar and HiCharIdx only control underlining. They do not set
Area_ControlChar or register keyboard activation. Supply valid
text-engine escapes and keep any external objects or image data
referenced by pointer escapes alive; copying the string does not copy
those objects. Text bounds use WORD fields, so large strings or
dimensions are not an unlimited-size layout contract.