pub enum QuestionnaireChoiceControl {
Checkbox(Checkbox),
Radio(Radio),
}Expand description
The answer control for one choice, wired to the questionnaire’s behavior.
A multiple-answer item hands back a Checkbox and a single-answer item a
Radio, each already carrying its checked state, disabled state,
accessibility name, position in set, focus handle, confirm key and change
handler. Activation goes through QuestionnaireState::choose, so a
Radio confirms its item once chosen. The skin decides what the control
looks like and what it contains.
Variants§
Implementations§
Source§impl QuestionnaireChoiceControl
impl QuestionnaireChoiceControl
Sourcepub fn new(
state: &Entity<QuestionnaireState>,
item: impl Into<SharedString>,
value: impl Into<SharedString>,
id: impl Into<ElementId>,
cx: &App,
) -> Option<Self>
pub fn new( state: &Entity<QuestionnaireState>, item: impl Into<SharedString>, value: impl Into<SharedString>, id: impl Into<ElementId>, cx: &App, ) -> Option<Self>
Returns None when the item or the choice is not part of the schema.
Auto Trait Implementations§
impl !RefUnwindSafe for QuestionnaireChoiceControl
impl !Send for QuestionnaireChoiceControl
impl !Sync for QuestionnaireChoiceControl
impl !UnwindSafe for QuestionnaireChoiceControl
impl Forget for QuestionnaireChoiceControl
impl Freeze for QuestionnaireChoiceControlwhere
NonZero<u32>: Freeze,
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Path> is !null: Freeze,
PhantomData<ArcInner<Path>>: Freeze,
*const str is !null: Freeze,
PhantomData<&'static str>: Freeze,
*const ArcInner<ElementId> is !null: Freeze,
PhantomData<ArcInner<ElementId>>: Freeze,
*mut Interactivity: Freeze,
*const RcInner<Cell<bool>> is !null: Freeze,
PhantomData<RcInner<Cell<bool>>>: Freeze,
*const Interactivity is !null: Freeze,
PhantomData<Interactivity>: Freeze,
*mut dyn ElementObject: Freeze,
*const AnyElement is !null: Freeze,
*const dyn Fn(Vec<Bounds<Pixels>>, &mut Window, &mut App) is !null: Freeze,
PhantomData<dyn Fn(Vec<Bounds<Pixels>>, &mut Window, &mut App)>: Freeze,
*const dyn ImageCacheProvider is !null: Freeze,
PhantomData<dyn ImageCacheProvider>: Freeze,
*const dyn Fn(&mut Window, &mut App) -> SmallVec<[usize; 8]> is !null: Freeze,
PhantomData<dyn Fn(&mut Window, &mut App) -> SmallVec<[usize; 8]>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<BoxShadow>: Freeze,
*const ArcInner<Vec<(String, u32)>> is !null: Freeze,
PhantomData<ArcInner<Vec<(String, u32)>>>: Freeze,
*const ArcInner<Vec<String>> is !null: Freeze,
PhantomData<ArcInner<Vec<String>>>: Freeze,
*const RcInner<dyn Fn(CheckboxState, &ClickEvent, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(CheckboxState, &ClickEvent, &mut Window, &mut App)>>: Freeze,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: Freeze,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: Freeze,
*const RcInner<dyn Fn(bool, &ClickEvent, &mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(bool, &ClickEvent, &mut Window, &mut App)>>: Freeze,
impl Move for QuestionnaireChoiceControl
impl Unpin for QuestionnaireChoiceControlwhere
NonZero<u32>: Unpin,
&'static str: Unpin,
Arc<str>: Unpin,
Arc<Path>: Unpin,
*const str is !null: Unpin,
Arc<ElementId>: Unpin,
*mut Interactivity: Unpin,
Rc<Cell<bool>>: Unpin,
Box<Interactivity>: Unpin,
*mut dyn ElementObject: Unpin,
*const AnyElement is !null: Unpin,
Box<dyn Fn(Vec<Bounds<Pixels>>, &mut Window, &mut App)>: Unpin,
Box<dyn ImageCacheProvider>: Unpin,
Box<dyn Fn(&mut Window, &mut App) -> SmallVec<[usize; 8]>>: Unpin,
*const u8 is !null: Unpin,
Arc<Vec<(String, u32)>>: Unpin,
Arc<Vec<String>>: Unpin,
Rc<dyn Fn(CheckboxState, &ClickEvent, &mut Window, &mut App)>: Unpin,
Arc<RwLock<RawRwLock, FocusMap>>: Unpin,
Rc<dyn Fn(bool, &ClickEvent, &mut Window, &mut App)>: Unpin,
impl UnsafeUnpin for QuestionnaireChoiceControlwhere
NonZeroU32Inner: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Path> is !null: UnsafeUnpin,
PhantomData<ArcInner<Path>>: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
*const ArcInner<ElementId> is !null: UnsafeUnpin,
PhantomData<ArcInner<ElementId>>: UnsafeUnpin,
*mut Interactivity: UnsafeUnpin,
*const RcInner<Cell<bool>> is !null: UnsafeUnpin,
PhantomData<RcInner<Cell<bool>>>: UnsafeUnpin,
*const Interactivity is !null: UnsafeUnpin,
PhantomData<Interactivity>: UnsafeUnpin,
*mut dyn ElementObject: UnsafeUnpin,
*const AnyElement is !null: UnsafeUnpin,
*const dyn Fn(Vec<Bounds<Pixels>>, &mut Window, &mut App) is !null: UnsafeUnpin,
PhantomData<dyn Fn(Vec<Bounds<Pixels>>, &mut Window, &mut App)>: UnsafeUnpin,
*const dyn ImageCacheProvider is !null: UnsafeUnpin,
PhantomData<dyn ImageCacheProvider>: UnsafeUnpin,
*const dyn Fn(&mut Window, &mut App) -> SmallVec<[usize; 8]> is !null: UnsafeUnpin,
PhantomData<dyn Fn(&mut Window, &mut App) -> SmallVec<[usize; 8]>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<BoxShadow>: UnsafeUnpin,
*const ArcInner<Vec<(String, u32)>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<(String, u32)>>>: UnsafeUnpin,
*const ArcInner<Vec<String>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Vec<String>>>: UnsafeUnpin,
*const RcInner<dyn Fn(CheckboxState, &ClickEvent, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(CheckboxState, &ClickEvent, &mut Window, &mut App)>>: UnsafeUnpin,
*const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: UnsafeUnpin,
PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: UnsafeUnpin,
*const RcInner<dyn Fn(bool, &ClickEvent, &mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(bool, &ClickEvent, &mut Window, &mut App)>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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