Table of Contents
- N_GUI_TEXTAREA_DATA
- Public Attributes
- Public Attributes Documentation
- variable user_data
- variable text_len
- variable text_alloc
- variable text
- variable suggest_user_data
- variable suggest_separators
- variable suggest_scroll
- variable suggest_prefix
- variable suggest_open
- variable suggest_items
- variable suggest_highlight
- variable suggest_count
- variable suggest
- variable sel_start
- variable sel_end
- variable scroll_y
- variable scroll_x
- variable scroll_from_wheel
- variable placeholder
- variable on_change
- variable multiline
- variable mask_char
- variable cursor_time
- variable cursor_pos
- variable char_limit
- variable bg_bitmap
N_GUI_TEXTAREA_DATA
Module: GUI: allegro5 widget system with pseudo-windows
text area specific data
#include "n_gui.h"
Public Attributes
| Name | |
|---|---|
| void * | user_data user data for callback |
| size_t | text_len current text length |
| size_t | text_alloc allocated buffer size (char_limit + 1) |
| char * | text text content (dynamically allocated, text_alloc bytes) |
| void * | suggest_user_data user data handed back to the provider |
| char[8] | suggest_separators characters that end a word, so a field holding a list completes the one the cursor is in rather than the whole line. |
| int | suggest_scroll first item the panel shows |
| char[128] | suggest_prefix the word the answers are for, so the provider is asked once per word rather than once per key |
| int | suggest_open the panel is up |
| N_GUI_LISTITEM * | suggest_items what the provider last answered, allocated on the first ask |
| int | suggest_highlight which one the keys and the pointer are on (-1 = none) |
| int | suggest_count how many of them |
| N_GUI_SUGGEST_FN | suggest completion provider, NULL when the field offers none |
| size_t | sel_start selection anchor position (where shift-click/shift-arrow started). |
| size_t | sel_end selection end position (tracks cursor during selection) |
| int | scroll_y scroll offset for long text |
| float | scroll_x horizontal scroll offset for single-line text (pixels) |
| int | scroll_from_wheel set to 1 when scroll was changed by mouse wheel, cleared on key input |
| char * | placeholder optional placeholder/hint text drawn dimmed while the field is empty (NULL = none); cleared from view as soon as any text is entered |
| void(*)(int widget_id, const char *text, void *user_data) | on_change callback on text change |
| int | multiline 0 = single line, 1 = multiline |
| char | mask_char mask character for password fields (0 = no masking, e.g. |
| double | cursor_time timestamp of last cursor activity (for blink reset) |
| size_t | cursor_pos cursor position in text |
| size_t | char_limit maximum character limit (0 = N_GUI_TEXT_MAX) |
| ALLEGRO_BITMAP * | bg_bitmap optional bitmap for the text area background (NULL = color theme) |
Public Attributes Documentation
variable user_data
void * user_data;
user data for callback
variable text_len
size_t text_len;
current text length
variable text_alloc
size_t text_alloc;
allocated buffer size (char_limit + 1)
variable text
char * text;
text content (dynamically allocated, text_alloc bytes)
variable suggest_user_data
void * suggest_user_data;
user data handed back to the provider
variable suggest_separators
char[8] suggest_separators;
characters that end a word, so a field holding a list completes the one the cursor is in rather than the whole line.
Empty means the whole content is one word.
variable suggest_scroll
int suggest_scroll;
first item the panel shows
variable suggest_prefix
char[128] suggest_prefix;
the word the answers are for, so the provider is asked once per word rather than once per key
variable suggest_open
int suggest_open;
the panel is up
variable suggest_items
N_GUI_LISTITEM * suggest_items;
what the provider last answered, allocated on the first ask
variable suggest_highlight
int suggest_highlight;
which one the keys and the pointer are on (-1 = none)
variable suggest_count
int suggest_count;
how many of them
variable suggest
N_GUI_SUGGEST_FN suggest;
completion provider, NULL when the field offers none
variable sel_start
size_t sel_start;
selection anchor position (where shift-click/shift-arrow started).
When sel_start == sel_end, no selection is active.
variable sel_end
size_t sel_end;
selection end position (tracks cursor during selection)
variable scroll_y
int scroll_y;
scroll offset for long text
variable scroll_x
float scroll_x;
horizontal scroll offset for single-line text (pixels)
variable scroll_from_wheel
int scroll_from_wheel;
set to 1 when scroll was changed by mouse wheel, cleared on key input
variable placeholder
char * placeholder;
optional placeholder/hint text drawn dimmed while the field is empty (NULL = none); cleared from view as soon as any text is entered
variable on_change
void(*)(int widget_id, const char *text, void *user_data) on_change;
callback on text change
variable multiline
int multiline;
0 = single line, 1 = multiline
variable mask_char
char mask_char;
mask character for password fields (0 = no masking, e.g.
'*')
variable cursor_time
double cursor_time;
timestamp of last cursor activity (for blink reset)
variable cursor_pos
size_t cursor_pos;
cursor position in text
variable char_limit
size_t char_limit;
maximum character limit (0 = N_GUI_TEXT_MAX)
variable bg_bitmap
ALLEGRO_BITMAP * bg_bitmap;
optional bitmap for the text area 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