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

pub struct TextBox {
    pub rect: Cell<Rect>,
    pub bg: Color,
    pub fg: Color,
    pub fg_border: Color,
    pub fg_cursor: Color,
    pub border: Cell<bool>,
    pub border_radius: Cell<u32>,
    pub text: CloneCell<String>,
    pub text_i: Cell<usize>,
    pub text_offset: Cell<Point>,
    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]

Trait Implementations

impl Border for TextBox
[src]

impl Click for TextBox
[src]

impl Enter for TextBox
[src]

impl EventFilter for TextBox
[src]

impl Place for TextBox
[src]

impl Text for TextBox
[src]

impl Widget for TextBox
[src]