Struct cursive::view::EditView
[−]
[src]
pub struct EditView { // some fields omitted }
Input box where the user can enter and edit text.
Methods
impl EditView
[src]
fn new() -> Self
Creates a new, empty edit view.
fn disable(&mut self)
Disables this view.
A disabled view cannot be selected.
fn disabled(self) -> Self
Disables this view.
Chainable variant.
fn enable(&mut self)
Re-enables this view.
fn set_enabled(&mut self, enabled: bool)
Enable or disable this view.
fn is_enabled(&self) -> bool
Returns true
if this view is enabled.
fn set_content(&mut self, content: &str)
Replace the entire content of the view with the given one.
fn get_content(&self) -> &str
Get the current text.
fn content(self, content: &str) -> Self
Sets the current content to the given value.
Convenient chainable method.
fn min_length(self, min_length: usize) -> Self
Sets the minimum length for this view. (This applies to the layout, not the content.)
fn with_id(self, label: &str) -> IdView<Self>
Wraps this view into an IdView with the given id.
Trait Implementations
impl Default for EditView
[src]
impl View for EditView
[src]
fn draw(&self, printer: &Printer)
Draws the view with the given printer (includes bounds) and focus.
fn layout(&mut self, size: Vec2)
Called once the size for this view has been decided, Read more
fn get_min_size(&mut self, _: Vec2) -> Vec2
Returns the minimum size the view requires with the given restrictions. Read more
fn take_focus(&mut self, _: Direction) -> bool
This view is offered focus. Will it take it? Read more
fn on_event(&mut self, event: Event) -> EventResult
Called when a key was pressed. Default implementation just ignores it.
fn needs_relayout(&self) -> bool
Returns true
if the view content changed since last layout phase. Read more
fn find(&mut self, &Selector) -> Option<&mut Any>
Finds the view pointed to by the given path. Read more