Struct termimad::InputField [−][src]
Expand description
A simple input field, managing its cursor position and either handling the events you give it or being managed through direct manipulation functions (put_char, del_char_left, etc.)
Fields
area: Area
focused: bool
Implementations
impl InputField
[src]
impl InputField
[src]pub fn new(area: Area) -> Self
[src]
pub fn change_area(&mut self, x: u16, y: u16, w: u16)
[src]
pub fn set_normal_style(&mut self, style: CompoundStyle)
[src]
pub fn get_content(&self) -> String
[src]
pub fn is_content(&self, s: &str) -> bool
[src]
pub fn is_content(&self, s: &str) -> bool
[src]tell whether the content of the input is equal to the argument
pub fn set_content(&mut self, s: &str)
[src]
pub fn set_content(&mut self, s: &str)
[src]change the content to the new one and put the cursor at the end if the content is different from the previous one.
pub fn put_char(&mut self, c: char) -> bool
[src]
pub fn put_char(&mut self, c: char) -> bool
[src]put a char at cursor position (and increment this position)
pub fn del_char_left(&mut self) -> bool
[src]
pub fn del_char_left(&mut self) -> bool
[src]remove the char left of the cursor, if any
pub fn del_char_below(&mut self) -> bool
[src]
pub fn del_char_below(&mut self) -> bool
[src]remove the char at cursor position, if any
pub fn move_right(&mut self) -> bool
[src]
pub fn move_left(&mut self) -> bool
[src]
pub fn move_to_end(&mut self) -> bool
[src]
pub fn move_to_start(&mut self) -> bool
[src]
pub fn move_word_left(&mut self) -> bool
[src]
pub fn move_word_right(&mut self) -> bool
[src]
pub fn del_word_left(&mut self) -> bool
[src]
pub fn del_word_right(&mut self) -> bool
[src]
pub fn apply_keycode_event(&mut self, code: KeyCode) -> bool
[src]
pub fn apply_keycode_event(&mut self, code: KeyCode) -> bool
[src]apply an event being a key without modifier.
You don’t usually call this function but the more
general apply_event
. This one is useful when you
manage events mostly yourselves.
This function handles a few events like deleting a
char, or going to the start (home key) or end (end key)
of the input. If you want to totally handle events, you
may call function like put_char
and del_char_left
directly.
pub fn apply_click_event(&mut self, x: u16, y: u16) -> bool
[src]
pub fn apply_click_event(&mut self, x: u16, y: u16) -> bool
[src]apply a click event
(for when you handle the events yourselves and don’t have a termimad event)
pub fn apply_event(&mut self, event: &Event) -> bool
[src]
pub fn apply_event(&mut self, event: &Event) -> bool
[src]apply the passed event to change the state (content, cursor)
Return true when the event was used.
Auto Trait Implementations
impl RefUnwindSafe for InputField
impl Send for InputField
impl Sync for InputField
impl Unpin for InputField
impl UnwindSafe for InputField
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T