IFocusManager
trait · ferroui-base · v0.5.0
trait IFocusManager
Manages focus for the application.
Members
get_focused_elementfocustry_move_focusfind_first_focusable_elementfind_last_focusable_elementfind_next_elementas_any
get_focused_element
fn get_focused_element(self: &Self) -> Option<Ref<InputElement>>
Gets the currently focused element.
focus
fn focus(self: &Self, element: Option<&Ref<InputElement>>, method: NavigationMethod, key_modifiers: KeyModifiers) -> bool
Focuses a control.
element is the control to focus; None clears the focus. method
is the method by which focus was changed and key_modifiers any key
modifiers active at the time of focus. Returns true if the focus
moved to a control.
try_move_focus
fn try_move_focus(self: &Self, direction: NavigationDirection, options: Option<&FindNextElementOptions>) -> bool
Attempts to change focus from the element with focus to the next focusable element in the specified direction.
direction must be one of next, previous, left, right, up and down.
options help identify the next element to receive focus. Returns
true if focus moved.
find_first_focusable_element
fn find_first_focusable_element(self: &Self) -> Option<Ref<InputElement>>
Retrieves the first element that can receive focus.
find_last_focusable_element
fn find_last_focusable_element(self: &Self) -> Option<Ref<InputElement>>
Retrieves the last element that can receive focus.
find_next_element
fn find_next_element(self: &Self, direction: NavigationDirection, options: Option<&FindNextElementOptions>) -> Option<Ref<InputElement>>
Retrieves the element that should receive focus based on the specified navigation direction.
direction must be one of next, previous, left, right, up and down.
options help identify the next element to receive focus.
as_any
fn as_any(self: &Self) -> &dyn Any
The focus manager as Any, for downcasting to the concrete type.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.