FieldSource struct
#include <GGUI/Public/Fields.h>
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 (
parentnull), or the fields nested inparent. A nested field needs an ID and FieldID unique to that parent. - void(* SetValue
- An edit of
field'svalue, 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
fieldwas committed. - std::string_view(* Text
field'stext 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).
outcarries 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
indexof listlist. - void(* MoveElement
- Move the element at
fromof listlisttoto. - bool(* Items
- The choices for a FieldTypes::
Item field. False if there are none.
Variable documentation
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::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.