Table of Contents
N_GUI_LISTBOX_DATA
Module: GUI: allegro5 widget system with pseudo-windows
listbox specific data
#include "n_gui.h"
Public Attributes
| Name | |
|---|---|
| void * | user_data user data for callback |
| int | selection_mode selection mode: N_GUI_SELECT_NONE, N_GUI_SELECT_SINGLE, N_GUI_SELECT_MULTIPLE |
| int | scroll_offset scroll offset in items |
| void(*)(int widget_id, int index, int selected, void *user_data) | on_select callback on selection change (widget_id, item_index, selected, user_data) |
| size_t | nb_items number of items |
| size_t | items_capacity allocated capacity |
| N_GUI_LISTITEM * | items dynamic array of items |
| ALLEGRO_BITMAP * | item_selected_bitmap optional bitmap for per-item background, selected/highlighted (NULL = color theme) |
| float | item_height item height in pixels |
| ALLEGRO_BITMAP * | item_bg_bitmap optional bitmap for per-item background, normal state (NULL = color theme) |
| int | hover_row index of the row the mouse is currently over, or -1. |
| int | h_scroll_dragging 1 while the user is dragging the horizontal scrollbar thumb, so the shared scrollbar-drag handler routes the drag to h_scroll rather than to the vertical scroll position. |
| float | h_scroll horizontal scroll offset in pixels: how far the item text is scrolled to the left when the widest item is wider than the widget. |
| ALLEGRO_BITMAP * | bg_bitmap optional bitmap for the listbox background (NULL = color theme) |
Public Attributes Documentation
variable user_data
void * user_data;
user data for callback
variable selection_mode
int selection_mode;
selection mode: N_GUI_SELECT_NONE, N_GUI_SELECT_SINGLE, N_GUI_SELECT_MULTIPLE
variable scroll_offset
int scroll_offset;
scroll offset in items
variable on_select
void(*)(int widget_id, int index, int selected, void *user_data) on_select;
callback on selection change (widget_id, item_index, selected, user_data)
variable nb_items
size_t nb_items;
number of items
variable items_capacity
size_t items_capacity;
allocated capacity
variable items
N_GUI_LISTITEM * items;
dynamic array of items
variable item_selected_bitmap
ALLEGRO_BITMAP * item_selected_bitmap;
optional bitmap for per-item background, selected/highlighted (NULL = color theme)
variable item_height
float item_height;
item height in pixels
variable item_bg_bitmap
ALLEGRO_BITMAP * item_bg_bitmap;
optional bitmap for per-item background, normal state (NULL = color theme)
variable hover_row
int hover_row;
index of the row the mouse is currently over, or -1.
Updated in the event loop when the widget gains N_GUI_STATE_HOVER; consumed by the draw path to paint a hover highlight.
variable h_scroll_dragging
int h_scroll_dragging;
1 while the user is dragging the horizontal scrollbar thumb, so the shared scrollbar-drag handler routes the drag to h_scroll rather than to the vertical scroll position.
variable h_scroll
float h_scroll;
horizontal scroll offset in pixels: how far the item text is scrolled to the left when the widest item is wider than the widget.
0 = leftmost. A horizontal scrollbar is drawn (and the text stops being truncated with an ellipsis) only while the content overflows.
variable bg_bitmap
ALLEGRO_BITMAP * bg_bitmap;
optional bitmap for the listbox background (NULL = color theme)
Modules
- AABB3D
- ACCEPT_POOL
- ALLEGRO4
- ALLEGRO5
- ANIM_LIB
- ASTAR
- ATLAS_LIB
- AVRO
- CLOCK_SYNC
- COMMONS
- CONFIGFILE
- CYPHER_BASE64
- CYPHER_VIGENERE
- DEAD_RECKONING
- ENUMS
- EXCEPTIONS
- GAME_ENV
- GIT
- GUI
- HASH_TABLE
- ISOMETRIC_ENGINE
- LIST
- LOG
- LOGNODUP
- LZ4
- NETWORKING
- NETWORK_MSG
- N_COOKIES
- N_DIFF
- N_DIGEST
- N_DISK_CACHE
- N_DNS
- N_ECC
- N_ENTROPY
- N_FILES
- N_FLUIDS
- N_GUI_COLOR
- N_GUI_COLORWHEEL
- N_GUI_CURVE
- N_GUI_GRID
- N_GUI_POPUP
- N_HEX
- N_HTTP3
- N_HTTP_COOKIE
- N_HTTP_FORM
- N_HTTP_MIME
- N_HTTP_REQ
- N_HTTP_RESP
- N_HTTP_ROUTER
- N_HTTP_SERVER
- N_ICC
- N_JSON
- N_KAFKA
- N_LINALG
- N_MODULE
- N_OPENSSL_COMPAT
- N_PRETTY
- N_PTH
- N_QUERY
- N_RANDOM
- N_SHA256
- N_STR
- N_TIFF
- N_TIME
- N_USER
- N_X509
- N_ZIP
- PARTICLES
- PCRE
- PHYSICS
- SIGNALS
- STACK
- THREADS
- TRAJECTORY
- TREE
- ZLIB