pub struct PopupMenuState {
pub area: Rect,
pub popup: PopupCoreState,
pub item_areas: Vec<Rect>,
pub sep_areas: Vec<Rect>,
pub navchar: Vec<Option<char>>,
pub disabled: Vec<bool>,
pub selected: Option<usize>,
pub mouse: MouseFlags,
pub non_exhaustive: NonExhaustive,
}Expand description
State & event handling.
Fields§
§area: Rect§popup: PopupCoreStatePopup data.
item_areas: Vec<Rect>Areas for each item. readonly. renewed for each render.
sep_areas: Vec<Rect>Area for the separator after each item. The area has height 0 if there is no separator. readonly. renewed for each render.
Letter navigation readonly. renewed for each render.
disabled: Vec<bool>Disabled menu-items.
selected: Option<usize>Selected item. 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
Sourcepub fn set_popup_z(&mut self, z: u16)
pub fn set_popup_z(&mut self, z: u16)
Set the z-index for the popup-menu.
Sourcepub fn flip_active(&mut self)
pub fn flip_active(&mut self)
Show the popup.
Sourcepub fn set_active(&mut self, active: bool)
pub fn set_active(&mut self, active: bool)
Show the popup.
Sourcepub fn clear_areas(&mut self)
👎Deprecated since 2.1.0: use relocate_popup_hidden()
pub fn clear_areas(&mut self)
Clear the areas.
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 duplicate 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 HasFocus for PopupMenuState
impl HasFocus for PopupMenuState
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.
Source§impl HasScreenCursor for PopupMenuState
impl HasScreenCursor for PopupMenuState
Source§impl RelocatableState for PopupMenuState
impl RelocatableState for PopupMenuState
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 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§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