pub struct DrawingContextMenu {
pub drawing_id: Option<usize>,
pub drawing_type: String,
pub is_locked: bool,
pub is_visible: bool,
pub alert: Option<Alert>,
pub panes: Vec<(PaneId, String)>,
pub last_action: DrawingContextMenuAction,
/* private fields */
}Expand description
Drawing context menu state
Fields§
§drawing_id: Option<usize>Drawing ID that was right-clicked
drawing_type: StringDrawing type name for display
is_locked: boolWhether the drawing is currently locked
is_visible: boolWhether the drawing is currently visible
alert: Option<Alert>The alert the Add alert entry offers; None leaves the entry out.
panes: Vec<(PaneId, String)>Panes the Move to submenu offers, by stable id and title; empty leaves it out.
last_action: DrawingContextMenuActionLast action taken
Implementations§
Source§impl DrawingContextMenu
impl DrawingContextMenu
Sourcepub fn set_context(
&mut self,
drawing_type: impl Into<String>,
locked: bool,
visible: bool,
)
pub fn set_context( &mut self, drawing_type: impl Into<String>, locked: bool, visible: bool, )
Set drawing context for dynamic menu items
Sourcepub fn take_action(&mut self) -> DrawingContextMenuAction
pub fn take_action(&mut self) -> DrawingContextMenuAction
Take and consume the last action
Sourcepub fn show_with_shortcuts(
&mut self,
ctx: &Context,
theme: &Theme,
shortcuts: &ShortcutMap,
)
pub fn show_with_shortcuts( &mut self, ctx: &Context, theme: &Theme, shortcuts: &ShortcutMap, )
Show menu hints from the same bindings used by chart input.
Trait Implementations§
Source§impl Clone for DrawingContextMenu
impl Clone for DrawingContextMenu
Source§fn clone(&self) -> DrawingContextMenu
fn clone(&self) -> DrawingContextMenu
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DrawingContextMenu
impl Debug for DrawingContextMenu
Auto Trait Implementations§
impl Freeze for DrawingContextMenu
impl RefUnwindSafe for DrawingContextMenu
impl Send for DrawingContextMenu
impl Sync for DrawingContextMenu
impl Unpin for DrawingContextMenu
impl UnsafeUnpin for DrawingContextMenu
impl UnwindSafe for DrawingContextMenu
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
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