glendix/define/ui
Renders screens for the interactive Glendix widget definition editor.
Types
Represents whether the editor has unsaved changes.
pub type ChangeState {
Saved
Modified
}
Constructors
-
SavedThe rendered model is saved.
-
ModifiedThe rendered model contains unsaved changes.
A typed EditField value used by the ui capability.
pub type EditField {
TextField(label: String, value: String)
BoolField(label: String, value: Bool)
ReadOnlyField(label: String, value: String)
ListField(label: String, count: Int)
SelectField(label: String, value: String)
}
Constructors
-
TextField(label: String, value: String)The
TextFieldvariant. -
BoolField(label: String, value: Bool)The
BoolFieldvariant. -
ReadOnlyField(label: String, value: String)The
ReadOnlyFieldvariant. -
ListField(label: String, count: Int)The
ListFieldvariant. -
SelectField(label: String, value: String)The
SelectFieldvariant.
Represents whether a text field is actively being edited.
pub type EditMode {
Viewing
Editing
}
Constructors
-
ViewingThe field is displayed without an active text cursor.
-
EditingThe field is displayed with an active text cursor.
A typed TreeRow value used by the ui capability.
pub type TreeRow {
GroupRow(
flat_index: Int,
group_index: Int,
caption: String,
item_count: Int,
is_collapsed: Bool,
)
PropertyRow(
flat_index: Int,
group_index: Int,
item_index: Int,
prop: model.Property,
)
SystemRow(
flat_index: Int,
group_index: Int,
item_index: Int,
key: String,
)
}
Constructors
-
GroupRow( flat_index: Int, group_index: Int, caption: String, item_count: Int, is_collapsed: Bool, )The
GroupRowvariant. -
PropertyRow( flat_index: Int, group_index: Int, item_index: Int, prop: model.Property, )The
PropertyRowvariant. -
SystemRow( flat_index: Int, group_index: Int, item_index: Int, key: String, )The
SystemRowvariant.
Values
pub fn build_tree_rows(
groups groups: List(model.PropertyGroup),
collapsed collapsed: List(Int),
group_start group_start: Int,
flat_start flat_start: Int,
) -> List(TreeRow)
Builds the tree rows.
pub fn fields_to_property(
original original: model.Property,
fields fields: List(EditField),
) -> model.Property
Applies edited form fields to a property.
pub fn fields_to_widget_meta(
original original: model.WidgetMeta,
fields fields: List(EditField),
) -> model.WidgetMeta
Applies edited form fields to widget metadata.
pub fn property_to_fields(
prop prop: model.Property,
) -> List(EditField)
Converts a property into editable form fields.
pub fn render_confirm_delete_screen(
target_label target_label: String,
) -> String
Renders the confirm delete screen.
pub fn render_confirm_quit_screen() -> String
Renders the confirm quit screen.
pub fn render_edit_screen(
prop_key prop_key: String,
prop_type prop_type: String,
fields fields: List(EditField),
cursor cursor: Int,
mode mode: EditMode,
edit_buffer edit_buffer: String,
edit_cursor_pos edit_cursor_pos: Int,
) -> String
Renders the edit screen.
pub fn render_enum_edit_screen(
values values: List(model.EnumValue),
cursor cursor: Int,
status_msg status_msg: option.Option(String),
) -> String
Renders the enum edit screen.
pub fn render_input_screen(
title title: String,
buffer buffer: String,
cursor_pos cursor_pos: Int,
) -> String
Renders the input screen.
pub fn render_multi_select_screen(
title title: String,
options options: List(String),
selected selected: List(String),
cursor cursor: Int,
) -> String
Renders the multi select screen.
pub fn render_sys_prop_screen(
options options: List(String),
cursor cursor: Int,
) -> String
Renders the sys prop screen.
pub fn render_tree_screen(
widget_name widget_name: String,
groups groups: List(model.PropertyGroup),
cursor cursor: Int,
collapsed collapsed: List(Int),
changes changes: ChangeState,
status_msg status_msg: option.Option(String),
scroll_offset scroll_offset: Int,
term_rows term_rows: Int,
) -> String
Renders the tree screen.
pub fn render_type_select_screen(cursor cursor: Int) -> String
Renders the type select screen.
pub fn widget_meta_to_fields(
meta meta: model.WidgetMeta,
) -> List(EditField)
Converts widget metadata into editable form fields.