Struct fyrox_ui::text_box::TextBox

source ·
pub struct TextBox {
Show 17 fields pub widget: Widget, pub caret_position: Position, pub caret_visible: bool, pub blink_timer: f32, pub blink_interval: f32, pub formatted_text: RefCell<FormattedText>, pub selection_range: Option<SelectionRange>, pub selecting: bool, pub has_focus: bool, pub caret_brush: Brush, pub selection_brush: Brush, pub filter: Option<Rc<RefCell<FilterCallback>>>, pub commit_mode: TextCommitMode, pub multiline: bool, pub editable: bool, pub view_position: Vector2<f32>, pub skip_chars: Vec<u32>,
}

Fields§

§widget: Widget§caret_position: Position§caret_visible: bool§blink_timer: f32§blink_interval: f32§formatted_text: RefCell<FormattedText>§selection_range: Option<SelectionRange>§selecting: bool§has_focus: bool§caret_brush: Brush§selection_brush: Brush§filter: Option<Rc<RefCell<FilterCallback>>>§commit_mode: TextCommitMode§multiline: bool§editable: bool§view_position: Vector2<f32>§skip_chars: Vec<u32>

Implementations§

Maps input Position to a linear position in character array. Output index can be equal to length of text, this means that position is at the end of the text. You should check the index before trying to use it to fetch data from inner array of characters.

Maps input Position to a linear position in character array. Output index will always be valid for fetching, if the method returned Some(index). The index however cannot be used for text insertion, because it cannot point to a “place after last char”.

Methods from Deref<Target = Widget>§

Returns size of the widget without any layout or rendering transform applied.

Searches a node up on tree starting from given root that matches a criteria defined by a given func.

The context menu receives PopupMessages for being displayed, and so should support those.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Allows a widget to provide access to inner components. For example you can build your custom MyTree widget using engine’s Tree widget as a base. The engine needs to know whether the custom widget is actually extends functionality of some existing widget. Read more
Performs event-specific actions. Must call widget.handle_message()! Read more
Used to react to a message (by producing another message) that was posted outside of current hierarchy. In other words this method is used when you need to “peek” a message before it’ll be passed into bubbling router. Most common use case is to catch messages from popups: popup in 99.9% cases is a child of root canvas and it won’t receive a message from a its logical parent during bubbling message routing. For example preview_message used in a dropdown list: dropdown list has two separate parts - a field with selected value and a popup for all possible options. Visual parent of the popup in this case is the root canvas, but logical parent is the dropdown list. Because of this fact, the field won’t receive any messages from popup, to solve this we use preview_message. This method is much more restrictive - it does not allow you to modify a node and ui, you can either request changes by sending a message or use internal mutability (Cell, RefCell, etc). Read more
Provides a way to respond to OS specific events. Can be useful to detect if a key or mouse button was pressed. This method significantly differs from handle_message because os events are not dispatched - they’ll be passed to this method in any case. Read more
Formats the value using the given formatter. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Casts self to a &dyn Any

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.