Trait fltk::prelude::InputExt

source ·
pub unsafe trait InputExt: WidgetExt {
Show 28 methods // Required methods fn value(&self) -> String; fn set_value(&mut self, val: &str); fn maximum_size(&self) -> i32; fn set_maximum_size(&mut self, val: i32); fn position(&self) -> i32; fn set_position(&mut self, val: i32) -> Result<(), FltkError>; fn mark(&self) -> i32; fn set_mark(&mut self, val: i32) -> Result<(), FltkError>; fn replace( &mut self, beg: i32, end: i32, val: &str ) -> Result<(), FltkError>; fn insert(&mut self, txt: &str) -> Result<(), FltkError>; fn append(&mut self, txt: &str) -> Result<(), FltkError>; fn copy(&mut self) -> Result<(), FltkError>; fn undo(&mut self) -> Result<(), FltkError>; fn cut(&mut self) -> Result<(), FltkError>; fn cursor_color(&self) -> Color; fn set_cursor_color(&mut self, color: Color); fn text_font(&self) -> Font; fn set_text_font(&mut self, font: Font); fn text_color(&self) -> Color; fn set_text_color(&mut self, color: Color); fn text_size(&self) -> i32; fn set_text_size(&mut self, sz: i32); fn readonly(&self) -> bool; fn set_readonly(&mut self, val: bool); fn wrap(&self) -> bool; fn set_wrap(&mut self, val: bool); fn set_tab_nav(&mut self, val: bool); fn tab_nav(&self) -> bool;
}
Expand description

Defines the methods implemented by all input and output widgets. More details can be found in the wiki.

Safety

fltk-rs traits depend on some FLTK internal code

Warning

fltk-rs traits are non-exhaustive, to avoid future breakage if you try to implement them manually, use the Deref and DerefMut pattern or the widget_extends! macro

Required Methods§

source

fn value(&self) -> String

Returns the value inside the input/output widget

source

fn set_value(&mut self, val: &str)

Sets the value inside an input/output widget

source

fn maximum_size(&self) -> i32

Returns the maximum size (in bytes) accepted by an input/output widget

source

fn set_maximum_size(&mut self, val: i32)

Sets the maximum size (in bytes) accepted by an input/output widget

source

fn position(&self) -> i32

Returns the index position inside an input/output widget

source

fn set_position(&mut self, val: i32) -> Result<(), FltkError>

Sets the index position inside an input/output widget

Errors

Errors on failure to set the cursor position in the text

source

fn mark(&self) -> i32

Returns the index mark inside an input/output widget

source

fn set_mark(&mut self, val: i32) -> Result<(), FltkError>

Sets the index mark inside an input/output widget

Errors

Errors on failure to set the mark

source

fn replace(&mut self, beg: i32, end: i32, val: &str) -> Result<(), FltkError>

Replace content with a &str

Errors

Errors on failure to replace text

source

fn insert(&mut self, txt: &str) -> Result<(), FltkError>

Insert a &str

Errors

Errors on failure to insert text

source

fn append(&mut self, txt: &str) -> Result<(), FltkError>

Append a &str

Errors

Errors on failure to append text

source

fn copy(&mut self) -> Result<(), FltkError>

Copy the value within the widget

Errors

Errors on failure to copy selection

source

fn undo(&mut self) -> Result<(), FltkError>

Undo changes

Errors

Errors on failure to undo

source

fn cut(&mut self) -> Result<(), FltkError>

Cut the value within the widget

Errors

Errors on failure to cut selection

source

fn cursor_color(&self) -> Color

Return the cursor color

source

fn set_cursor_color(&mut self, color: Color)

Sets the cursor color

source

fn text_font(&self) -> Font

Return the text font

source

fn set_text_font(&mut self, font: Font)

Sets the text font

source

fn text_color(&self) -> Color

Return the text color

source

fn set_text_color(&mut self, color: Color)

Sets the text color

source

fn text_size(&self) -> i32

Return the text size

source

fn set_text_size(&mut self, sz: i32)

Sets the text size

source

fn readonly(&self) -> bool

Returns whether the input/output widget is readonly

source

fn set_readonly(&mut self, val: bool)

Set readonly status of the input/output widget

source

fn wrap(&self) -> bool

Return whether text is wrapped inside an input/output widget

source

fn set_wrap(&mut self, val: bool)

Set whether text is wrapped inside an input/output widget

source

fn set_tab_nav(&mut self, val: bool)

Sets whether tab navigation is enabled, true by default

source

fn tab_nav(&self) -> bool

Returns whether tab navigation is enabled

Implementors§