GGUI/Public/Fields.h file

Fields: UI generated from a runtime description of a type.

A details panel isn't written per type. The integration layer supplies a FieldSource (for the engine: reflection over components, entities, and Constructs) and the UI enumerates its fields.

ui.Fields(selection);                         // a label and an editor per field

ui.Fields(selection, [&](const FieldInfo& field)   // or lay out each row yourself
{
    ui.Key(field.ID);
    ui.Row({ .Class = "property" }, [&]
    {
        ui.Label(field.DisplayName);
        ui.Editor(selection, field);          // the editor registered for field.Type
    });
});

An EditorRegistry maps types to editors, with per-field overrides. A type with no editor shows its own fields, recursively.

Namespaces

namespace GGUI
namespace GGUI::FieldTypes
Types with built-in editors (EditorRegistry::AddDefaults).

Classes

struct GGUI::FieldInfo
One field of a type. The strings are only valid during the visit.
class GGUI::FieldVisitor
Non-owning callable taking a FieldInfo. Called during the call it is passed to, never stored.
struct GGUI::FieldSource
An object with fields to show: how to enumerate them, read them, and report edits.
class GGUI::EditorRegistry
EditorRegistry: maps field types to editor widgets.