pub struct Form<Msg> { /* private fields */ }Expand description
A column of Fields that share one label layout, with an optional summary of problems
above them.
Enter in a field whose control does not use it (a text input without on_submit) moves
focus to the next field, and from the last field on to whatever follows the form, usually
its submit button. The form does not validate: the application checks its values into
FormErrors, passes each message to its field and, on submit, returns
FormErrors::focus_first.
Style keys: form-summary (bg, padding), form-summary-title (fg, bold),
form-summary-marker and form-summary-item (fg). The summary title is
quvyta.form.summary with n problems; its marker is the error icon.
Implementations§
Source§impl<Msg: 'static> Form<Msg>
impl<Msg: 'static> Form<Msg>
Sourcepub fn label_width(self, cells: u16) -> Self
pub fn label_width(self, cells: u16) -> Self
Puts every field’s label in a column cells wide beside its control while the form is
wide enough; on narrow screens labels move above controls.
Sourcepub fn summary(self, errors: &FormErrors) -> Self
pub fn summary(self, errors: &FormErrors) -> Self
Lists every problem of errors above the fields. Nothing is shown while there are none.
Trait Implementations§
Source§impl<Msg: 'static> Widget<Msg> for Form<Msg>
impl<Msg: 'static> Widget<Msg> for Form<Msg>
Source§fn measure(&self, cx: &mut MeasureCx<'_>, available: Size) -> Size
fn measure(&self, cx: &mut MeasureCx<'_>, available: Size) -> Size
available.Source§fn event(&self, cx: &mut EventCx<'_, Msg>, event: &Event) -> bool
fn event(&self, cx: &mut EventCx<'_, Msg>, event: &Event) -> bool
true when the event was used; unused key and scroll events
bubble to the parent widget.Source§fn children_mut(&mut self) -> &mut [Node<Msg>]
fn children_mut(&mut self) -> &mut [Node<Msg>]
Source§fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
PaintCx::request_overlay. anchor is the area the widget was painted in.Auto Trait Implementations§
impl<Msg> !RefUnwindSafe for Form<Msg>
impl<Msg> !Send for Form<Msg>
impl<Msg> !Sync for Form<Msg>
impl<Msg> !UnwindSafe for Form<Msg>
impl<Msg> Freeze for Form<Msg>
impl<Msg> Unpin for Form<Msg>
impl<Msg> UnsafeUnpin for Form<Msg>
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
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> ⓘ
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> ⓘ
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