pub struct Form { /* private fields */ }
Expand description
Normal input form
Implementations§
Source§impl Form
impl Form
Sourcepub fn new(size: impl Into<Pos>) -> Result<Self>
pub fn new(size: impl Into<Pos>) -> Result<Self>
Construct a Form object, given the input dimensions.
Sourcepub fn next_input(&mut self)
pub fn next_input(&mut self)
Move cursor to next input
Sourcepub fn prev_input(&mut self)
pub fn prev_input(&mut self)
Move cursor to previous input
Sourcepub fn current_field(&mut self) -> Option<&mut Input>
pub fn current_field(&mut self) -> Option<&mut Input>
Get input field under cursor
Sourcepub fn add_text(self, pos: impl Into<Pos>, text: impl Into<String>) -> Self
pub fn add_text(self, pos: impl Into<Pos>, text: impl Into<String>) -> Self
Add text label to form at specified position with supplied text
Sourcepub fn add_label(&mut self, label: Label)
pub fn add_label(&mut self, label: Label)
Add a label to the form, label must be created beforehand
Sourcepub fn add_input(&mut self, input: Input)
pub fn add_input(&mut self, input: Input)
Add an input to the form, label must be created beforehand
Sourcepub fn add_select(&mut self, input: String, id: String, value: String)
pub fn add_select(&mut self, input: String, id: String, value: String)
Add select option to an imput field in the form.
Adding an option to a field enables the ‘Select (F4)’ function on the input field. This in effect changes the input field to have SingleSelct behavior. Options will be displayed in the order they are added.
Sourcepub fn place_cursor(self) -> Self
pub fn place_cursor(self) -> Self
Place the cursor on the next available input, or on 0,0 if no inputs are present.
Sourcepub fn get_field_and_data(&self) -> Vec<(&str, &str)>
pub fn get_field_and_data(&self) -> Vec<(&str, &str)>
Return an array of input field name and values
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Form
impl RefUnwindSafe for Form
impl Send for Form
impl Sync for Form
impl Unpin for Form
impl UnwindSafe for Form
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
Mutably borrows from an owned value. Read more