Represents a Checkbox that can be checked or unchecked, and it's checked-status can be get with is_checked
.
See CheckboxGroup to limit how checkboxes can be checked together.
For example:
use glerminal::menu_systems::Checkbox;
Checkbox::new("Generate world: ")
.with_prefix("<")
.with_suffix(">")
.with_checked_text("O");
Foreground color for when the checkbox is not focused
Background color for when the checkbox is not focused
Foreground color for when the checkbox is focused
Background color for when the checkbox is focused
The keyboard inputs that trigger was_just_pressed
The mouse inputs that trigger was_just_pressed
Intiailizes a Checkbox with the given text 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
pub fn with_text<T: Into<String>>(self, text: T) -> Checkbox | [src] |
Sets the initial text of the Checkbox
Sets the initial prefix of the Checkbox
Sets the initial suffix of the Checkbox
pub fn with_checked_text<T: Into<String>>(self, checked_text: T) -> Checkbox | [src] |
Sets the initial checked-text (text shown in between prefix and suffix) of the Checkbox
Set whether the checkbox is initially checked or not
pub fn set_text<T: Into<String>>(&mut self, text: T) | [src] |
Sets the text of the Checkbox
Sets the prefix of the Checkbox
Sets the suffix of the Checkbox
pub fn set_checked_text<T: Into<String>>(self, checked_text: T) | [src] |
Sets the checked-text (text shown in between prefix and suffix) of the Checkbox
Return the current text of the Checkbox
Return the current prefix of the Checkbox
Return the current suffix of the Checkbox
Sets the checked-status for this checkbox.
Returns whether this checkbox is checked.
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