[−][src]Struct orbtk::widgets::TextBox
Fields
rect: Cell<Rect>
selector: CloneCell<Selector>
text: CloneCell<String>
text_i: Cell<usize>
text_offset: Cell<Point>
scroll_offset: Cell<(i32, i32)>
mask_char: Cell<Option<char>>
grab_focus: Cell<bool>
click_callback: RefCell<Option<Arc<dyn Fn(&TextBox, Point)>>>
enter_callback: RefCell<Option<Arc<dyn Fn(&TextBox)>>>
event_filter: RefCell<Option<Arc<dyn Fn(&TextBox, Event, &mut bool, &mut bool) -> Option<Event>>>>
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]
pub fn new() -> Arc<Self>
[src]
pub fn grab_focus(&self, grab_focus: bool) -> &Self
[src]
pub fn mask_char(&self, mask_char: Option<char>) -> &Self
[src]
Trait Implementations
impl Click for TextBox
[src]
fn emit_click(&self, point: Point)
[src]
fn on_click<T: Fn(&Self, Point) + 'static>(&self, func: T) -> &Self
[src]
impl Enter for TextBox
[src]
impl EventFilter for TextBox
[src]
fn handle_event(
&self,
event: Event,
focused: &mut bool,
redraw: &mut bool
) -> Option<Event>
[src]
&self,
event: Event,
focused: &mut bool,
redraw: &mut bool
) -> Option<Event>
fn event_filter<T: Fn(&Self, Event, &mut bool, &mut bool) -> Option<Event> + 'static>(
&self,
func: T
) -> &Self
[src]
&self,
func: T
) -> &Self
impl Place for TextBox
[src]
fn position(&self, x: i32, y: i32) -> &Self
[src]
fn size(&self, width: u32, height: u32) -> &Self
[src]
fn placement(
&self,
vertical_placement: VerticalPlacement,
horizontal_placement: HorizontalPlacement
) -> &Self
[src]
&self,
vertical_placement: VerticalPlacement,
horizontal_placement: HorizontalPlacement
) -> &Self
impl Text for TextBox
[src]
fn text<S: Into<String>>(&self, text: S) -> &Self
[src]
fn text_offset(&self, x: i32, y: i32) -> &Self
[src]
impl Style for TextBox
[src]
fn selector(&self) -> &CloneCell<Selector>
[src]
fn with_class<S: Into<String>>(&self, class: S) -> &Self
[src]
fn without_class<S: Into<String>>(&self, class: S) -> &Self
[src]
fn with_pseudo_class<S: Into<String>>(&self, pseudo_class: S) -> &Self
[src]
fn without_pseudo_class<S: Into<String>>(&self, pseudo_class: S) -> &Self
[src]
impl Widget for TextBox
[src]
fn name(&self) -> &str
[src]
fn rect(&self) -> &Cell<Rect>
[src]
fn local_position(&self) -> &Cell<Point>
[src]
fn vertical_placement(&self) -> &Cell<VerticalPlacement>
[src]
fn horizontal_placement(&self) -> &Cell<HorizontalPlacement>
[src]
fn margin(&self) -> &Cell<Thickness>
[src]
fn draw(&self, renderer: &mut dyn Renderer, focused: bool, theme: &Theme)
[src]
fn event(
&self,
event: Event,
focused: bool,
redraw: &mut bool,
caught: &mut bool
) -> bool
[src]
&self,
event: Event,
focused: bool,
redraw: &mut bool,
caught: &mut bool
) -> bool
fn children(&self) -> &RefCell<Vec<Arc<dyn Widget>>>
[src]
fn preview_event(
&self,
_event: Event,
_focused: bool,
_redraw: &mut bool,
_handled: bool
) -> bool
[src]
&self,
_event: Event,
_focused: bool,
_redraw: &mut bool,
_handled: bool
) -> bool
Handle the incoming events by tunneling from parent to child. Must have overwritten to create a custom tunneling event handling. Read more
fn add(&self, widget: Arc<dyn Widget>)
[src]
Add a child to the widget.
fn update(&self)
[src]
Used to update the state of the widget. Could be used to update the selector.
fn arrange(&self)
[src]
Arrange the children of the widget. Could be override to create a custom layout.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.