PropertiesProps struct
#include <GGUI/Public/DataSource.h>
Properties of ui.Properties: a property grid, a FieldSource's fields as a two-column table of name and editor.
ItemSet closed; // categories and fields the user collapsed ui.Properties(selection, { .RowHeight = 22, .Filter = filterText, .Toggled = &closed }); ui.Properties(selection, props, [=](UI& ui, const FieldInfo& field) { if (field.ID != HealthField) return false; // false: use the registered editor HealthBar(ui); return true; });
With several sources (ui.Properties({ first, second }, ...)) it shows the fields they share:
- a field whose values differ is labelled Mixed;
- an edit goes to every source as one undoable edit (FieldSource::
Group); - a field that differs from its default gets a Reset button;
- a list field gets an add button, and a remove button per element.
It is a table, so rows are virtualised. Fields are grouped by category; a field whose type has no editor expands to its nested fields. Read-only fields have a disabled editor.
Public variables
- float RowHeight
- std::string_view Filter
- Case-insensitive name filter. Matching fields are shown with their ancestors and descendants.
- ItemSet* Toggled
- Collapsed categories and fields; everything starts expanded. Caller-owned, so it outlives the grid and can be shared between grids.
- std::vector<float>* Widths
- as TableProps::
Widths; the name column is the resizable one - bool bHeader
- shows the column headings
- GGSize Width
- its width
- GGSize Height
- Fit with a RowHeight means fill the available space.
- std::string_view Class
- its style classes