EditorSproutyDialogsDictionaryFieldItem
Inherits: HBoxContainer
Description
This component is an item field from the dictionary field. It allows the user to modify the item key, value type and value.
Properties
| Type | Name | Default |
|---|---|---|
| bool | no_expandable_textbox | false |
Methods
| Return Type | Method |
|---|---|
| Dictionary | get_item_data() |
| Variant | get_value() |
| Variant | get_type() |
| Dictionary | get_metadata() |
| String | get_key() |
| void | set_key(key: String) |
| void | set_value(value: Variant, type: int, metadata: Dictionary) |
| void | set_type(type: int, metadata: Dictionary) |
Signals
signal modified
Emitted when the item is modified.
signal item_changed(item: Dictionary)
Emitted when the item is changed.
signal item_removed(index: int)
Emitted when the remove button is pressed.
signal key_modified(key: String)
Emitted when the item key is modified.
signal open_text_editor(text_box: TextEdit)
Emitted when press the expand button in a text box field.
signal update_text_editor(text_box: TextEdit)
Emitted when a text box field gains focus and should update the text editor.
Property Descriptions
var no_expandable_textbox : bool = false
Flag to remove the expandable text box from string fields.
Method Descriptions
func get_item_data() -> Dictionary
Returns the item data as a dictionary with the following structure:
{
"key": String,
"type": int,
"value": Variant,
"metadata": Dictionary
}
func get_value() -> Variant
Returns the current value of the item.
func get_type() -> Variant
Returns the current type of the item.
func get_metadata() -> Dictionary
Returns the current metadata of the item type.
func get_key() -> String
Returns the current key of the item.
func set_key(key: String) -> void
Set the current key of the item.
func set_value(value: Variant, type: int, metadata: Dictionary) -> void
Set the current value of the item along with its type and metadata.
func set_type(type: int, metadata: Dictionary) -> void
Set the variable type and metadata for the item.