GGUI::ListProps struct

Properties of ui.List.

Public variables

float Gap
GGSize Width
Anything but Fit makes every row as wide as the list, so row content can fill it (e.g. a full-width highlight).
std::string_view Class
float RowHeight
Fixed row height. Enables virtualisation: only visible rows are built, the list scrolls, and it can hold any number of items. 0: every row is built and sized to its content.
GGSize Height
Fit with a RowHeight means fill the available space.
ItemSet* Selected
Selection set. With one, rows are selectable by pointer and keyboard, and every view given the same set shows the same selection.
GGSelect Select
how many rows can be selected
GGSort Sort
ItemMoveFn OnMove
With one, rows can be dragged onto other rows.
HandlerOf<ItemID> OnSelect
The selection became this one item (needs a Selected set).
HandlerOf<ItemID> OnActivate
A row was double-clicked, or Enter (a gamepad's accept) pressed on it: open it, buy it.

Variable documentation

float GGUI::ListProps::Gap

between rows. Ignored with a RowHeight

GGSize GGUI::ListProps::Width

Anything but Fit makes every row as wide as the list, so row content can fill it (e.g. a full-width highlight).

its width

std::string_view GGUI::ListProps::Class

its style classes

GGSize GGUI::ListProps::Height

Fit with a RowHeight means fill the available space.

its height

GGSort GGUI::ListProps::Sort

the order shown

ItemMoveFn GGUI::ListProps::OnMove

With one, rows can be dragged onto other rows.

The callback is told what was dropped where: the dragged row, or every selected row if it was one of them (UIDragDrop.h). The owner moves the data; the list follows its source.