[][src]Struct kas::widget::EditBox

pub struct EditBox<G: 'static> {
    pub guard: G,
    // some fields omitted
}

An editable, single-line text box.

Fields

guard: G

The associated EditGuard implementation

Methods

impl EditBox<EditVoid>[src]

pub fn new<S: Into<String>>(text: S) -> Self[src]

Construct an EditBox with the given inital text.

pub fn with_guard<G>(self, guard: G) -> EditBox<G>[src]

Set an EditGuard

Technically, this consumes self and reconstructs another EditBox with a different parameterisation.

pub fn on_activate<F: Fn(&str) -> Option<M>, M>(
    self,
    f: F
) -> EditBox<EditActivate<F, M>>
[src]

Set a guard function, called on activation

The closure f is called when the EditBox is activated (when the "enter" key is pressed). Its result, if not None, is the event handler's response.

This method is a parametisation of EditBox::with_guard. Any guard previously assigned to the EditBox will be replaced.

pub fn on_afl<F: Fn(&str) -> Option<M>, M>(self, f: F) -> EditBox<EditAFL<F, M>>[src]

Set a guard function, called on activation and input-focus lost

The closure f is called when the EditBox is activated (when the "enter" key is pressed) and when keyboard focus is lost. Its result, if not None, is the event handler's response.

This method is a parametisation of EditBox::with_guard. Any guard previously assigned to the EditBox will be replaced.

pub fn on_edit<F: Fn(&str) -> Option<M>, M>(
    self,
    f: F
) -> EditBox<EditEdit<F, M>>
[src]

Set a guard function, called on edit

The closure f is called when the EditBox is edited. Its result, if not None, is the event handler's response.

This method is a parametisation of EditBox::with_guard. Any guard previously assigned to the EditBox will be replaced.

impl<G> EditBox<G>[src]

pub fn editable(self, editable: bool) -> Self[src]

Set whether this EditBox is editable.

pub fn multi_line(self, multi_line: bool) -> Self[src]

Set whether this EditBox shows multiple text lines

pub fn has_error(&self) -> bool[src]

Get whether the input state is erroneous

pub fn set_error_state(&mut self, error_state: bool)[src]

Set the error state

When true, the input field's background is drawn red.

Trait Implementations

impl<G: Clone + 'static> Clone for EditBox<G>[src]

impl<G> Debug for EditBox<G>[src]

impl<G: Default + 'static> Default for EditBox<G>[src]

impl<G> Editable for EditBox<G>[src]

impl<G: EditGuard + 'static> Handler for EditBox<G>[src]

type Msg = G::Msg

Type of message returned by this widget Read more

impl<G> HasText for EditBox<G>[src]

impl<G: 'static> Layout for EditBox<G>[src]

impl<G: 'static> SendEvent for EditBox<G> where
    G: EditGuard
[src]

impl<G: 'static> Widget for EditBox<G> where
    G: EditGuard
[src]

impl<G: 'static> WidgetChildren for EditBox<G>[src]

impl<G: 'static> WidgetConfig for EditBox<G>[src]

impl<G: 'static> WidgetCore for EditBox<G>[src]

Auto Trait Implementations

impl<G> RefUnwindSafe for EditBox<G> where
    G: RefUnwindSafe

impl<G> Send for EditBox<G> where
    G: Send

impl<G> Sync for EditBox<G> where
    G: Sync

impl<G> Unpin for EditBox<G> where
    G: Unpin

impl<G> UnwindSafe for EditBox<G> where
    G: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src where
    Scheme: ApproxScheme
[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src where
    Dst: ApproxFrom<Src, Scheme>,
    Scheme: ApproxScheme
[src]

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, Dst> ConvAsUtil<Dst> for T[src]

impl<T> ConvUtil for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<Src> TryFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<Src, Dst> TryInto<Dst> for Src where
    Dst: TryFrom<Src>, 
[src]

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Src> ValueFrom<Src> for Src[src]

type Err = NoError

The error type produced by a failed conversion.

impl<Src, Dst> ValueInto<Dst> for Src where
    Dst: ValueFrom<Src>, 
[src]

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.