pub struct PopupMenuState {
pub area: Rect,
pub z_areas: [ZRect; 1],
pub item_areas: Vec<Rect>,
pub sep_areas: Vec<Rect>,
pub navchar: Vec<Option<char>>,
pub disabled: Vec<bool>,
pub selected: Option<usize>,
pub focus: FocusFlag,
pub mouse: MouseFlags,
pub non_exhaustive: NonExhaustive,
}Expand description
State & event handling.
Fields§
§area: RectTotal area readonly. renewed for each render.
z_areas: [ZRect; 1]Area with z-index for Focus. readonly. renewed for each render.
item_areas: Vec<Rect>Areas for each item. readonly. renewed for each render.
sep_areas: Vec<Rect>Area for the separator after each item. readonly. renewed for each render.
Letter navigation readonly. renewed for each render.
disabled: Vec<bool>Disable menu-items.
selected: Option<usize>Selected item. read+write
focus: FocusFlagFocusflag is used to decide the visible/not-visible state. read+write
mouse: MouseFlagsMouse flags used for mouse interaction
non_exhaustive: NonExhaustiveImplementations§
source§impl PopupMenuState
impl PopupMenuState
sourcepub fn new() -> PopupMenuState
pub fn new() -> PopupMenuState
New
sourcepub fn named(name: &str) -> PopupMenuState
pub fn named(name: &str) -> PopupMenuState
New with a focus name.
sourcepub fn flip_active(&mut self)
pub fn flip_active(&mut self)
Show the popup.
sourcepub fn set_active(&self, active: bool)
pub fn set_active(&self, active: bool)
Show the popup.
Select by navigation key.
Trait Implementations§
source§impl Clone for PopupMenuState
impl Clone for PopupMenuState
source§fn clone(&self) -> PopupMenuState
fn clone(&self) -> PopupMenuState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for PopupMenuState
impl Debug for PopupMenuState
source§impl Default for PopupMenuState
impl Default for PopupMenuState
source§fn default() -> PopupMenuState
fn default() -> PopupMenuState
Returns the “default value” for a type. Read more
source§impl HandleEvent<Event, MouseOnly, MenuOutcome> for PopupMenuState
impl HandleEvent<Event, MouseOnly, MenuOutcome> for PopupMenuState
source§impl HandleEvent<Event, Popup, MenuOutcome> for PopupMenuState
impl HandleEvent<Event, Popup, MenuOutcome> for PopupMenuState
source§impl HasFocusFlag for PopupMenuState
impl HasFocusFlag for PopupMenuState
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 !Freeze for PopupMenuState
impl !RefUnwindSafe for PopupMenuState
impl !Send for PopupMenuState
impl !Sync for PopupMenuState
impl Unpin for PopupMenuState
impl !UnwindSafe for PopupMenuState
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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