|
coastline 0.0.4
|
Front-end panel widget with text, sprites, animations, and input callbacks. More...
#include <frontend.h>
Public Member Functions | |
| MenuWidget () | |
| Initialise inactive callbacks, default flags and position, and empty animation/link storage. | |
| virtual | ~MenuWidget () |
| Destroy embedded fonts and list storage without releasing borrowed screens or rectangles. | |
| virtual int | UpdateBlinkTimer () |
| Advance enabled image animation using elapsed milliseconds and mark widgets for redraw. | |
| virtual bool | Update () |
| Run a frame of the item. | |
| virtual int | BlitSurfaceById (int nImage, int x, int y) |
| Blit a menu sprite's stored source rectangle at the supplied destination. | |
| virtual void | SetText (const char *pszText, unsigned dwTextFlags, unsigned char bStyle, const RECT *pRect) |
| Copy text into font slot zero, measure it, and update widget bounds and text dimensions. | |
| virtual void | Initialize (MenuScreen *pOwner, float x, float y, unsigned dwItemFlags, unsigned dwSecondary, unsigned dwTertiary, int nMode, short nImage) |
| Assign the parent screen and position, combine flag groups, and set the first sprite. | |
| MenuScreen * | GetScreen () const |
| MenuFont & | GetFont (int index) |
| MenuItemList & | GetItemList () |
| unsigned | GetFlags () const |
| void | SetFlags (unsigned value) |
| Replace primary widget flags without updating layout. | |
| float | GetX () const |
| float | GetY () const |
| void | SetX (float value) |
| Store a horizontal position without updating bounds or font coordinates. | |
| void | SetY (float value) |
| Store a vertical position without updating bounds or font coordinates. | |
| void | SetSpriteId (short value) |
| Store the current sprite identifier without updating geometry. | |
| short | GetSpriteId () const |
| void | SetAnimationSpriteId (int index, short value) |
| Store a sprite identifier in one animation slot. | |
| void | SetImageMode (int value) |
| Store the image-animation mode without resetting timers. | |
| void | SetImageRects (const RECT *rects) |
| Replace the borrowed source-rectangle array used for custom animation frames. | |
| void | SetCustomFrameDurations (bool value) |
| Select custom frame timings and per-frame source rectangles without initialising either. | |
| void | SetFrameDuration (int index, int value) |
| Store a custom frame duration without changing animation progress. | |
| short | GetLinkedWidgetCount () const |
| short | GetLinkedWidgetIndex (int index) const |
| void | SetLinkedWidgetCount (short value) |
| Store link count without initialising the corresponding link indices. | |
| void | SetLinkedWidgetIndex (int index, short value) |
| Assign one linked widget index without changing link count. | |
| LONG | GetBoundsLeft () const |
| LONG | GetBoundsTop () const |
| void | SetBoundsLeft (LONG value) |
| Store the left bound without updating other layout fields. | |
| void | SetBoundsTop (LONG value) |
| Store the top bound without updating other layout fields. | |
| void | SetBoundsRight (LONG value) |
| Store the right bound without updating other layout fields. | |
| void | SetBoundsBottom (LONG value) |
| Store the bottom bound without updating other layout fields. | |
| void | SetUpdateCallback (int(*callback)(MenuWidget *)) |
| Install a widget-update callback without invoking it. | |
| auto | GetUpdateCallback () const |
| void | SetActionCallback (int(*callback)(MenuActionWidget *)) |
| Install an activation callback without invoking it. | |
| auto | GetActionCallback () const |
| void | SetIdleActionCallback (int(*callback)(MenuWidget *)) |
| Install an idle callback without invoking it. | |
| void | SetTextEditCompleteCallback (int(*callback)(MenuWidget *)) |
| Install a text-edit completion callback without invoking it. | |
| auto | GetTextEditCompleteCallback () const |
| void | SetBeforeUpdateCallback (int(*callback)(MenuWidget *)) |
| Install a callback run by the panel before the widget update. | |
| auto | GetBeforeUpdateCallback () const |
| void | SetAfterUpdateCallback (int(*callback)(MenuWidget *)) |
| Install a callback run by the panel after the widget update. | |
| auto | GetAfterUpdateCallback () const |
Front-end panel widget with text, sprites, animations, and input callbacks.
Direct setters do not validate values or rebuild related layout state. Referenced screens, rectangle arrays, and callbacks must remain valid while used by the widget.
| MenuWidget::MenuWidget | ( | ) |
Initialise inactive callbacks, default flags and position, and empty animation/link storage.
Image rectangles and text bounds require separate initialisation before their use.
|
virtual |
Destroy embedded fonts and list storage without releasing borrowed screens or rectangles.
|
virtual |
Advance enabled image animation using elapsed milliseconds and mark widgets for redraw.
Custom frame durations control frame advancement; other animations request redraw after more than 60 ms.
|
virtual |
Run a frame of the item.
|
virtual |
Blit a menu sprite's stored source rectangle at the supplied destination.
| nImage | A valid menu sprite and image identifier. |
| x | The horizontal destination in menu pixels. |
| y | The vertical destination in menu pixels. |
|
virtual |
Copy text into font slot zero, measure it, and update widget bounds and text dimensions.
| pszText | A non-null terminated label fitting MenuFont text storage, copied during the call. |
| dwTextFlags | Font flags combined with existing flags; bit zero centres measured text. |
| bStyle | The font style, with 3 selecting alternate-font measurement. |
| pRect | Non-null borrowed bounds supplying horizontal menu-pixel limits. |
|
virtual |
Assign the parent screen and position, combine flag groups, and set the first sprite.
| pOwner | The borrowed parent screen, valid while the widget uses screen operations. |
| x | The horizontal position in menu pixels. |
| y | The vertical position in menu pixels. |
| dwItemFlags | The primary flag bits combined with existing flags. |
| dwSecondary | The secondary flag bits combined with existing flags. |
| dwTertiary | The tertiary flag bits combined with existing flags. |
| nMode | The image-animation mode, with zero disabling timed image updates. |
| nImage | The initial sprite identifier, also assigned to animation slot zero. |
|
inline |
|
inline |
| index | The font slot index, 0..2. |
|
inline |
|
inline |
|
inline |
Replace primary widget flags without updating layout.
| value | The primary widget flag bits. |
|
inline |
|
inline |
|
inline |
Store a horizontal position without updating bounds or font coordinates.
| value | The horizontal position in menu pixels. |
|
inline |
Store a vertical position without updating bounds or font coordinates.
| value | The vertical position in menu pixels. |
|
inline |
Store the current sprite identifier without updating geometry.
| value | The sprite identifier required by the selected drawing mode. |
|
inline |
|
inline |
Store a sprite identifier in one animation slot.
| index | The animation slot index, 0..49. |
| value | The sprite identifier used when the frame is selected. |
|
inline |
Store the image-animation mode without resetting timers.
| value | The mode, with zero disabling timed image updates. |
|
inline |
Replace the borrowed source-rectangle array used for custom animation frames.
| rects | An array with a valid rectangle for every selected frame, valid while attached. |
|
inline |
Select custom frame timings and per-frame source rectangles without initialising either.
Positive frame durations must end with a zero or negative duration within the 50 slots.
| value | Whether valid frame durations, sprites, and source rectangles are configured. |
|
inline |
Store a custom frame duration without changing animation progress.
| index | The duration slot index, 0..49. |
| value | The duration in milliseconds; a zero or negative next duration wraps to frame zero. |
|
inline |
|
inline |
| index | The link slot index, 0..24. |
|
inline |
Store link count without initialising the corresponding link indices.
| value | The number of valid link slots, 0..25. |
|
inline |
Assign one linked widget index without changing link count.
| index | The link slot index, 0..24. |
| value | A valid widget index in the parent screen's current panel. |
|
inline |
|
inline |
|
inline |
Store the left bound without updating other layout fields.
| value | The left menu-pixel coordinate. |
|
inline |
Store the top bound without updating other layout fields.
| value | The top menu-pixel coordinate. |
|
inline |
Store the right bound without updating other layout fields.
| value | The right menu-pixel coordinate. |
|
inline |
Store the bottom bound without updating other layout fields.
| value | The bottom menu-pixel coordinate. |
|
inline |
Install a widget-update callback without invoking it.
| callback | The callback receiving this widget, or null. Return -2 to skip the remaining update while continuing, -1 to end the widget, or another value to continue normally. |
|
inline |
|
inline |
Install an activation callback without invoking it.
| callback | The callback receiving this widget, or null; zero ends the widget update. |
|
inline |
|
inline |
Install an idle callback without invoking it.
| callback | The callback receiving this widget, or null; the return value is discarded. |
|
inline |
Install a text-edit completion callback without invoking it.
| callback | The callback receiving this widget, or null; the return value is discarded. |
|
inline |
|
inline |
Install a callback run by the panel before the widget update.
| callback | The callback receiving this widget, or null; zero aborts panel processing. |
|
inline |
|
inline |
Install a callback run by the panel after the widget update.
| callback | The callback receiving this widget, or null; zero aborts panel processing. |
|
inline |