pub struct TextBox<'a> { /* private fields */ }
Expand description
A widget for displaying and mutating a small, one-line field of text, given by the user in the
form of a String
.
It’s reaction is triggered upon pressing of the Enter
/Return
key.
Implementations§
Source§impl<'a> TextBox<'a>
impl<'a> TextBox<'a>
Sourcepub fn left_justify(self) -> Self
pub fn left_justify(self) -> Self
Align the text to the left of its bounding Rect’s x axis range.
Sourcepub fn center_justify(self) -> Self
pub fn center_justify(self) -> Self
Align the text to the middle of its bounding Rect’s x axis range.
Sourcepub fn right_justify(self) -> Self
pub fn right_justify(self) -> Self
Align the text to the right of its bounding Rect’s x axis range.
Sourcepub fn text_color(self, text_color: Color) -> Self
pub fn text_color(self, text_color: Color) -> Self
Build the type’s self.$($assignee).+ with the given $Type.
Sourcepub fn font_size(self, font_size: FontSize) -> Self
pub fn font_size(self, font_size: FontSize) -> Self
Build the type’s self.$($assignee).+ with the given $Type.
Trait Implementations§
Source§impl<'a> Borderable for TextBox<'a>
impl<'a> Borderable for TextBox<'a>
Source§fn border(self, border: Scalar) -> Self
fn border(self, border: Scalar) -> Self
Build the type’s self.$($assignee).+ with the given $Type.
Source§fn border_color(self, border_color: Color) -> Self
fn border_color(self, border_color: Color) -> Self
Build the type’s self.$($assignee).+ with the given $Type.
Source§fn border_rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self
fn border_rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self
Source§fn border_rgb(self, r: f32, g: f32, b: f32) -> Self
fn border_rgb(self, r: f32, g: f32, b: f32) -> Self
Source§impl<'a> Colorable for TextBox<'a>
impl<'a> Colorable for TextBox<'a>
Source§fn color(self, color: Color) -> Self
fn color(self, color: Color) -> Self
Build the type’s self.$($assignee).+ with the given $Type.
Source§fn rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self
fn rgba(self, r: f32, g: f32, b: f32, a: f32) -> Self
Source§impl<'a> Common for TextBox<'a>
impl<'a> Common for TextBox<'a>
Source§fn common(&self) -> &CommonBuilder
fn common(&self) -> &CommonBuilder
CommonBuilder
field.Source§fn common_mut(&mut self) -> &mut CommonBuilder
fn common_mut(&mut self) -> &mut CommonBuilder
CommonBuilder
field.Source§impl<'a> Widget for TextBox<'a>
impl<'a> Widget for TextBox<'a>
Source§fn update(self, args: UpdateArgs<'_, '_, '_, '_, Self>) -> Self::Event
fn update(self, args: UpdateArgs<'_, '_, '_, '_, Self>) -> Self::Event
Update the state of the TextEdit.
Source§type Style = Style
type Style = Style
Style
type. This type is intended to
contain high-level styling information for the widget that can be optionally specified by
a user of the widget. Read moreSource§type Event = Vec<Event>
type Event = Vec<Event>
Widget::set
function. Read moreSource§fn init_state(&self, id_gen: Generator<'_>) -> Self::State
fn init_state(&self, id_gen: Generator<'_>) -> Self::State
Source§fn default_x_position(&self, ui: &Ui) -> Position
fn default_x_position(&self, ui: &Ui) -> Position
Source§fn default_y_position(&self, ui: &Ui) -> Position
fn default_y_position(&self, ui: &Ui) -> Position
Source§fn default_x_dimension(&self, ui: &Ui) -> Dimension
fn default_x_dimension(&self, ui: &Ui) -> Dimension
Source§fn default_y_dimension(&self, ui: &Ui) -> Dimension
fn default_y_dimension(&self, ui: &Ui) -> Dimension
Source§fn drag_area(
&self,
_dim: Dimensions,
_style: &Self::Style,
_theme: &Theme,
) -> Option<Rect>
fn drag_area( &self, _dim: Dimensions, _style: &Self::Style, _theme: &Theme, ) -> Option<Rect>
Source§fn kid_area(&self, args: KidAreaArgs<'_, Self>) -> KidArea
fn kid_area(&self, args: KidAreaArgs<'_, Self>) -> KidArea
Place
Position
methods.Source§fn parent(self, parent_id: Id) -> Self
fn parent(self, parent_id: Id) -> Self
Source§fn place_on_kid_area(self, b: bool) -> Self
fn place_on_kid_area(self, b: bool) -> Self
Source§fn graphics_for(self, id: Id) -> Self
fn graphics_for(self, id: Id) -> Self
Source§fn floating(self, is_floating: bool) -> Self
fn floating(self, is_floating: bool) -> Self
false
).
A typical example of a floating widget would be a pop-up or alert window. Read moreSource§fn crop_kids(self) -> Self
fn crop_kids(self) -> Self
kid_area
of this widget.Source§fn scroll_kids(self) -> Self
fn scroll_kids(self) -> Self
KidArea
scrollable. Read moreSource§fn scroll_kids_vertically(self) -> Self
fn scroll_kids_vertically(self) -> Self
KidArea
scrollable. Read moreSource§fn scroll_kids_horizontally(self) -> Self
fn scroll_kids_horizontally(self) -> Self
KidArea
is scrollable (the default is false). Read moreSource§fn and<F>(self, build: F) -> Selfwhere
F: FnOnce(Self) -> Self,
fn and<F>(self, build: F) -> Selfwhere
F: FnOnce(Self) -> Self,
build
function. Read moreSource§fn and_mut<F>(self, mutate: F) -> Selfwhere
F: FnOnce(&mut Self),
fn and_mut<F>(self, mutate: F) -> Selfwhere
F: FnOnce(&mut Self),
mutate
function. Read moreSource§fn and_if<F>(self, cond: bool, build: F) -> Selfwhere
F: FnOnce(Self) -> Self,
fn and_if<F>(self, cond: bool, build: F) -> Selfwhere
F: FnOnce(Self) -> Self,
build
function. Read moreAuto Trait Implementations§
impl<'a> Freeze for TextBox<'a>
impl<'a> RefUnwindSafe for TextBox<'a>
impl<'a> Send for TextBox<'a>
impl<'a> Sync for TextBox<'a>
impl<'a> Unpin for TextBox<'a>
impl<'a> UnwindSafe for TextBox<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<W> Positionable for Wwhere
W: Widget,
impl<W> Positionable for Wwhere
W: Widget,
Source§fn x_position(self, x: Position) -> W
fn x_position(self, x: Position) -> W
Source§fn y_position(self, y: Position) -> W
fn y_position(self, y: Position) -> W
Source§fn get_x_position(&self, ui: &Ui) -> Position
fn get_x_position(&self, ui: &Ui) -> Position
Source§fn get_y_position(&self, ui: &Ui) -> Position
fn get_y_position(&self, ui: &Ui) -> Position
Source§fn depth(self, depth: f32) -> W
fn depth(self, depth: f32) -> W
Source§fn x_position_relative(self, x: Relative) -> Self
fn x_position_relative(self, x: Relative) -> Self
Source§fn y_position_relative(self, y: Relative) -> Self
fn y_position_relative(self, y: Relative) -> Self
Source§fn x_y_position_relative(self, x: Relative, y: Relative) -> Self
fn x_y_position_relative(self, x: Relative, y: Relative) -> Self
Source§fn x_position_relative_to(self, other: Id, x: Relative) -> Self
fn x_position_relative_to(self, other: Id, x: Relative) -> Self
Source§fn y_position_relative_to(self, other: Id, y: Relative) -> Self
fn y_position_relative_to(self, other: Id, y: Relative) -> Self
Source§fn x_y_position_relative_to(self, other: Id, x: Relative, y: Relative) -> Self
fn x_y_position_relative_to(self, other: Id, x: Relative, y: Relative) -> Self
Source§fn x_relative(self, x: Scalar) -> Self
fn x_relative(self, x: Scalar) -> Self
Source§fn y_relative(self, y: Scalar) -> Self
fn y_relative(self, y: Scalar) -> Self
Source§fn xy_relative(self, point: Point) -> Self
fn xy_relative(self, point: Point) -> Self
Source§fn x_y_relative(self, x: Scalar, y: Scalar) -> Self
fn x_y_relative(self, x: Scalar, y: Scalar) -> Self
Source§fn x_relative_to(self, other: Id, x: Scalar) -> Self
fn x_relative_to(self, other: Id, x: Scalar) -> Self
Source§fn y_relative_to(self, other: Id, y: Scalar) -> Self
fn y_relative_to(self, other: Id, y: Scalar) -> Self
Source§fn xy_relative_to(self, other: Id, xy: Point) -> Self
fn xy_relative_to(self, other: Id, xy: Point) -> Self
Source§fn x_y_relative_to(self, other: Id, x: Scalar, y: Scalar) -> Self
fn x_y_relative_to(self, other: Id, x: Scalar, y: Scalar) -> Self
Source§fn x_direction(self, direction: Direction, x: Scalar) -> Self
fn x_direction(self, direction: Direction, x: Scalar) -> Self
Source§fn y_direction(self, direction: Direction, y: Scalar) -> Self
fn y_direction(self, direction: Direction, y: Scalar) -> Self
Source§fn down(self, y: Scalar) -> Self
fn down(self, y: Scalar) -> Self
Source§fn left(self, x: Scalar) -> Self
fn left(self, x: Scalar) -> Self
Source§fn right(self, x: Scalar) -> Self
fn right(self, x: Scalar) -> Self
Source§fn x_direction_from(self, other: Id, direction: Direction, x: Scalar) -> Self
fn x_direction_from(self, other: Id, direction: Direction, x: Scalar) -> Self
Source§fn y_direction_from(self, other: Id, direction: Direction, y: Scalar) -> Self
fn y_direction_from(self, other: Id, direction: Direction, y: Scalar) -> Self
Source§fn down_from(self, other: Id, y: Scalar) -> Self
fn down_from(self, other: Id, y: Scalar) -> Self
Source§fn up_from(self, other: Id, y: Scalar) -> Self
fn up_from(self, other: Id, y: Scalar) -> Self
Source§fn left_from(self, other: Id, x: Scalar) -> Self
fn left_from(self, other: Id, x: Scalar) -> Self
Source§fn right_from(self, other: Id, x: Scalar) -> Self
fn right_from(self, other: Id, x: Scalar) -> Self
Source§fn align_left(self) -> Self
fn align_left(self) -> Self
Direction
s).Source§fn align_middle_x(self) -> Self
fn align_middle_x(self) -> Self
Direction
s).Source§fn align_right(self) -> Self
fn align_right(self) -> Self
Direction
s).Source§fn align_top(self) -> Self
fn align_top(self) -> Self
Direction
s).Source§fn align_middle_y(self) -> Self
fn align_middle_y(self) -> Self
Direction
s).Source§fn align_bottom(self) -> Self
fn align_bottom(self) -> Self
Direction
s).Source§fn x_align_to(self, other: Id, align: Align) -> Self
fn x_align_to(self, other: Id, align: Align) -> Self
Source§fn y_align_to(self, other: Id, align: Align) -> Self
fn y_align_to(self, other: Id, align: Align) -> Self
Source§fn align_left_of(self, other: Id) -> Self
fn align_left_of(self, other: Id) -> Self
Direction
s).Source§fn align_middle_x_of(self, other: Id) -> Self
fn align_middle_x_of(self, other: Id) -> Self
Direction
s).Source§fn align_right_of(self, other: Id) -> Self
fn align_right_of(self, other: Id) -> Self
Direction
s).Source§fn align_top_of(self, other: Id) -> Self
fn align_top_of(self, other: Id) -> Self
Direction
s).Source§fn align_middle_y_of(self, other: Id) -> Self
fn align_middle_y_of(self, other: Id) -> Self
Direction
s).Source§fn align_bottom_of(self, other: Id) -> Self
fn align_bottom_of(self, other: Id) -> Self
Direction
s).Source§fn x_place_on(self, other: Id, place: Place) -> Self
fn x_place_on(self, other: Id, place: Place) -> Self
other
Widget along the x axis.Source§fn y_place_on(self, other: Id, place: Place) -> Self
fn y_place_on(self, other: Id, place: Place) -> Self
other
Widget along the y axis.Source§fn top_left_of(self, other: Id) -> Self
fn top_left_of(self, other: Id) -> Self
Source§fn top_left_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn top_left_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn top_left_with_margins_on(self, other: Id, top: Scalar, left: Scalar) -> Self
fn top_left_with_margins_on(self, other: Id, top: Scalar, left: Scalar) -> Self
Source§fn top_right_of(self, other: Id) -> Self
fn top_right_of(self, other: Id) -> Self
Source§fn top_right_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn top_right_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn top_right_with_margins_on(
self,
other: Id,
top: Scalar,
right: Scalar,
) -> Self
fn top_right_with_margins_on( self, other: Id, top: Scalar, right: Scalar, ) -> Self
Source§fn bottom_left_of(self, other: Id) -> Self
fn bottom_left_of(self, other: Id) -> Self
Source§fn bottom_left_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn bottom_left_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn bottom_left_with_margins_on(
self,
other: Id,
bottom: Scalar,
left: Scalar,
) -> Self
fn bottom_left_with_margins_on( self, other: Id, bottom: Scalar, left: Scalar, ) -> Self
Source§fn bottom_right_of(self, other: Id) -> Self
fn bottom_right_of(self, other: Id) -> Self
Source§fn bottom_right_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn bottom_right_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn bottom_right_with_margins_on(
self,
other: Id,
bottom: Scalar,
right: Scalar,
) -> Self
fn bottom_right_with_margins_on( self, other: Id, bottom: Scalar, right: Scalar, ) -> Self
Source§fn mid_top_of(self, other: Id) -> Self
fn mid_top_of(self, other: Id) -> Self
Source§fn mid_top_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn mid_top_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn mid_bottom_of(self, other: Id) -> Self
fn mid_bottom_of(self, other: Id) -> Self
Source§fn mid_bottom_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn mid_bottom_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn mid_left_of(self, other: Id) -> Self
fn mid_left_of(self, other: Id) -> Self
Source§fn mid_left_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn mid_left_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn mid_right_of(self, other: Id) -> Self
fn mid_right_of(self, other: Id) -> Self
Source§fn mid_right_with_margin_on(self, other: Id, mgn: Scalar) -> Self
fn mid_right_with_margin_on(self, other: Id, mgn: Scalar) -> Self
Source§fn x_place(self, place: Place) -> Self
fn x_place(self, place: Place) -> Self
Source§fn y_place(self, place: Place) -> Self
fn y_place(self, place: Place) -> Self
Source§fn top_left(self) -> Self
fn top_left(self) -> Self
Source§fn top_left_with_margin(self, mgn: Scalar) -> Self
fn top_left_with_margin(self, mgn: Scalar) -> Self
Source§fn top_left_with_margins(self, top: Scalar, left: Scalar) -> Self
fn top_left_with_margins(self, top: Scalar, left: Scalar) -> Self
Source§fn top_right(self) -> Self
fn top_right(self) -> Self
Source§fn top_right_with_margin(self, mgn: Scalar) -> Self
fn top_right_with_margin(self, mgn: Scalar) -> Self
Source§fn top_right_with_margins(self, top: Scalar, right: Scalar) -> Self
fn top_right_with_margins(self, top: Scalar, right: Scalar) -> Self
Source§fn bottom_left(self) -> Self
fn bottom_left(self) -> Self
Source§fn bottom_left_with_margin(self, mgn: Scalar) -> Self
fn bottom_left_with_margin(self, mgn: Scalar) -> Self
Source§fn bottom_left_with_margins(self, bottom: Scalar, left: Scalar) -> Self
fn bottom_left_with_margins(self, bottom: Scalar, left: Scalar) -> Self
Source§fn bottom_right(self) -> Self
fn bottom_right(self) -> Self
Source§fn bottom_right_with_margin(self, mgn: Scalar) -> Self
fn bottom_right_with_margin(self, mgn: Scalar) -> Self
Source§fn bottom_right_with_margins(self, bottom: Scalar, right: Scalar) -> Self
fn bottom_right_with_margins(self, bottom: Scalar, right: Scalar) -> Self
Source§fn mid_top(self) -> Self
fn mid_top(self) -> Self
Source§fn mid_top_with_margin(self, mgn: Scalar) -> Self
fn mid_top_with_margin(self, mgn: Scalar) -> Self
Source§fn mid_bottom(self) -> Self
fn mid_bottom(self) -> Self
Source§fn mid_bottom_with_margin(self, mgn: Scalar) -> Self
fn mid_bottom_with_margin(self, mgn: Scalar) -> Self
Source§fn mid_left(self) -> Self
fn mid_left(self) -> Self
Source§fn mid_left_with_margin(self, mgn: Scalar) -> Self
fn mid_left_with_margin(self, mgn: Scalar) -> Self
Source§fn mid_right(self) -> Self
fn mid_right(self) -> Self
Source§fn mid_right_with_margin(self, mgn: Scalar) -> Self
fn mid_right_with_margin(self, mgn: Scalar) -> Self
Source§impl<W> Sizeable for Wwhere
W: Widget,
impl<W> Sizeable for Wwhere
W: Widget,
Source§fn get_x_dimension(&self, ui: &Ui) -> Dimension
fn get_x_dimension(&self, ui: &Ui) -> Dimension
We attempt to retrieve the x
Dimension for the widget via the following:
- Check for specified value at
maybe_x_dimension
- Otherwise, use the default returned by Widget::default_x_dimension.
Source§fn get_y_dimension(&self, ui: &Ui) -> Dimension
fn get_y_dimension(&self, ui: &Ui) -> Dimension
We attempt to retrieve the y
Dimension for the widget via the following:
- Check for specified value at
maybe_y_dimension
- Otherwise, use the default returned by Widget::default_y_dimension.
Source§fn x_dimension(self, w: Dimension) -> W
fn x_dimension(self, w: Dimension) -> W
Source§fn y_dimension(self, h: Dimension) -> W
fn y_dimension(self, h: Dimension) -> W
Source§fn wh(self, wh: Dimensions) -> Self
fn wh(self, wh: Dimensions) -> Self
Source§fn padded_w_of(self, idx: Id, pad: Scalar) -> Self
fn padded_w_of(self, idx: Id, pad: Scalar) -> Self
Source§fn padded_h_of(self, idx: Id, pad: Scalar) -> Self
fn padded_h_of(self, idx: Id, pad: Scalar) -> Self
Source§fn wh_of(self, idx: Id) -> Self
fn wh_of(self, idx: Id) -> Self
Source§fn padded_wh_of(self, idx: Id, pad: Scalar) -> Self
fn padded_wh_of(self, idx: Id, pad: Scalar) -> Self
Source§fn kid_area_w_of(self, idx: Id) -> Self
fn kid_area_w_of(self, idx: Id) -> Self
Source§fn padded_kid_area_w_of(self, idx: Id, pad: Scalar) -> Self
fn padded_kid_area_w_of(self, idx: Id, pad: Scalar) -> Self
KidArea
width for the widget at the given index, padded at both ends
by the given scalar.Source§fn kid_area_h_of(self, idx: Id) -> Self
fn kid_area_h_of(self, idx: Id) -> Self
KidArea
height of the widget at the given index.Source§fn padded_kid_area_h_of(self, idx: Id, pad: Scalar) -> Self
fn padded_kid_area_h_of(self, idx: Id, pad: Scalar) -> Self
KidArea
height of the widget at the given index, padded at both
ends by the given scalar.Source§fn kid_area_wh_of(self, idx: Id) -> Self
fn kid_area_wh_of(self, idx: Id) -> Self
KidArea
dimensions of the widget at the given index.Source§fn padded_kid_area_wh_of(self, idx: Id, pad: Scalar) -> Self
fn padded_kid_area_wh_of(self, idx: Id, pad: Scalar) -> Self
KidArea
dimensions of the widget at the given index, padded at
all four edges by the given scalar.