Struct orbtk::widgets::TextBox [] [src]

pub struct TextBox {
    pub rect: Cell<Rect>,
    pub selector: CloneCell<Selector>,
    pub text: CloneCell<String>,
    pub text_i: Cell<usize>,
    pub text_offset: Cell<Point>,
    pub scroll_offset: Cell<(i32, i32)>,
    pub mask_char: Cell<Option<char>>,
    pub grab_focus: Cell<bool>,
    pub click_callback: RefCell<Option<Arc<Fn(&TextBox, Point)>>>,
    pub enter_callback: RefCell<Option<Arc<Fn(&TextBox)>>>,
    pub event_filter: RefCell<Option<Arc<Fn(&TextBox, Event, &mut bool, &mut bool) -> Option<Event>>>>,
    // some fields omitted
}

Fields

If event_filter is defined, all of the events will go trough it Instead of the default behavior. This allows defining fields that ex. will only accept numbers and ignore all else, or add some special behavior for some keys.

The closure should return None if the event was manually handled, or should return the event it received if it wants the default handler deal with it.

Methods

impl TextBox
[src]

[src]

[src]

[src]

Trait Implementations

impl Click for TextBox
[src]

[src]

[src]

impl Enter for TextBox
[src]

[src]

[src]

impl EventFilter for TextBox
[src]

[src]

[src]

impl Place for TextBox
[src]

[src]

[src]

[src]

impl Text for TextBox
[src]

[src]

[src]

impl Style for TextBox
[src]

[src]

[src]

[src]

[src]

[src]

impl Widget for TextBox
[src]

[src]

Return the name of the widget.

[src]

Borrow the render rect of the widget.

[src]

Borrow the local position of the widget. The local position describes position of the widget relative to it's parent.

[src]

Borrow the vertical placement of the widget.

[src]

Borrow the horizontal placement of the widget.

[src]

Borrow the margin of the widget.

[src]

Used to draw the widget by render code.

[src]

Handle the incoming events by bubbling from child to parent. Must have overwritten to create a custom bubbling event handling. Read more

[src]

Borrow the children of the widget.

[src]

Handle the incoming events by tunneling from parent to child. Must have overwritten to create a custom tunneling event handling. Read more

[src]

Add a child to the widget.

[src]

Used to update the state of the widget. Could be used to update the selector.

[src]

Arrange the children of the widget. Could be override to create a custom layout.