[−][src]Struct unsegen::widget::builtin::lineedit::LineEdit
A user-editable line of text.
In addition to the current text, the LineEdit
has a concept of a cursor whose position can
change, but is always on a grapheme cluster in the current text.
Methods
impl LineEdit
[src]
pub fn new() -> Self
[src]
Create with default cursor style: Underline position when inactive and invert on blink.
pub fn with_cursor_styles(
active_blink_on: StyleModifier,
active_blink_off: StyleModifier,
inactive: StyleModifier
) -> Self
[src]
active_blink_on: StyleModifier,
active_blink_off: StyleModifier,
inactive: StyleModifier
) -> Self
Create with the specified style for the cursor.
Three styles have to be specified for the three possible states (in terms of rendering) of the cursor:
- Active, and during an "on"-blink cycle.
- Active, and during an "off"-blink cycle.
- Inactive.
pub fn get(&self) -> &str
[src]
Get the current content.
pub fn set(&mut self, text: &str)
[src]
Set (and overwrite) the current content. The cursor will be placed at the very end of the line.
pub fn move_cursor_to_end_of_line(&mut self)
[src]
Move the cursor to the end, i.e., behind the last grapheme cluster.
pub fn move_cursor_to_beginning_of_line(&mut self)
[src]
Move the cursor to the beginning, i.e., onto the first grapheme cluster.
pub fn move_cursor_right(&mut self) -> Result<(), ()>
[src]
Move the cursor one grapheme cluster to the right if possible.
pub fn move_cursor_left(&mut self) -> Result<(), ()>
[src]
Move the cursor one grapheme cluster to the left if possible.
pub fn insert(&mut self, text: &str)
[src]
Insert text directly before the current cursor position
Trait Implementations
impl Writable for LineEdit
[src]
fn write(&mut self, c: char) -> OperationResult
[src]
impl Navigatable for LineEdit
[src]
Note that there is no concept of moving up or down for a LineEdit
.
fn move_up(&mut self) -> OperationResult
[src]
fn move_down(&mut self) -> OperationResult
[src]
fn move_left(&mut self) -> OperationResult
[src]
fn move_right(&mut self) -> OperationResult
[src]
impl Editable for LineEdit
[src]
fn delete_forwards(&mut self) -> OperationResult
[src]
fn delete_backwards(&mut self) -> OperationResult
[src]
fn go_to_beginning_of_line(&mut self) -> OperationResult
[src]
fn go_to_end_of_line(&mut self) -> OperationResult
[src]
fn clear(&mut self) -> OperationResult
[src]
impl Widget for LineEdit
[src]
fn space_demand(&self) -> Demand2D
[src]
fn draw(&self, window: Window, hints: RenderingHints)
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,