N_GUI_SB_TRACK
Module: GUI: allegro5 widget system with pseudo-windows
Where a scrollbar a widget draws inside itself was last painted, and whether the pointer is on it. More...
#include "n_gui.h"
Public Attributes
| Name | |
|---|---|
| float | y top edge |
| float | x left edge, in the coordinates the paint drew in |
| float | w width; zero when no bar was painted |
| int | hovered non-zero while the pointer is inside the rectangle above, and while a drag that began inside it is still going |
| float | h height; zero when no bar was painted |
Detailed Description
struct N_GUI_SB_TRACK;
Where a scrollbar a widget draws inside itself was last painted, and whether the pointer is on it.
Such a bar is highlighted while the pointer is over the bar, and not otherwise: widget-level hover would be no answer, because the pointer is over a row or a cell far more often than over the bar, and keyboard focus is no answer either, because a widget with two bars has one focus and two bars to light with it.
Somebody therefore has to answer "is the pointer on this bar". The geometry is worked out by the paint, once per widget type, and the paint has no pointer position to test against; the event pass has the pointer and no geometry. So the paint records the rectangle here and the event pass hit-tests it. The answer is one frame old at worst, and that is a frame in which the pointer did not move.
Zero initialised with the widget, and a zero width or height means the bar was not painted, so it can never be hit.
Public Attributes Documentation
variable y
float y;
top edge
variable x
float x;
left edge, in the coordinates the paint drew in
variable w
float w;
width; zero when no bar was painted
variable hovered
int hovered;
non-zero while the pointer is inside the rectangle above, and while a drag that began inside it is still going
variable h
float h;
height; zero when no bar was painted
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