Trait droom_ui::control::text::TextAction
[−]
[src]
pub trait TextAction where Self: Element + 'static { fn set_action<F>(&mut self, cb: F) -> Self where F: Callback<(Self, Option<char>, String)> { ... } fn remove_action(&mut self)
-> Option<Box<Callback<(Self, Option<char>, String)>>> { ... } }
Action generated when the text is edited, but before its value is actually changed.
Can be generated when using the keyboard, undo system or from the clipboard.
The following values can be returned from the callback:
+ CallbackReturn::Default
or ()
for the default reaction.
+ CallbackReturn::Close
will be processed, but the change will be ignored.
+ CallbackReturn::Ignore
ignores the new value.
+ An CallbackReturn::Char
, if the received c
is None
or NUL is returned it'll act
just like CallbackReturn::Default
otherwise the returned character will be used
instead of the one sent to the callback.
The VALUE attribute can be changed only if CallbackReturn::Ignore
is returned.
NOTE: The character received and returned must be in the ASCII range of
UTF-8 (0-127). No restriction on the newvalue
string, when the value added to the VALUE
is a non-ASCII character the c
parameter will be None
but the value is still used for
updating the VALUE attribute.
Provided Methods
fn set_action<F>(&mut self, cb: F) -> Self where F: Callback<(Self, Option<char>, String)>
fn remove_action(&mut self)
-> Option<Box<Callback<(Self, Option<char>, String)>>>
-> Option<Box<Callback<(Self, Option<char>, String)>>>
Implementors
impl TextAction for Text