gui2.widgetutils

Widget utility functions.

bool validWidgetName(const string name);

Is the given string a valid widget name?

bool validComposedWidgetName(const string name);

Is the given string a valid composed widget name (name of a subwidget)?

T widgetInitProperty(T)(ref YAMLNode yaml, string name);

Parse a non-optional widget property at widget initialization.

T layoutInitProperty(T)(ref YAMLNode yaml, string name);

Parse a non-optional layout property at layout initialization.

T styleInitPropertyOpt(T)(ref YAMLNode yaml, string name, auto ref T defValue);

Parse an optional style initialization property, with a default if not specified.

T widgetInitPropertyOpt(T)(ref YAMLNode yaml, string name, auto ref T defValue);

Parse an optional widget initialization property, with a default if not specified.

T property(T, E)(ref YAMLNode yaml, string name);

Parse a (non-optional) property from YAML and return its value.

T optionalProperty(T, E)(ref YAMLNode yaml, string name, ref T defValue);

Parse an optional property from YAML.

Parameters:
yaml YAML mapping containing the property.
name Name of the property.
defValue Default value of the property.