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 focus: FocusFlag,
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
focus: FocusFlagCurrent focus 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 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 HandleEvent<Event, Regular, MenuOutcome> for PopupMenuState
impl HandleEvent<Event, Regular, 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/widget.
Declares how the widget interacts with focus. Read more
Build the focus-structure for the container/widget. Read more
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Does this widget have the focus.
Or, if the flag is used for a container, does any of
widget inside the container have the focus. Read more
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
This widget just lost the focus. This flag is set by [Focus::handle]
if there is a focus transfer, and will be reset by the next
call to [Focus::handle]. Read more
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
This widget just gained the focus. This flag is set by [Focus::handle]
if there is a focus transfer, and will be reset by the next
call to [Focus::handle]. Read more
Source§fn has_mouse_focus(&self) -> bool
fn has_mouse_focus(&self) -> bool
This flag is set by [Focus::handle], if a mouse-event
matches one of the areas associated with a widget. Read more
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 UnsafeUnpin 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