Represents a text-input field, that can be focused, takes in events (keyboard events as text),
and it's possible to get the input text with get_text
TextInput.filter is used to determine which symbols are registered and then written.
Example of a filter that will take in latin alphabetic letters and numerals:
use glerminal::menu_systems::{Filter, TextInput};
use glerminal::VirtualKeyCode::Equals;
let filter = Filter::empty_filter()
.with_basic_latin_characters()
.with_basic_numerals()
.with_pair(Equals, '=');
TextInput::new(None, None).with_filter(filter);
Background-color for when the field is unfocused
Background-color for when the field is focused
Foreground-color for when the field is unfocused
Foreground-color for when the field is focused
The keyboard inputs that trigger was_just_pressed
The mouse inputs that trigger was_just_pressed
The filter used to determine which button presses are registered for writing
Determines how often (in seconds) the caret's status should update.
Set 0.0 for no caret.
Initializes a new TextInput with the given min and max width
Sets the initial position
Set whether the checkbox is initially focused or not
Set the buttons which trigger was_just_pressed
Set the mouse buttons which trigger was_just_pressed
Returns whether buttons from mouse_button_press_inputs
or button_press_inputs
were pressed just now.
Set the initial colors when it is unfocused
Set the initial colors when it is focused
Set the colors when it is unfocused
Set the colors when it is focused
Sets the width of the TextInput.
pub fn with_text<T: Into<String>>(self, text: T) -> TextInput | [src] |
Sets the text of the TextInput.
Sets the prefix text of the TextInput.
Sets the suffix text of the TextInput.
Sets the filter for the TextInput.
Determines how often (in seconds) the caret's status should update.
Set 0.0 for no caret.
Limtis the amount of characters that the TextInput will accept.
Sets the width of the TextInput.
Limtis the amount of characters that the TextInput will accept.
pub fn set_text<T: Into<String>>(&mut self, text: T) | [src] |
Returns the current text in the input
Get the InterfaceItemBase
Get the InterfaceItemBase
as mutable
Get the width this InterfaceItem can take up Read more
Get the height this InterfaceItem can take up Read more
Handle events for this InterfaceItem. Read more
Update this InterfaceItem; delta is given in seconds. (see Terminal.delta_time())
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Make a box of the cloned InterfaceItem
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static