pub struct RadioState<T = usize>where
T: PartialEq,{
pub area: Rect,
pub inner: Rect,
pub marker_area: Rect,
pub continue_area: Rect,
pub check_areas: Vec<Rect>,
pub text_areas: Vec<Rect>,
pub keys: Vec<T>,
pub default_key: Option<T>,
pub selected: usize,
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.
marker_area: RectArea for the focus marker. read only. renewed for each render.
continue_area: RectArea for a continue marker. This is displayed if not all items can be displayed.
check_areas: Vec<Rect>read only. renewed for each render. Area of the check marks. read only. renewed for each render.
text_areas: Vec<Rect>Area for the texts. read only. renewed for each render.
keys: Vec<T>Keys. read only. renewed for each render.
default_key: Option<T>Can return to default with a user interaction.
selected: usizeSelected state.
focus: FocusFlagCurrent focus state. read+write
mouse: MouseFlagsMouse helper read+write
non_exhaustive: NonExhaustiveImplementations§
Source§impl<T> RadioState<T>where
T: PartialEq,
impl<T> RadioState<T>where
T: PartialEq,
pub fn new() -> Self
pub fn named(name: &str) -> Self
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn selected(&self) -> usize
pub fn select(&mut self, select: usize) -> bool
Sourcepub fn set_default_value(&mut self) -> bool
pub fn set_default_value(&mut self) -> bool
Set the default value.
Sourcepub fn value_ref(&self) -> &T
pub fn value_ref(&self) -> &T
Get the selected value or None if no value is selected or there are no options.
pub fn next(&mut self) -> bool
pub fn prev(&mut self) -> bool
Trait Implementations§
Source§impl<T> Clone for RadioState<T>
impl<T> Clone for RadioState<T>
Source§impl<T> Debug for RadioState<T>
impl<T> Debug for RadioState<T>
Source§impl<T: PartialEq> Default for RadioState<T>
impl<T: PartialEq> Default for RadioState<T>
Source§impl<T: PartialEq> HandleEvent<Event, MouseOnly, Outcome> for RadioState<T>
impl<T: PartialEq> HandleEvent<Event, MouseOnly, Outcome> for RadioState<T>
Source§impl<T: PartialEq> HandleEvent<Event, Regular, Outcome> for RadioState<T>
impl<T: PartialEq> HandleEvent<Event, Regular, Outcome> for RadioState<T>
Source§impl<T: PartialEq> HasFocus for RadioState<T>
impl<T: PartialEq> HasFocus for RadioState<T>
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.
Auto Trait Implementations§
impl<T = usize> !Freeze for RadioState<T>
impl<T = usize> !RefUnwindSafe for RadioState<T>
impl<T = usize> !Send for RadioState<T>
impl<T = usize> !Sync for RadioState<T>
impl<T> Unpin for RadioState<T>where
T: Unpin,
impl<T = usize> !UnwindSafe for RadioState<T>
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