pub struct Form<'a, W>{ /* private fields */ }Expand description
Renders other widgets using a GenericLayout. It doesn’t scroll, instead it uses pages.
Form is the first stage and defines the layout and styling.
At the end call into_buffer to create the
FormBuffer that allows you to render your widgets.
Implementations§
Source§impl<'a, W> Form<'a, W>
impl<'a, W> Form<'a, W>
Sourcepub fn layout(self, layout: GenericLayout<W>) -> Self
pub fn layout(self, layout: GenericLayout<W>) -> Self
Set the layout. If no layout is set here the layout is taken from the state.
Sourcepub fn auto_label(self, auto: bool) -> Self
pub fn auto_label(self, auto: bool) -> Self
Render the label automatically when rendering the widget.
Default: true
Style for navigation.
Show navigation?
Sourcepub fn title_style(self, title_style: Style) -> Self
pub fn title_style(self, title_style: Style) -> Self
Style for the title.
pub fn next_page_mark(self, txt: &'a str) -> Self
pub fn prev_page_mark(self, txt: &'a str) -> Self
pub fn first_page_mark(self, txt: &'a str) -> Self
pub fn last_page_mark(self, txt: &'a str) -> Self
Sourcepub fn label_style(self, style: Style) -> Self
pub fn label_style(self, style: Style) -> Self
Style for auto-labels.
Sourcepub fn label_alignment(self, alignment: Alignment) -> Self
pub fn label_alignment(self, alignment: Alignment) -> Self
Alignment for auto-labels.
Sourcepub fn layout_size(&self, area: Rect) -> Size
pub fn layout_size(&self, area: Rect) -> Size
Calculate the layout page size.
pub fn layout_area(&self, area: Rect) -> Rect
Sourcepub fn into_buffer<'b, 's>(
self,
area: Rect,
buf: &'b mut Buffer,
state: &'s mut FormState<W>,
) -> FormBuffer<'b, W>
pub fn into_buffer<'b, 's>( self, area: Rect, buf: &'b mut Buffer, state: &'s mut FormState<W>, ) -> FormBuffer<'b, W>
Render the page navigation and create the FormBuffer that will do the actual rendering.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W> Freeze for Form<'a, W>
impl<'a, W> RefUnwindSafe for Form<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for Form<'a, W>where
W: Send,
impl<'a, W> Sync for Form<'a, W>where
W: Sync,
impl<'a, W> Unpin for Form<'a, W>where
W: Unpin,
impl<'a, W> UnwindSafe for Form<'a, W>where
W: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more