pub struct TextBox<F, M, A: AppEvent> {
pub active: bool,
/* private fields */
}Expand description
A simplistic single line String editor.
It is suitable for simple use cases such as quick search input.
The cursor is always at the end. Backspace removes the last char.
Clicking on the TextBox activates it,
clicking somewhere else deactivates it.
You can override this by setting the
active property on each update.
No cloning/moving, it will edit the &mut String in the model directly.
The last part of the string that fits is visible (tail).
Fields§
§active: boolImplementations§
Trait Implementations§
source§impl<F, M, A: AppEvent> AnchorPlacementEnabled for TextBox<F, M, A>
impl<F, M, A: AppEvent> AnchorPlacementEnabled for TextBox<F, M, A>
source§fn place(self) -> PlacedWidget<Self>
fn place(self) -> PlacedWidget<Self>
Enabling method called by the related AnchorPlaced impl
source§impl<F, M, A: AppEvent> Widget<M, A> for TextBox<F, M, A>where
F: Fn(&mut M) -> Option<&mut String>,
impl<F, M, A: AppEvent> Widget<M, A> for TextBox<F, M, A>where F: Fn(&mut M) -> Option<&mut String>,
Auto Trait Implementations§
impl<F, M, A> RefUnwindSafe for TextBox<F, M, A>where A: RefUnwindSafe, F: RefUnwindSafe, M: RefUnwindSafe,
impl<F, M, A> Send for TextBox<F, M, A>where A: Send, F: Send, M: Send,
impl<F, M, A> Sync for TextBox<F, M, A>where A: Sync, F: Sync, M: Sync,
impl<F, M, A> Unpin for TextBox<F, M, A>where F: Unpin, M: Unpin,
impl<F, M, A> UnwindSafe for TextBox<F, M, A>where A: UnwindSafe, F: UnwindSafe, M: UnwindSafe,
Blanket Implementations§
source§impl<T> AnchorPlaced for Twhere
T: AnchorPlacementEnabled,
impl<T> AnchorPlaced for Twhere T: AnchorPlacementEnabled,
type Placed = PlacedWidget<T>
source§fn left(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
fn left(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
how far from the left?
source§fn top(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
fn top(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
how far from the top?
source§fn right(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
fn right(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
how far from the right?
source§fn bottom(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
fn bottom(self, offset: impl Into<Option<u16>>) -> <T as AnchorPlaced>::Placed
how far from the botton?
source§fn fill(self) -> <T as AnchorPlaced>::Placed
fn fill(self) -> <T as AnchorPlaced>::Placed
reset to fill the whole area
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<'a, T, M, A> WidgetExt<M, A> for Twhere
A: AppEvent,
T: Widget<M, A>,
impl<'a, T, M, A> WidgetExt<M, A> for Twhere A: AppEvent, T: Widget<M, A>,
source§fn bind_with(
self,
loader: impl Fn(&mut T, &M) + 'static,
saver: impl Fn(&T, &mut M) + 'static
) -> WidgetBinder<T, M, A>
fn bind_with( self, loader: impl Fn(&mut T, &M) + 'static, saver: impl Fn(&T, &mut M) + 'static ) -> WidgetBinder<T, M, A>
Decorate the given widget with a loader and saver. Read more
fn replace_with( self, loader: impl Fn(T, &M) -> T + 'static ) -> WidgetBinder<T, M, A>where T: Default,
source§fn load_with(
self,
loader: impl Fn(&mut T, &M) + 'static
) -> WidgetBinder<T, M, A>
fn load_with( self, loader: impl Fn(&mut T, &M) + 'static ) -> WidgetBinder<T, M, A>
A variation on
bind_with, only a loader