pub struct PointerEventArgs { /* private fields */ }Expand description
Provides data for pointer events.
Implementations§
Source§impl PointerEventArgs
impl PointerEventArgs
Sourcepub fn new<T: ?Sized>(
routed_event: Option<&RoutedEvent<T>>,
source: impl Into<Nullable<FerroObject>>,
pointer: Rc<dyn IPointer>,
root_visual: Option<&Visual>,
root_visual_position: Point,
timestamp: u64,
properties: PointerPointProperties,
modifiers: KeyModifiers,
) -> Self
pub fn new<T: ?Sized>( routed_event: Option<&RoutedEvent<T>>, source: impl Into<Nullable<FerroObject>>, pointer: Rc<dyn IPointer>, root_visual: Option<&Visual>, root_visual_position: Point, timestamp: u64, properties: PointerPointProperties, modifiers: KeyModifiers, ) -> Self
Creates pointer event args.
root_visual is the root of the tree that observed the event and
root_visual_position the position of the pointer in its
coordinates. timestamp is the platform time stamp of the input.
Sourcepub fn with_previous_points(
self,
previous_points: Option<IntermediatePoints>,
) -> Self
pub fn with_previous_points( self, previous_points: Option<IntermediatePoints>, ) -> Self
Adds the intermediate points of the event.
Adds the platform’s cookie for the input event.
Sourcepub fn timestamp(&self) -> u64
pub fn timestamp(&self) -> u64
The time when the pointer event occurred, as reported by the platform.
The platform’s opaque cookie for the input event that caused this event, if any.
Sourcepub fn key_modifiers(&self) -> KeyModifiers
pub fn key_modifiers(&self) -> KeyModifiers
The key modifiers held down when the event occurred.
Sourcepub fn get_position(&self, relative_to: Option<&Visual>) -> Point
pub fn get_position(&self, relative_to: Option<&Visual>) -> Point
Gets the pointer position relative to a control, or relative to the
root of the tree that observed the event when relative_to is
None.
Sourcepub fn get_current_point(&self, relative_to: Option<&Visual>) -> PointerPoint
pub fn get_current_point(&self, relative_to: Option<&Visual>) -> PointerPoint
Returns the pointer point associated with the current event, positioned relative to a control.
Sourcepub fn get_intermediate_points(
&self,
relative_to: Option<&Visual>,
) -> Vec<PointerPoint>
pub fn get_intermediate_points( &self, relative_to: Option<&Visual>, ) -> Vec<PointerPoint>
Returns all points since the last relevant pointer event, positioned relative to a control. The last one is the current point.
Sourcepub fn prevent_gesture_recognition(&self)
pub fn prevent_gesture_recognition(&self)
Prevents this event from being handled by other gesture recognizers in the route.
Sourcepub fn properties(&self) -> PointerPointProperties
pub fn properties(&self) -> PointerPointProperties
The state of the pointer device at the time of the event.
Methods from Deref<Target = RoutedEventArgs>§
Sourcepub fn handled(&self) -> bool
pub fn handled(&self) -> bool
Whether the routed event has already been handled.
Once handled, the event keeps travelling along its route but is only delivered to handlers registered for handled events too.
Sourcepub fn set_handled(&self, value: bool)
pub fn set_handled(&self, value: bool)
Marks the routed event as handled or unhandled.
Sourcepub fn routed_event(&self) -> Option<RoutedEvent>
pub fn routed_event(&self) -> Option<RoutedEvent>
The routed event associated with these args.
Sourcepub fn set_routed_event<T: ?Sized>(&self, value: Option<&RoutedEvent<T>>)
pub fn set_routed_event<T: ?Sized>(&self, value: Option<&RoutedEvent<T>>)
Sets the routed event associated with these args.
Sourcepub fn route(&self) -> RoutingStrategies
pub fn route(&self) -> RoutingStrategies
The routing strategy currently being applied to the event.
Sourcepub fn set_route(&self, value: RoutingStrategies)
pub fn set_route(&self, value: RoutingStrategies)
Sets the routing strategy currently being applied to the event.
Sourcepub fn source(&self) -> Option<Ref<FerroObject>>
pub fn source(&self) -> Option<Ref<FerroObject>>
The object that raised the event.
Sourcepub fn set_source(&self, value: impl Into<Nullable<FerroObject>>)
pub fn set_source(&self, value: impl Into<Nullable<FerroObject>>)
Sets the object that raised the event.
Sourcepub fn is_source(&self, object: &FerroObject) -> bool
pub fn is_source(&self, object: &FerroObject) -> bool
Whether object is the source of the event (C# e.Source == object).
Trait Implementations§
Source§impl Clone for PointerEventArgs
impl Clone for PointerEventArgs
Source§impl Deref for PointerEventArgs
impl Deref for PointerEventArgs
Source§type Target = RoutedEventArgs
type Target = RoutedEventArgs
Source§fn deref(&self) -> &RoutedEventArgs
fn deref(&self) -> &RoutedEventArgs
Source§impl IKeyModifiersEventArgs for PointerEventArgs
impl IKeyModifiersEventArgs for PointerEventArgs
Source§fn key_modifiers(&self) -> KeyModifiers
fn key_modifiers(&self) -> KeyModifiers
Source§impl IRoutedEventArgs for PointerEventArgs
impl IRoutedEventArgs for PointerEventArgs
Source§fn as_routed_event_args(&self) -> &RoutedEventArgs
fn as_routed_event_args(&self) -> &RoutedEventArgs
Source§fn query_args(&self, type_id: TypeId) -> Option<&dyn Any>
fn query_args(&self, type_id: TypeId) -> Option<&dyn Any>
type_id, if
the args are of that type or of a type derived from it.Source§fn is_args_type(type_id: TypeId) -> bool
fn is_args_type(type_id: TypeId) -> bool
type_id or is
derived from it.handled, the source, a cancel flag, ..) is shared with them.Source§impl MarkupTyped for PointerEventArgs
impl MarkupTyped for PointerEventArgs
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
Auto Trait Implementations§
impl !RefUnwindSafe for PointerEventArgs
impl !Send for PointerEventArgs
impl !Sync for PointerEventArgs
impl !UnwindSafe for PointerEventArgs
impl Freeze for PointerEventArgs
impl Unpin for PointerEventArgs
impl UnsafeUnpin for PointerEventArgs
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more