pub struct StatusItem {
pub text: Option<String>,
pub key_code: Option<KeyEvent>,
pub command: Command,
}Expand description
A single status-line entry: a label, an optional accelerator, and a command.
text == None is a hidden global hotkey binding that draws nothing and
consumes no width but still fires its command when
its key_code is pressed (see the module docs).
§Turbo Vision heritage
Ports TStatusItem (menus.h); the optional label becomes Option<String>
(None = a hidden binding).
Fields§
§text: Option<String>The displayed label. None is a hidden hotkey binding that draws nothing
and consumes no horizontal space.
key_code: Option<KeyEvent>The accelerator key that fires this item’s command; None means the item
has no keyboard shortcut and can only be activated by clicking it.
Use StatusItem::key to build a hidden item whose only purpose is
the accelerator (no label, no width). The C++ equivalent used a
kbNoKey sentinel; None here is cleaner and carries the same meaning.
command: CommandThe command posted when this item is clicked or its accelerator is pressed.
Typically one of the standard Command constants (e.g. Command::HELP,
Command::QUIT), but any application-defined command works. The status
line checks whether the command is currently enabled before posting it and
before highlighting the item during a mouse drag.
Implementations§
Trait Implementations§
Source§impl Clone for StatusItem
impl Clone for StatusItem
Source§fn clone(&self) -> StatusItem
fn clone(&self) -> StatusItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StatusItem
impl Debug for StatusItem
impl Eq for StatusItem
Source§impl PartialEq for StatusItem
impl PartialEq for StatusItem
impl StructuralPartialEq for StatusItem
Auto Trait Implementations§
impl Freeze for StatusItem
impl RefUnwindSafe for StatusItem
impl Send for StatusItem
impl Sync for StatusItem
impl Unpin for StatusItem
impl UnsafeUnpin for StatusItem
impl UnwindSafe for StatusItem
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.