|
coastline 0.0.4
|
Menu list with 100 font and payload slots, optional scrolling, and selection callbacks. More...
#include <frontend.h>
Public Member Functions | |
| MenuItemList () | |
| Initialise an empty list with null callbacks, disabled scrolling, and no images. | |
| virtual | ~MenuItemList () |
| Destroy font storage without releasing attached payload allocations. | |
| virtual int | AddItem (const char *text, unsigned flags, unsigned char style, const RECT *bounds, bool full) |
| Append a text row, removing the oldest row first when all 100 slots are used. | |
| virtual int | Initialize (unsigned flags, const RECT *bounds, int visibleRows, int firstVisibleRow, int backgroundImage) |
| Copy list bounds and configure visible rows, background, and enabled scrollbar geometry. | |
| virtual int | UpdateAndRenderMenuWidget (int selection) |
| Draw the list and process input when text editing and modal dialogs do not block input. | |
| virtual int | UpdateItemAndNotify (int nIndex) |
| Measure a row, process active text editing, and notify its completion or cancellation. | |
| virtual int | SetItemData (const void *data, unsigned size, int index) |
| Copy bytes into slot payload storage, allocating only when the slot has no buffer. | |
| virtual int | RemoveItem (int index) |
| Clear a row and shift later rows towards the start without releasing payload allocations. | |
| MenuFont & | GetFont (int index) |
| unsigned short | GetItemCount () const |
| const void * | GetItemData (int index) const |
| void * | GetItemData (int index) |
| unsigned | GetFlags () const |
| unsigned | SetFlags (unsigned value) |
| Replace list flags without rebuilding layout. | |
| int | SetVerticalScrollbar (int value) |
| Store vertical scrollbar state without rebuilding layout. | |
| void | SetSelectionChangedCallback (int(*callback)(MenuItemList *, int *)) |
| Replace the row-activation callback without invoking it. | |
| void | SetItemChangedCallback (int(*callback)(MenuItemList *, int)) |
| Replace the text-edit completion callback without invoking it. | |
| float | GetMinScrollThumbY () const |
| float | GetMaxScrollThumbY () const |
| float | GetScrollThumbY () const |
| void | SetScrollThumbY (float value) |
| Store a vertical thumb position without clamping or updating its rectangle. | |
| void | SetScrollThumbTop (int value) |
| Change the thumb rectangle's top without updating its stored floating-point position. | |
| void | SetScrollThumbBottom (int value) |
| Change the thumb rectangle's bottom without resizing other layout fields. | |
Menu list with 100 font and payload slots, optional scrolling, and selection callbacks.
Native removal and destruction do not release item-data allocations. Direct accessors do not validate indices or synchronise related layout fields.
| MenuItemList::MenuItemList | ( | ) |
Initialise an empty list with null callbacks, disabled scrolling, and no images.
Initialise layout before drawing or adding items.
|
virtual |
Destroy font storage without releasing attached payload allocations.
|
virtual |
Append a text row, removing the oldest row first when all 100 slots are used.
Optional automatic scrolling can fail after insertion without removing the new row.
| text | A terminated label fitting MenuFont storage, or null to reject insertion. |
| flags | Font flag bits combined with the slot's existing flags. |
| style | The font style, with 3 selecting alternate-font measurement. |
| bounds | Non-null borrowed text bounds; left and right are copied, with rows 19 pixels apart from the list's origin. |
| full | Whether to copy the complete label rather than its first ten bytes. |
|
virtual |
Copy list bounds and configure visible rows, background, and enabled scrollbar geometry.
Scrollbar markers must be assigned before this call when scrolling is required.
| flags | The list flag bits to store. |
| bounds | Non-null borrowed list bounds in menu pixels, copied during the call. |
| visibleRows | The visible row count stored as an unsigned 16-bit value. |
| firstVisibleRow | The first visible slot stored as a signed 16-bit value. |
| backgroundImage | The image identifier stored as a signed 16-bit value. |
|
virtual |
Draw the list and process input when text editing and modal dialogs do not block input.
| selection | The selection passed to the drawing operation. |
|
virtual |
Measure a row, process active text editing, and notify its completion or cancellation.
| nIndex | The row index, 0..99, without bounds checking. |
|
virtual |
Copy bytes into slot payload storage, allocating only when the slot has no buffer.
Existing storage is reused without resizing, and allocation failure is unchecked.
| data | Non-null readable storage of at least size bytes, borrowed during copying. |
| size | The byte count; existing slot storage must have sufficient capacity. |
| index | The slot index, 0..99, or -1 for the last item; empty lists select slot 0. |
|
virtual |
Clear a row and shift later rows towards the start without releasing payload allocations.
| index | An existing row index in a nonempty list. |
|
inline |
| index | The font slot index, 0..99. |
|
inline |
|
inline |
| index | The payload slot index, 0..99. |
|
inline |
| index | The payload slot index, 0..99. |
|
inline |
|
inline |
Replace list flags without rebuilding layout.
| value | The list flag bits to store. |
|
inline |
Store vertical scrollbar state without rebuilding layout.
| value | The marker, with nonzero enabling the scrollbar during initialisation. |
|
inline |
Replace the row-activation callback without invoking it.
| callback | The callback, or null to disable notifications. Arguments are this list and a mutable activated-row index borrowed during the call; the integer return is discarded. |
|
inline |
Replace the text-edit completion callback without invoking it.
| callback | The callback, or null to disable notifications. Arguments are this list and the edited row, or -1 for cancellation; the integer return is discarded. |
|
inline |
|
inline |
|
inline |
|
inline |
Store a vertical thumb position without clamping or updating its rectangle.
| value | The vertical position in menu pixels. |
|
inline |
Change the thumb rectangle's top without updating its stored floating-point position.
| value | The top menu-pixel coordinate. |
|
inline |
Change the thumb rectangle's bottom without resizing other layout fields.
| value | The bottom menu-pixel coordinate. |