pub struct State {
pub visible: bool,
pub cursor_vis: bool,
pub cursor_ins: bool,
pub shadow: bool,
pub active: bool,
pub selected: bool,
pub focused: bool,
pub dragging: bool,
pub disabled: bool,
pub modal: bool,
pub default: bool,
}Expand description
The per-view state flags — visibility, focus, selection, drag, and the rest of the activation/interaction bits a parent flips on its children.
Most flags are set by the framework (not by widget code directly):
visible via show()/hide(); active/selected/focused/dragging
via Group::set_state; modal by Program::exec_view. The flags you
commonly read in draw/handle code are:
focused— draw the focused appearance (e.g. highlight the active item).disabled— skip event handling; the framework gates events before the view sees them, so this is mainly useful for conditional drawing.cursor_vis/cursor_ins— set these inhandle_eventto show or shape the hardware cursor after editing operations.
Dropped: the occlusion/visibility cache flag — under whole-tree redraw + diff there is nothing to cache.
§Turbo Vision heritage
Ports the sf* flag family (views.h) as a struct-of-bools (deviation D5);
each field names its sf* source. The dropped flag is sfExposed (0x800).
Fields§
§visible: boolsfVisible — the view is shown (set by default in the ctor).
cursor_vis: boolsfCursorVis — the hardware cursor is visible while this view is focused.
cursor_ins: boolsfCursorIns — the caret fills the whole cell (overwrite mode): a
terminal backend shows a blinking block instead of the terminal’s own
caret shape.
shadow: boolsfShadow — the view casts a drop shadow.
active: boolsfActive — the view is in the active window/group chain.
selected: boolsfSelected — the view is the current (selected) one in its owner.
focused: boolsfFocused — the view is selected and its whole owner chain is active.
dragging: boolsfDragging — the view is being dragged/resized.
disabled: boolsfDisabled — the view ignores events.
modal: boolsfModal — the view runs a modal event loop.
default: boolsfDefault — the view is the default one (e.g. the default button).
Trait Implementations§
impl Copy for State
impl Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
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.