Skip to main content

TextInputUndoExt

Trait TextInputUndoExt 

Source
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§

Source

fn text_value(&self) -> &str

Get the current text value.

Source

fn set_text_value(&mut self, value: &str)

Set the text value directly (for undo/redo).

Source

fn cursor_position(&self) -> usize

Get the current cursor position.

Source

fn set_cursor_position(&mut self, pos: usize)

Set the cursor position directly.

Source

fn insert_text_at(&mut self, position: usize, text: &str)

Insert text at a position.

Source

fn delete_text_range(&mut self, start: usize, end: usize)

Delete text at a range.

Implementors§