Struct pixel_widgets::widget::input::Input [−][src]
pub struct Input<'a, T, F, S> { /* fields omitted */ }Expand description
Editable text input
Implementations
impl<'a, T, F, S> Input<'a, T, F, S> where
T: 'a + Send,
F: 'a + Send + Fn(String) -> T,
S: 'a + Send + AsRef<str>, [src]
impl<'a, T, F, S> Input<'a, T, F, S> where
T: 'a + Send,
F: 'a + Send + Fn(String) -> T,
S: 'a + Send + AsRef<str>, [src]pub fn new(
state: &'a mut State,
placeholder: &'a str,
value: S,
on_change: F
) -> Self[src]
pub fn new(
state: &'a mut State,
placeholder: &'a str,
value: S,
on_change: F
) -> Self[src]Construct a new Input
pub fn password(
state: &'a mut State,
placeholder: &'a str,
value: S,
on_change: F
) -> Self[src]
pub fn password(
state: &'a mut State,
placeholder: &'a str,
value: S,
on_change: F
) -> Self[src]Construct a new Input that renders the text as dots, for passwords.
pub fn with_on_submit(self, message: T) -> Self[src]
pub fn with_on_submit(self, message: T) -> Self[src]Sets the message to post when the users submits using the enter key
pub fn with_trigger_key(self, key: Key) -> Self[src]
pub fn with_trigger_key(self, key: Key) -> Self[src]Sets a key that will trigger input focus
Trait Implementations
impl<'a, T, F, S> IntoNode<'a, T> for Input<'a, T, F, S> where
T: 'a + Send,
F: 'a + Send + Fn(String) -> T,
S: 'a + Send + AsRef<str>, [src]
impl<'a, T, F, S> IntoNode<'a, T> for Input<'a, T, F, S> where
T: 'a + Send,
F: 'a + Send + Fn(String) -> T,
S: 'a + Send + AsRef<str>, [src]impl<'a, T, F, S> Widget<'a, T> for Input<'a, T, F, S> where
T: 'a + Send,
F: 'a + Send + Fn(String) -> T,
S: 'a + Send + AsRef<str>, [src]
impl<'a, T, F, S> Widget<'a, T> for Input<'a, T, F, S> where
T: 'a + Send,
F: 'a + Send + Fn(String) -> T,
S: 'a + Send + AsRef<str>, [src]fn widget(&self) -> &'static str[src]
fn widget(&self) -> &'static str[src]The name of this widget, used to identify widgets of this type in stylesheets.
fn len(&self) -> usize[src]
fn len(&self) -> usize[src]Should return the amount of children this widget has. Must be consistent with
visit_children(). Read more
fn visit_children(&mut self, _: &mut dyn FnMut(&mut Node<'a, T>))[src]
fn visit_children(&mut self, _: &mut dyn FnMut(&mut Node<'a, T>))[src]fn event(
&mut self,
layout: Rectangle,
clip: Rectangle,
stylesheet: &Stylesheet,
event: Event,
context: &mut Context<T>
)[src]
fn event(
&mut self,
layout: Rectangle,
clip: Rectangle,
stylesheet: &Stylesheet,
event: Event,
context: &mut Context<T>
)[src]fn draw(
&mut self,
layout: Rectangle,
clip: Rectangle,
stylesheet: &Stylesheet
) -> Vec<Primitive<'a>>[src]
fn draw(
&mut self,
layout: Rectangle,
clip: Rectangle,
stylesheet: &Stylesheet
) -> Vec<Primitive<'a>>[src]Draw the widget. Returns a list of Primitives that should be drawn. Read more
fn state(&self) -> StateVec[src]
fn state(&self) -> StateVec[src]The state of this widget, used for computing the style.
If None is returned, Node will automatically compute a state, such as “hover” and “pressed”. Read more
fn is_empty(&self) -> bool[src]
fn is_empty(&self) -> bool[src]Returns whether this children has no children. Must be consistent with
visit_children(). Read more
fn hit(
&self,
layout: Rectangle,
clip: Rectangle,
_style: &Stylesheet,
x: f32,
y: f32
) -> bool[src]
fn hit(
&self,
layout: Rectangle,
clip: Rectangle,
_style: &Stylesheet,
x: f32,
y: f32
) -> bool[src]fn focused(&self) -> bool[src]
fn focused(&self) -> bool[src]Test the widget for focus exclusivity.
If the widget or one of it’s descendants is in an exclusive focus state, this function should return true.
In all other cases, it should return false. When a widget is in an exclusive focus state it is
the only widget that is allowed to receive events in event.
Widgets that intended to use this behaviour are modal dialogs, dropdown boxes, context menu’s, etc. Read more
fn node_event(
&mut self,
_layout: Rectangle,
_style: &Stylesheet,
_event: NodeEvent,
_context: &mut Context<Message>
)[src]
fn node_event(
&mut self,
_layout: Rectangle,
_style: &Stylesheet,
_event: NodeEvent,
_context: &mut Context<Message>
)[src]Auto Trait Implementations
impl<'a, T, F, S> RefUnwindSafe for Input<'a, T, F, S> where
F: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
F: RefUnwindSafe,
S: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T, F, S> Send for Input<'a, T, F, S> where
F: Send,
S: Send,
T: Send,
F: Send,
S: Send,
T: Send,
impl<'a, T, F, S> Sync for Input<'a, T, F, S> where
F: Sync,
S: Sync,
T: Sync,
F: Sync,
S: Sync,
T: Sync,
impl<'a, T, F, S> Unpin for Input<'a, T, F, S> where
F: Unpin,
S: Unpin,
T: Unpin,
F: Unpin,
S: Unpin,
T: Unpin,
impl<'a, T, F, S> !UnwindSafe for Input<'a, T, F, S>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for Timpl<T> Any for T where
T: Any,
T: Any,