[][src]Trait kas::widget::EditGuard

pub trait EditGuard: Sized {
    type Msg;
    pub fn activate(_: &mut EditBox<Self>) -> Option<Self::Msg> { ... }
pub fn focus_lost(_: &mut EditBox<Self>) -> Option<Self::Msg> { ... }
pub fn edit(_: &mut EditBox<Self>) -> Option<Self::Msg> { ... } }

A guard around an EditBox

When an EditBox receives input, it updates its contents as expected, then invokes a method of EditGuard. This method may update the EditBox and may return a message to be returned by the EditBox's event handler.

All methods on this trait are passed a reference to the EditBox as parameter. The EditGuard's state may be accessed via the EditBox::guard public field.

All methods have a default implementation which does nothing.

Associated Types

Loading content...

Provided methods

pub fn activate(_: &mut EditBox<Self>) -> Option<Self::Msg>[src]

Activation guard

This function is called when the widget is "activated", for example by the Enter/Return key for single-line edit boxes.

Note that activation events cannot edit the contents.

pub fn focus_lost(_: &mut EditBox<Self>) -> Option<Self::Msg>[src]

Focus-lost guard

This function is called when the widget loses keyboard input focus.

pub fn edit(_: &mut EditBox<Self>) -> Option<Self::Msg>[src]

Edit guard

This function is called on any edit of the contents, by the user or programmatically. It is also called when the EditGuard is first set. On programmatic edits and the initial call, the return value of this method is discarded.

Loading content...

Implementors

Loading content...