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/widget.
Build the focus-structure for the container/widget. Read more
Declares how the widget interacts with focus. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Does this widget have the focus.
Or, if the flag is used for a container, does any of
widget inside the container have the focus. Read more
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
This widget just lost the focus. This flag is set by [Focus::handle]
if there is a focus transfer, and will be reset by the next
call to [Focus::handle]. Read more
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
This widget just gained the focus. This flag is set by [Focus::handle]
if there is a focus transfer, and will be reset by the next
call to [Focus::handle]. Read more
Source§fn has_mouse_focus(&self) -> bool
fn has_mouse_focus(&self) -> bool
This flag is set by [Focus::handle], if a mouse-event
matches one of the areas associated with a widget. Read more
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 UnsafeUnpin 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