GGUI/Public/UIConsoleWidgets.h file

Console widgets: a log view and a command line.

ui.LogView({ .Height = GGSize::Grow(), .Filter = filterText }, lines);
ui.CommandLine({ .Placeholder = "Command" }, commands);

Both are driven by callbacks (GGLineSource, GGCommandSource). The engine plugs in its logger and console registry; a game can plug in chat or its own commands.

The log view is virtualised: it only asks the source for visible lines, plus whatever a filter has to scan. Rows are fixed height and plain text. A line containing line feeds takes one row per text line; long lines are clipped, not wrapped.

Namespaces

namespace GGUI
namespace GGUI::LogViews
Log views as they are, for tools and tests. Each takes the node ui.LogView returned.

Classes

struct GGUI::GGLine
One log line. The strings are valid until the next call into the source.
struct GGUI::GGLineSource
Lines to show, oldest first. Indices are stable: a dropped line's index is never reused.
struct GGUI::LogViewProps
Properties of ui.LogView.
class GGUI::CompletionVisitor
Non-owning callable (name, argument hint). Called during the call it is passed to, never stored.
struct GGUI::GGCommandSource
Command completion and execution. Called during the UI update.
struct GGUI::CommandLineProps
Properties of ui.CommandLine.