coastline 0.0.4
Loading...
Searching...
No Matches
MenuItemList Class Reference

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ MenuItemList()

MenuItemList::MenuItemList ( )

Initialise an empty list with null callbacks, disabled scrolling, and no images.

Initialise layout before drawing or adding items.

Ghidra address:
BRD3D: 0x1005b7f0
Ghidra address:
BRGlide: 0x10054610

◆ ~MenuItemList()

virtual MenuItemList::~MenuItemList ( )
virtual

Destroy font storage without releasing attached payload allocations.

Ghidra address:
BRD3D: 0x1005b8f0
Ghidra address:
BRGlide: 0x10054710

Member Function Documentation

◆ AddItem()

virtual int MenuItemList::AddItem ( const char * text,
unsigned flags,
unsigned char style,
const RECT * bounds,
bool full )
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.

Parameters
textA terminated label fitting MenuFont storage, or null to reject insertion.
flagsFont flag bits combined with the slot's existing flags.
styleThe font style, with 3 selecting alternate-font measurement.
boundsNon-null borrowed text bounds; left and right are copied, with rows 19 pixels apart from the list's origin.
fullWhether to copy the complete label rather than its first ten bytes.
Returns
One normally; zero for null text or an unavailable automatic-scroll target.
Ghidra address:
BRD3D: 0x1005bc10
Ghidra address:
BRGlide: 0x10054a30

◆ Initialize()

virtual int MenuItemList::Initialize ( unsigned flags,
const RECT * bounds,
int visibleRows,
int firstVisibleRow,
int backgroundImage )
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.

Parameters
flagsThe list flag bits to store.
boundsNon-null borrowed list bounds in menu pixels, copied during the call.
visibleRowsThe visible row count stored as an unsigned 16-bit value.
firstVisibleRowThe first visible slot stored as a signed 16-bit value.
backgroundImageThe image identifier stored as a signed 16-bit value.
Returns
One.
Ghidra address:
BRD3D: 0x1005b910
Ghidra address:
BRGlide: 0x10054730

◆ UpdateAndRenderMenuWidget()

virtual int MenuItemList::UpdateAndRenderMenuWidget ( int selection)
virtual

Draw the list and process input when text editing and modal dialogs do not block input.

Parameters
selectionThe selection passed to the drawing operation.
Returns
The activated row, possibly changed by its callback, or -1 when no row is activated.
Ghidra address:
BRD3D: 0x1005cb40
Ghidra address:
BRGlide: 0x10055960

◆ UpdateItemAndNotify()

virtual int MenuItemList::UpdateItemAndNotify ( int nIndex)
virtual

Measure a row, process active text editing, and notify its completion or cancellation.

Parameters
nIndexThe row index, 0..99, without bounds checking.
Returns
Zero when the caret is inactive; one when text input was processed.
Ghidra address:
BRD3D: 0x1005bb80
Ghidra address:
BRGlide: 0x100549a0

◆ SetItemData()

virtual int MenuItemList::SetItemData ( const void * data,
unsigned size,
int index )
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.

Parameters
dataNon-null readable storage of at least size bytes, borrowed during copying.
sizeThe byte count; existing slot storage must have sufficient capacity.
indexThe slot index, 0..99, or -1 for the last item; empty lists select slot 0.
Returns
One.
Ghidra address:
BRD3D: 0x1005c200
Ghidra address:
BRGlide: 0x10055020

◆ RemoveItem()

virtual int MenuItemList::RemoveItem ( int index)
virtual

Clear a row and shift later rows towards the start without releasing payload allocations.

Parameters
indexAn existing row index in a nonempty list.
Returns
One.
Ghidra address:
BRD3D: 0x1005c000
Ghidra address:
BRGlide: 0x10054e20

◆ GetFont()

MenuFont & MenuItemList::GetFont ( int index)
inline
Parameters
indexThe font slot index, 0..99.
Returns
A mutable slot reference valid until destruction; row removal can replace its value.

◆ GetItemCount()

unsigned short MenuItemList::GetItemCount ( ) const
inline
Returns
The stored row count, normally 0..100.

◆ GetItemData() [1/2]

const void * MenuItemList::GetItemData ( int index) const
inline
Parameters
indexThe payload slot index, 0..99.
Returns
The borrowed payload pointer, or null; subsequent slot changes can replace it.

◆ GetItemData() [2/2]

void * MenuItemList::GetItemData ( int index)
inline
Parameters
indexThe payload slot index, 0..99.
Returns
The mutable borrowed payload pointer, or null; slot changes can replace it.

◆ GetFlags()

unsigned MenuItemList::GetFlags ( ) const
inline
Returns
The stored list flag bits.

◆ SetFlags()

unsigned MenuItemList::SetFlags ( unsigned value)
inline

Replace list flags without rebuilding layout.

Parameters
valueThe list flag bits to store.
Returns
The stored flag bits.

◆ SetVerticalScrollbar()

int MenuItemList::SetVerticalScrollbar ( int value)
inline

Store vertical scrollbar state without rebuilding layout.

Parameters
valueThe marker, with nonzero enabling the scrollbar during initialisation.
Returns
The stored marker.

◆ SetSelectionChangedCallback()

void MenuItemList::SetSelectionChangedCallback ( int(* callback )(MenuItemList *, int *))
inline

Replace the row-activation callback without invoking it.

Parameters
callbackThe 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.

◆ SetItemChangedCallback()

void MenuItemList::SetItemChangedCallback ( int(* callback )(MenuItemList *, int))
inline

Replace the text-edit completion callback without invoking it.

Parameters
callbackThe callback, or null to disable notifications. Arguments are this list and the edited row, or -1 for cancellation; the integer return is discarded.

◆ GetMinScrollThumbY()

float MenuItemList::GetMinScrollThumbY ( ) const
inline
Returns
The stored minimum vertical thumb position in menu pixels.

◆ GetMaxScrollThumbY()

float MenuItemList::GetMaxScrollThumbY ( ) const
inline
Returns
The stored maximum vertical thumb position in menu pixels.

◆ GetScrollThumbY()

float MenuItemList::GetScrollThumbY ( ) const
inline
Returns
The stored vertical thumb position in menu pixels.

◆ SetScrollThumbY()

void MenuItemList::SetScrollThumbY ( float value)
inline

Store a vertical thumb position without clamping or updating its rectangle.

Parameters
valueThe vertical position in menu pixels.

◆ SetScrollThumbTop()

void MenuItemList::SetScrollThumbTop ( int value)
inline

Change the thumb rectangle's top without updating its stored floating-point position.

Parameters
valueThe top menu-pixel coordinate.

◆ SetScrollThumbBottom()

void MenuItemList::SetScrollThumbBottom ( int value)
inline

Change the thumb rectangle's bottom without resizing other layout fields.

Parameters
valueThe bottom menu-pixel coordinate.

The documentation for this class was generated from the following file: