FocusChangingEventArgs
struct · ferroui-base · v0.5.0
struct FocusChangingEventArgs
Provides data for focus changing: the GettingFocus and LosingFocus
events, which can cancel or redirect a focus change.
Members
old_focused_elementnavigation_methodkey_modifiersnewnew_focused_elementcanceledtry_canceltry_set_new_focused_element
old_focused_element
old_focused_element: Option<crate::Ref<super::InputElement>>
The element that had focus before the change.
navigation_method
navigation_method: super::NavigationMethod
Indicates how the change in focus occurred.
key_modifiers
key_modifiers: super::KeyModifiers
Any key modifiers active at the time of focus.
new
fn new<T: ?Sized>(routed_event: &RoutedEvent<T>) -> Self
Creates args for a routed event.
new_focused_element
fn new_focused_element(self: &Self) -> Option<Ref<InputElement>>
The element that focus will move to.
canceled
fn canceled(self: &Self) -> bool
Whether the focus change is canceled.
try_cancel
fn try_cancel(self: &Self) -> bool
Attempts to cancel the current focus change. Returns true if the focus change was cancelled; otherwise, false.
try_set_new_focused_element
fn try_set_new_focused_element(self: &Self, input_element: Option<&Ref<InputElement>>) -> bool
Attempts to redirect focus from the targeted element to the specified element. Returns true if the focus change was redirected; otherwise, false.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedErasedDestructorIntoEitherCloneDerefIRoutedEventArgsIKeyModifiersEventArgsMarkupTyped
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.