pub enum PaneAction {
SwitchRoot(String),
Quit,
Custom(String),
Slider(String, f32),
TextChanged(String, String),
TextSubmitted(String, String),
Toggle(String, bool),
Dropdown(String, usize, String),
Radio(String, usize, String),
}Expand description
An event emitted by the UI in response to user interaction.
Returned as a Vec<PaneAction> from PaneOverlay::draw and PaneHeadless::update
each frame. Process them in a match to drive your application logic.
Widget IDs in the variants correspond to the id field set in your .ron file.
Variants§
SwitchRoot(String)
The active root has been switched, either by a button action or a PaneOverlay::draw
call that processed a SwitchRoot message. Contains the name of the new root.
Quit
A button with a Quit action was pressed, or the window close button was clicked.
In standalone mode this exits immediately; in overlay/headless mode you should
use this to exit your own event loop.
Custom(String)
A button with a Custom(tag) action was pressed. The String is the tag from
the RON definition.
Slider(String, f32)
A slider’s value changed. f32 is the new value in the slider’s min..=max range.
TextChanged(String, String)
A text box’s content changed (fires on every keystroke). Contains the widget id and the full current string.
TextSubmitted(String, String)
The user pressed Enter in a text box. Contains the widget id and the submitted string.
Toggle(String, bool)
A toggle was flipped. bool is the new checked state.
Dropdown(String, usize, String)
A dropdown selection changed. Contains the widget id, the new selected index, and the selected option string.
Radio(String, usize, String)
A radio group selection changed. Contains the widget id, the new selected index, and the selected option string.
Trait Implementations§
Source§impl Clone for PaneAction
impl Clone for PaneAction
Source§fn clone(&self) -> PaneAction
fn clone(&self) -> PaneAction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PaneAction
impl Debug for PaneAction
Source§impl PartialEq for PaneAction
impl PartialEq for PaneAction
impl StructuralPartialEq for PaneAction
Auto Trait Implementations§
impl Freeze for PaneAction
impl RefUnwindSafe for PaneAction
impl Send for PaneAction
impl Sync for PaneAction
impl Unpin for PaneAction
impl UnsafeUnpin for PaneAction
impl UnwindSafe for PaneAction
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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