Struct components::elements::TextFieldElement
source · [−]pub struct TextFieldElement {
pub label: LabelElement,
pub filter: Option<Box<dyn Fn(String, String, String) -> bool>>,
pub onchangeindex: Signal<i32>,
pub onchange: Signal<TextEditChangeEvent>,
pub oncommit: Signal<TextEditCommitEvent>,
pub renderer: Option<Rc<WidgetRenderHolder<Self>>>,
pub node: Node,
/* private fields */
}
Expand description
A simple text edit control Additional Signals: none
Fields
label: LabelElement
filter: Option<Box<dyn Fn(String, String, String) -> bool>>
onchangeindex: Signal<i32>
Emitted whenever the index is changed.
onchange: Signal<TextEditChangeEvent>
Emitted whenever the text or display text is changed.
text:String, display_text:String, from_typing: bool
oncommit: Signal<TextEditCommitEvent>
Emitted whenever the return key is pressed.
text:String, display_text:String
renderer: Option<Rc<WidgetRenderHolder<Self>>>
node: Node
Implementations
sourceimpl TextFieldElement
impl TextFieldElement
pub fn new(widget: &TextField) -> Self
pub fn index(&self) -> i32
pub fn text(&self) -> String
pub fn display_text(&self) -> String
pub fn display_char(&self) -> Option<char>
pub fn set_text(&self, value: String)
pub fn set_display_char(&mut self, value: Option<char>)
pub fn move_cursor(&self, amount: i32)
pub fn cut(&self, start: usize, count: usize) -> String
pub fn after(&self, cur: usize) -> String
pub fn before(&self, cur: usize) -> String
pub fn after_display(&self, cur: usize) -> String
pub fn before_display(&self, cur: usize) -> String
pub fn update_cur(&self)
Trait Implementations
sourceimpl AsRef<RefCell<WidgetComponent>> for TextFieldElement
impl AsRef<RefCell<WidgetComponent>> for TextFieldElement
sourcefn as_ref(&self) -> &RefCell<WidgetComponent>
fn as_ref(&self) -> &RefCell<WidgetComponent>
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Debug for TextFieldElement
impl Debug for TextFieldElement
sourceimpl Element for TextFieldElement
impl Element for TextFieldElement
fn destroy(&self)
fn mousedown(&self, event: &mut MouseEvent)
fn unfocus(&self)
fn textinput(&self, event: &mut TextEvent)
fn keydown(&self, event: &mut KeyEvent)
fn node(&self) -> Option<Node>
fn relayout(&self, origin: Point2<f32>)
fn children_at_point(
&self,
x: f32,
y: f32,
into: Option<Vec<WidgetComponent>>
) -> Vec<WidgetComponent>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
fn topmost_child_at_point(&self, x: f32, y: f32) -> Option<&Box<dyn Element>>
fn contains(&self, x: f32, y: f32) -> bool
fn onclipchanged(&self)
fn set_visible_only(&self, visible: bool)
sourcefn set_visible(&self, visible: bool)
fn set_visible(&self, visible: bool)
If the control is visible
fn find_top_parent(
&self,
from: Option<&WidgetComponent>
) -> Option<WidgetComponent>
fn add(&self, child: &dyn Element)
sourcefn remove(&self, child: Id)
fn remove(&self, child: Id)
The child must be sure that his parent reference is correct. The child must remove the parent reference by himself: child.set_parent(None); Read more
fn children_bounds(&self) -> ChildBounds
fn render(&self)
fn keyup(&self, e: &mut KeyEvent)
fn mousemove(&self, e: &mut MouseEvent)
fn mouseup(&self, e: &mut MouseEvent)
fn mousewheel(&self, e: &mut MouseEvent)
fn mouseenter(&self, e: &mut MouseEvent)
fn mouseleave(&self, e: &mut MouseEvent)
fn destroy_children(&self)
fn update(&self, dt: f32)
fn focus(&self)
fn capture(&self)
fn uncapture(&self)
fn mark(&self)
fn unmark(&self)
fn refresh_bounds(&self)
fn bounds_changed(&self, dx: f32, dy: f32, dw: f32, dh: f32)
fn set_pos(&self, x: f32, y: f32)
fn set_size(&self, w: f32, h: f32)
fn destroyed(&self) -> bool
fn right(&self) -> f32
fn bottom(&self) -> f32
sourcefn set_x_local(&self, x: f32)
fn set_x_local(&self, x: f32)
The x position of the control bounds, relative to its container
sourcefn set_y_local(&self, y: f32)
fn set_y_local(&self, y: f32)
The y position of the control bounds, relative to its container
fn nodes(&self) -> i32
fn is_focused(&self) -> bool
fn set_focused(&self, focused: bool)
fn is_captured(&self) -> bool
fn set_captured(&self, captured: bool)
fn is_marked(&self) -> bool
fn set_marked(&self, marked: bool)
fn depth_offset(&self) -> f32
fn depth(&self) -> f32
fn set_depth(&self, depth: f32)
fn mouse_input(&self) -> bool
fn key_input(&self) -> bool
fn parent(&self) -> Option<&dyn Element>
fn set_parent(&self, p: Option<Id>)
fn id(&self) -> Id
Auto Trait Implementations
impl !RefUnwindSafe for TextFieldElement
impl !Send for TextFieldElement
impl !Sync for TextFieldElement
impl Unpin for TextFieldElement
impl !UnwindSafe for TextFieldElement
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<'a, T, C, M> Inspect<'a, C, &'a mut C, M> for T
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
impl<Fr, To> IntoColor<To> for Fr where
To: FromColor<Fr>,
fn into_color(self) -> To
fn into_color(self) -> To
Convert into color
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> SetParameter for T
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
Sets value
as a parameter of self
.