pub trait TextInputUndoExt: UndoSupport {
// Required methods
fn text_value(&self) -> &str;
fn set_text_value(&mut self, value: &str);
fn cursor_position(&self) -> usize;
fn set_cursor_position(&mut self, pos: usize);
fn insert_text_at(&mut self, position: usize, text: &str);
fn delete_text_range(&mut self, start: usize, end: usize);
}Expand description
Extension trait for text input widgets with undo support.
Required Methods§
Sourcefn text_value(&self) -> &str
fn text_value(&self) -> &str
Get the current text value.
Sourcefn set_text_value(&mut self, value: &str)
fn set_text_value(&mut self, value: &str)
Set the text value directly (for undo/redo).
Sourcefn cursor_position(&self) -> usize
fn cursor_position(&self) -> usize
Get the current cursor position.
Sourcefn set_cursor_position(&mut self, pos: usize)
fn set_cursor_position(&mut self, pos: usize)
Set the cursor position directly.
Sourcefn insert_text_at(&mut self, position: usize, text: &str)
fn insert_text_at(&mut self, position: usize, text: &str)
Insert text at a position.
Sourcefn delete_text_range(&mut self, start: usize, end: usize)
fn delete_text_range(&mut self, start: usize, end: usize)
Delete text at a range.