GGUI::FieldSource struct

An object with fields to show: how to enumerate them, read them, and report edits.

Derived classes

struct EntityFields
An entity's reflected components as a field source, for property grids and bindings.
struct PrefabFields

Public variables

void* Context
the source's own
BindTarget Target
target the fields' bindings read from
TypeID Type
void(* Enumerate
Visit the type's fields in declaration order (parent null), or the fields nested in parent. A nested field needs an ID and FieldID unique to that parent.
void(* SetValue
An edit of field's value, in the field's own type: value.As<Fixed32>(), or value.AsDouble() for sources that store floats. It has not been converted through any other type.
void(* SetText
A text edit of field was committed.
std::string_view(* Text
field's text now. Valid until the next call into the source.
bool(* Get
Current value, for editors that are built from the value rather than bound to it (colour, item). out carries the wanted type in its Ops. False if there is no value.
bool(* Default
The field's default, in the same form as Get. A field that differs from it gets a Reset button. False if there is no default.
bool(* DefaultText
Default for a text field. Valid until the next call into the source.
void(* Group
Brackets a multi-object edit (a property grid showing several sources): every SetValue and SetText between open and close, across all sources, is one undoable edit.
void(* InsertElement
Insert an element in list list (Hints::List) before index, or at the end.
void(* RemoveElement
Remove the element at index of list list.
void(* MoveElement
Move the element at from of list list to to.
bool(* Items
The choices for a FieldTypes::Item field. False if there are none.

Variable documentation

TypeID GGUI::FieldSource::Type

type being enumerated

void(* GGUI::FieldSource::Group

Brackets a multi-object edit (a property grid showing several sources): every SetValue and SetText between open and close, across all sources, is one undoable edit.

Called on the first source only.

void(* GGUI::FieldSource::InsertElement

Insert an element in list list (Hints::List) before index, or at the end.

The grid enumerates again afterwards. With several sources, each is called inside one Group, and only while their lists have equal length.