Struct kiss_ui::text::TextBox [] [src]

pub struct TextBox(_);

A widget that renders user-editable text.

Methods

impl TextBox

fn new() -> TextBox

Create a new, empty text box.

fn set_multiline(self, multiline: bool) -> Self

Set if the text box should accept and render newline characters.

If false, it will only be slightly taller than a line of text in the current font. If true, the total dimensions will be set by set_visible_columns and set_visible_lines. Text outside these bounds will be accessible with a scrollbar.

fn set_visible_columns(self, cols: u32) -> Self

Set the rendered width of the textbox in columns (character width + padding).

If the textbox is set as multiline, this will cause additional text beyond the maximum width to wrap. Otherwise, it can be scrolled only horizontally.

fn set_visible_lines(self, lines: u32) -> Self

Set the rendered height of the textbox in lines (character height + padding).

If the textbox is set as multiline, newline characters will push text following them to the next visible line. Line counts beyond these bounds will cause a scrollbar to be shown.

fn set_text(self, value: &str) -> Self

Set the text of this textbox.

Panics

If any WidgetStr instances from self.get_text() are still reachable.

fn get_text(&self) -> WidgetStr

Get the text value of this textbox.

Trait Implementations

impl Widget for TextBox

fn show(self) -> Self

fn hide(self) -> Self

fn set_visible(self, visible: bool) -> Self

fn set_enabled(self, enabled: bool) -> Self

fn set_position(self, x: i32, y: i32) -> Self

fn get_position(self) -> (i32, i32)

fn set_name(self, name: &str) -> Self

fn get_name(&self) -> Option<WidgetStr>

fn get_sibling(self) -> Option<BaseWidget>

fn get_parent(self) -> Option<BaseWidget>

fn get_dialog(self) -> Option<Dialog>

fn get_size_pixels(self) -> (u32, u32)

fn store<N: Into<String>>(self, name: N) -> Option<BaseWidget>

fn to_base(self) -> BaseWidget

impl Copy for TextBox

impl Clone for TextBox

fn clone(&self) -> Self

fn clone_from(&mut self, source: &Self)

impl Downcast for TextBox

fn can_downcast(base: &BaseWidget) -> bool

fn try_downcast(base: BaseWidget) -> Result<Self, BaseWidget>

impl OnValueChange for TextBox

fn set_on_value_changed<Cb>(self, on_value_changed: Cb) -> Self where Cb: Callback<Self>