|
coastline 0.0.4
|
Menu text with a 1024-byte internal buffer, glyph metrics, drawing style, and text-entry state. More...
#include <menufont.h>
Public Member Functions | |
| MenuFont () | |
| Initialise empty text, style one, zero dimensions and position, and an inactive caret. | |
| virtual | ~MenuFont () |
| Destroy embedded text and state without releasing external resources. | |
| virtual void | MeasureText () |
| Recalculate primary-font width and raise height to the tallest recognised glyph if needed. | |
| virtual void | MeasureTextAltFont () |
| Recalculate alternate-font width and raise height without resetting prior height. | |
| virtual void | DrawMenuItemText (float x, float y) |
| Draw primary-font text at supplied coordinates, with optional centring and caret rendering. | |
| virtual void | DrawText () |
| Draw primary-font text at the stored position, applying centring and an enabled caret. | |
| virtual signed char | HandleTextInput () |
| Process pending character and key input, including network-setup sound shortcuts. | |
| virtual long double | ComputeCenteredX () |
| Centre measured text between configured left and right bounds and store the horizontal position. | |
| virtual void | DrawTextAltFont () |
| Draw alternate-font text at the stored position, applying centring and an enabled caret. | |
| const char * | GetText () const |
| void | SetText (const char *text) |
| Copy terminated text without checking capacity or measuring the result. | |
| void | AppendText (const char *text) |
| Append terminated text without checking capacity or measuring the result. | |
| void | CopyTextPrefix (const char *text, size_t size) |
| Copy a text prefix with strncpy() semantics, including zero padding after a source terminator. | |
| void | SetNumber (int value) |
| Replace text with a terminated signed decimal integer without measuring the result. | |
| unsigned | GetFlags () const |
| unsigned | SetFlags (unsigned value) |
| Store text flags without measuring or drawing. | |
| unsigned char | SetStyle (unsigned char value) |
| Store a drawing style without changing font measurements. | |
| unsigned char | GetStyle () const |
| short | GetWidth () const |
| short | SetWidth (short value) |
| Store width without measuring text or updating bounds. | |
| short | GetHeight () const |
| short | SetHeight (short value) |
| Store height without measuring text or updating bounds. | |
| float | SetX (float value) |
| Store horizontal position without updating bounds. | |
| float | GetX () const |
| float | GetY () const |
| float | SetY (float value) |
| Store vertical position without updating bounds. | |
| float | SetZ (float value) |
| Store the legacy depth field without changing device state; text drawing does not read it. | |
| short | SetInputMaxWidth (short value) |
| Store the width threshold used before accepting an input character. | |
| int | GetDrawCaret () const |
| int | SetDrawCaret (int value) |
| Store caret state without resetting its shared blink timer. | |
| LONG | GetBoundsLeft () const |
| const RECT & | GetBounds () const |
| LONG | SetBoundsLeft (LONG value) |
| Store the left bound without updating position or dimensions. | |
| LONG | GetBoundsTop () const |
| LONG | SetBoundsTop (LONG value) |
| Store the top bound without updating position or dimensions. | |
| LONG | GetBoundsRight () const |
| LONG | SetBoundsRight (LONG value) |
| Store the right bound without updating position or dimensions. | |
| LONG | SetBoundsBottom (LONG value) |
| Store the bottom bound without updating position or dimensions. | |
| unsigned | GetItemData () const |
| unsigned | SetItemData (unsigned value) |
| Store application-specific item data without interpreting it. | |
Menu text with a 1024-byte internal buffer, glyph metrics, drawing style, and text-entry state.
Direct setters do not validate values or synchronise position, bounds, and measured dimensions. Callers must preserve string termination and configure bounds before alignment or bounds queries.
| MenuFont::MenuFont | ( | ) |
Initialise empty text, style one, zero dimensions and position, and an inactive caret.
Bounds and application item data require assignment before queries.
|
virtual |
Destroy embedded text and state without releasing external resources.
|
virtual |
Recalculate primary-font width and raise height to the tallest recognised glyph if needed.
Existing height is not reset; invalid character bytes end measurement.
|
virtual |
Recalculate alternate-font width and raise height without resetting prior height.
Native measurement subtracts four pixels per glyph; alternate drawing subtracts six.
|
virtual |
Draw primary-font text at supplied coordinates, with optional centring and caret rendering.
| x | The horizontal menu-pixel coordinate, replaced by centring when flag one is set. |
| y | The vertical menu-pixel coordinate. |
|
virtual |
Draw primary-font text at the stored position, applying centring and an enabled caret.
|
virtual |
Process pending character and key input, including network-setup sound shortcuts.
The text buffer must be terminated and have capacity for any accepted character.
|
virtual |
Centre measured text between configured left and right bounds and store the horizontal position.
|
virtual |
Draw alternate-font text at the stored position, applying centring and an enabled caret.
|
inline |
|
inline |
Copy terminated text without checking capacity or measuring the result.
| text | A non-null string of at most 1023 bytes, copied during the call. |
|
inline |
Append terminated text without checking capacity or measuring the result.
| text | A non-null string whose appended result, including its terminator, fits 1024 bytes. |
|
inline |
Copy a text prefix with strncpy() semantics, including zero padding after a source terminator.
A source at least size bytes long does not produce a terminator; callers must terminate it.
| text | A non-null source with readable bytes through its terminator or size bytes. |
| size | The destination byte count, at most 1024. |
|
inline |
Replace text with a terminated signed decimal integer without measuring the result.
| value | The integer to format. |
|
inline |
|
inline |
Store text flags without measuring or drawing.
| value | The flag bits, including bit zero for centring. |
|
inline |
Store a drawing style without changing font measurements.
| value | The atlas style, normally zero, one, two, three, or four. |
|
inline |
|
inline |
|
inline |
Store width without measuring text or updating bounds.
| value | The width in menu pixels. |
|
inline |
|
inline |
Store height without measuring text or updating bounds.
| value | The height in menu pixels; zero permits later measurement to shrink prior height. |
|
inline |
Store horizontal position without updating bounds.
| value | The horizontal menu-pixel coordinate. |
|
inline |
|
inline |
|
inline |
Store vertical position without updating bounds.
| value | The vertical menu-pixel coordinate. |
|
inline |
Store the legacy depth field without changing device state; text drawing does not read it.
| value | The floating-point depth value, stored without validation. |
|
inline |
Store the width threshold used before accepting an input character.
| value | The threshold in menu pixels; the next character can extend text past the threshold. |
|
inline |
|
inline |
Store caret state without resetting its shared blink timer.
| value | The marker, with nonzero enabling caret drawing. |
|
inline |
|
inline |
Store the left bound without updating position or dimensions.
| value | The left menu-pixel coordinate. |
|
inline |
Store the top bound without updating position or dimensions.
| value | The top menu-pixel coordinate. |
|
inline |
Store the right bound without updating position or dimensions.
| value | The right menu-pixel coordinate. |
Store the bottom bound without updating position or dimensions.
| value | The bottom menu-pixel coordinate. |
|
inline |
|
inline |
Store application-specific item data without interpreting it.
| value | The unsigned application value. |