pub struct CheckboxState {
pub area: Rect,
pub inner: Rect,
pub check_area: Rect,
pub text_area: Rect,
pub behave_check: CheckboxCheck,
pub checked: bool,
pub default: bool,
pub focus: FocusFlag,
pub mouse: MouseFlags,
pub non_exhaustive: NonExhaustive,
}Expand description
State.
Fields§
§area: RectComplete area read only. renewed for each render.
inner: RectArea inside the block. read only. renewed for each render.
check_area: RectArea of the check mark. read only. renewed for each render.
text_area: RectArea for the text. read only. renewed for each render.
behave_check: CheckboxCheckBehaviour for check. read only. renewed for each render.
checked: boolChecked state. read+write
default: boolDefault state. read+write Maybe overriden by a default set for the widget.
focus: FocusFlagCurrent focus state. read+write
mouse: MouseFlagsMouse helper read+write
non_exhaustive: NonExhaustiveImplementations§
Source§impl CheckboxState
impl CheckboxState
pub fn new() -> Self
pub fn named(name: &str) -> Self
Sourcepub fn set_checked(&mut self, checked: bool) -> bool
pub fn set_checked(&mut self, checked: bool) -> bool
Set the value.
Sourcepub fn set_default(&mut self, default: bool) -> bool
pub fn set_default(&mut self, default: bool) -> bool
Set the default value.
Sourcepub fn set_value(&mut self, checked: bool) -> bool
pub fn set_value(&mut self, checked: bool) -> bool
Set checked value. Always sets default to false.
Sourcepub fn flip_checked(&mut self)
pub fn flip_checked(&mut self)
Flip the checkbox. If it was in default state it just switches off the default flag. Otherwise, it flips true/false.
Trait Implementations§
Source§impl Clone for CheckboxState
impl Clone for CheckboxState
Source§impl Debug for CheckboxState
impl Debug for CheckboxState
Source§impl Default for CheckboxState
impl Default for CheckboxState
Source§impl HandleEvent<Event, MouseOnly, CheckOutcome> for CheckboxState
impl HandleEvent<Event, MouseOnly, CheckOutcome> for CheckboxState
Source§impl HandleEvent<Event, Regular, CheckOutcome> for CheckboxState
impl HandleEvent<Event, Regular, CheckOutcome> for CheckboxState
Source§impl HasFocus for CheckboxState
impl HasFocus for CheckboxState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Build the focus-structure for the container.
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
Source§impl HasScreenCursor for CheckboxState
impl HasScreenCursor for CheckboxState
Source§impl RelocatableState for CheckboxState
impl RelocatableState for CheckboxState
Source§fn relocate(&mut self, shift: (i16, i16), clip: Rect)
fn relocate(&mut self, shift: (i16, i16), clip: Rect)
Relocate the areas in this widgets state. Read more
Source§fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
Relocate only popup areas.
As rendering the popups is a separate render,
this has to be separate too.
Relocate all popup areas to a clip-rect (0,0+0x0).
Relocate all areas to a clip-rect (0,0+0x0).
Auto Trait Implementations§
impl !Freeze for CheckboxState
impl !RefUnwindSafe for CheckboxState
impl !Send for CheckboxState
impl !Sync for CheckboxState
impl Unpin for CheckboxState
impl !UnwindSafe for CheckboxState
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