5 Struct N_GUI_COMBOBOX_DATA
gullradriel edited this page 2026-10-09 00:55:18 +02:00

N_GUI_COMBOBOX_DATA

Module: GUI: allegro5 widget system with pseudo-windows

combo box specific data

#include "n_gui.h"

Public Attributes

Name
void * user_data
user data for callback
int selected_index
currently selected index (-1 = none)
int scroll_offset
scroll offset in dropdown
void(*)(int widget_id, int index, void *user_data) on_select
callback on selection change (widget_id, selected_index, user_data)
size_t nb_items
number of items
int max_visible
max visible items in dropdown
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 dropdown
ALLEGRO_BITMAP * item_bg_bitmap
optional bitmap for per-item background, normal state (NULL = color theme)
int is_open
is dropdown currently open
int highlight_index
open-panel navigation cursor for the wheel and Up/Down keys (-1 = none).
int flags
bitmask of N_GUI_COMBOBOX_* flags
ALLEGRO_BITMAP * bg_bitmap
optional bitmap for the combobox background (NULL = color theme)

Public Attributes Documentation

variable user_data

void * user_data;

user data for callback

variable selected_index

int selected_index;

currently selected index (-1 = none)

variable scroll_offset

int scroll_offset;

scroll offset in dropdown

variable on_select

void(*)(int widget_id, int index, void *user_data) on_select;

callback on selection change (widget_id, selected_index, user_data)

variable nb_items

size_t nb_items;

number of items

variable max_visible

int max_visible;

max visible items in dropdown

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 dropdown

variable item_bg_bitmap

ALLEGRO_BITMAP * item_bg_bitmap;

optional bitmap for per-item background, normal state (NULL = color theme)

variable is_open

int is_open;

is dropdown currently open

variable highlight_index

int highlight_index;

open-panel navigation cursor for the wheel and Up/Down keys (-1 = none).

While the dropdown is open, the wheel and arrow keys move this; hovering the panel sets it to the item under the pointer; Enter or a click commits it to selected_index. Reset to -1 when the panel closes.

variable flags

int flags;

bitmask of N_GUI_COMBOBOX_* flags

variable bg_bitmap

ALLEGRO_BITMAP * bg_bitmap;

optional bitmap for the combobox background (NULL = color theme)