DVUI

FieldOptions

Field options control whether and how fields are displayed.

Use TextFieldOptions for any array or slice of u8 you want ot display as a string. Use NumberFieldOptions for any numbers, allowing setting of min and max ranges and other options Use BoolFieldOptions for any bools. Use StandardFieldOptions can be used for any field to give a default layout. Use OptionalFieldOptions to use different field options for the optional vs the optional's value. If a custom display function is supplied, they will be used to display the struct instead of the struct_ui default functions.

All FieldOptions types must provide:

  • display: DisplayMode
  • label: ?[]const u8
  • customDisplayFn: ?*const fn(field_name: []const u8, field_value_ptr: *anyopaque, read_only: bool, al: *dvui.Alignment)
  • default_expanded: ?bool

Fields

#
standard:StandardFieldOptions
StandardFieldOptions
number:NumberFieldOptions
NumberFieldOptions
text:TextFieldOptions
TextFieldOptions
boolean:BoolFieldOptions
BoolFieldOptions
optional:OptionalFieldOptions
OptionalFieldOptions

Types

#

Functions

#
childOption

If this FieldOption supports child options,

defaultExpanded

For container fields, controls whether the field is displayed expanded or collapsed.

Constants

#
default

All field can use default standard field option, however using the correct field