FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ContextRequestedEventArgs

    struct · ferroui-base · v0.5.0

    struct ContextRequestedEventArgs
    

    Provides event data for the context requested event.

    View source

    Members

    new

    fn new() -> Self
    

    Creates args for a context request that has no position, e.g. one made with the keyboard.

    Source

    from_pointer_event_args

    fn from_pointer_event_args(pointer_event_args: &PointerEventArgs) -> Self
    

    Creates args for a context request made with a pointer.

    Source

    from_context_requested_event_args

    fn from_context_requested_event_args(context_requested_event_args: &ContextRequestedEventArgs) -> Self
    

    Creates args from other context requested args, keeping the position.

    Source

    try_get_position

    fn try_get_position(self: &Self, relative_to: Option<&InputElement>) -> Option<Point>
    

    Gets the point on which the context was requested, relative to the specified element (or to the root when None).

    Returns None if the context was not requested with a pointer, e.g. when it was requested with the keyboard.

    Source

    set_placement_rect

    fn set_placement_rect(self: &Self, relative_to: &Visual, rect: Rect)
    

    Supplies an explicit anchor for this menu request in relative_to's device-independent coordinates. A zero-size rectangle anchors at a point.

    This does not change whether the request originated from a pointer or keyboard. The owner is weak, and shared event handles see the same anchor.

    Source

    try_get_placement_rect

    fn try_get_placement_rect(self: &Self, relative_to: &Visual) -> Option<Rect>
    

    Gets this request's explicit anchor in the recipient's coordinates. Returns None when no anchor was supplied, its owner expired, or the recipient and owner do not share a visual coordinate system.

    Source

    clear_placement_rect

    fn clear_placement_rect(self: &Self)
    

    Restores the ordinary pointer or keyboard placement for this request.

    Source

    is_holding

    fn is_holding(self: &Self) -> bool
    

    Whether the context was requested by holding a pointer down.

    Internal in the reference, where the controls assembly sees it.

    Source

    pointer_type

    fn pointer_type(self: &Self) -> Option<PointerType>
    

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Receiver
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Deref
    • IRoutedEventArgs
    • Default
    • MarkupTyped

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.