Skip to main content

IInputElement

Trait IInputElement 

Source
pub trait IInputElement {
    // Required methods
    fn focusable(&self) -> bool;
    fn is_enabled(&self) -> bool;
    fn cursor(&self) -> Option<Rc<Cursor>>;
    fn is_effectively_enabled(&self) -> bool;
    fn is_effectively_visible(&self) -> bool;
    fn is_keyboard_focus_within(&self) -> bool;
    fn is_focused(&self) -> bool;
    fn is_hit_test_visible(&self) -> bool;
    fn is_pointer_over(&self) -> bool;
    fn focus(
        &self,
        method: NavigationMethod,
        key_modifiers: KeyModifiers,
    ) -> bool;
}
Expand description

Defines input-related functionality for a control.

The only implementor is InputElement: object references to input elements are Ref<InputElement>. The trait documents the contract; the routed event members of the contract (add_handler, remove_handler, raise_event) are inherited by every input element from Interactive.

Required Methods§

Source

fn focusable(&self) -> bool

Whether the control can receive keyboard focus.

Source

fn is_enabled(&self) -> bool

Whether the control is enabled for user interaction.

Source

fn cursor(&self) -> Option<Rc<Cursor>>

The associated mouse cursor.

Source

fn is_effectively_enabled(&self) -> bool

Whether this control and all its parents are enabled.

is_enabled is used to toggle the enabled state for individual controls. This property takes into account the enabled state of this control and its parent controls.

Source

fn is_effectively_visible(&self) -> bool

Whether this control and all its parents are visible.

Source

fn is_keyboard_focus_within(&self) -> bool

Whether keyboard focus is anywhere within the element or its visual tree child elements.

Source

fn is_focused(&self) -> bool

Whether the control is focused.

Source

fn is_hit_test_visible(&self) -> bool

Whether the control is considered for hit testing.

Source

fn is_pointer_over(&self) -> bool

Whether the pointer is currently over the control.

Source

fn focus(&self, method: NavigationMethod, key_modifiers: KeyModifiers) -> bool

Focuses the control. Returns whether the control was focused.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§