pub struct MouseClickArgs {
pub timestamp: DInstant,
pub window_id: WindowId,
pub device_id: InputDeviceId,
pub button: MouseButton,
pub position: DipPoint,
pub modifiers: ModifiersState,
pub click_count: NonZeroU32,
pub is_repeat: bool,
pub hits: HitTestInfo,
pub target: InteractionPath,
/* private fields */
}Expand description
MOUSE_CLICK_EVENT arguments.
Fields§
§timestamp: DInstantInstant the event happened.
window_id: WindowIdId of window that received the event.
device_id: InputDeviceIdId of device that generated the event.
Which mouse button generated the event.
position: DipPointPosition of the mouse in the coordinates of target.
modifiers: ModifiersStateWhat modifier keys where pressed when this event happened.
click_count: NonZeroU32Count of clicks within the double-click interval. Number 1 is single click, 2 is double click, etc.
Auto repeated clicks also increment this count.
is_repeat: boolIf the event was generated by holding the button pressed over a widget with ClickMode::repeat.
hits: HitTestInfoHit-test result for the mouse point in the window, at the moment the click event was generated.
target: InteractionPathFull path to the widget that got clicked.
A widget is clicked if the mouse down and mouse up happen in sequence in the same widget. Subsequent clicks (double, triple) happen on mouse down.
If a mouse down happen in a child widget and the pointer is dragged to a larger parent widget and then let go (mouse up), the click target is the parent widget.
Multi-clicks (click_count > 1) only happen to the same target.
Implementations§
Source§impl MouseClickArgs
impl MouseClickArgs
Sourcepub fn new(
timestamp: impl Into<DInstant>,
propagation_handle: EventPropagationHandle,
window_id: impl Into<WindowId>,
device_id: impl Into<InputDeviceId>,
button: impl Into<MouseButton>,
position: impl Into<DipPoint>,
modifiers: impl Into<ModifiersState>,
click_count: impl Into<NonZeroU32>,
is_repeat: impl Into<bool>,
hits: impl Into<HitTestInfo>,
target: impl Into<InteractionPath>,
) -> Self
pub fn new( timestamp: impl Into<DInstant>, propagation_handle: EventPropagationHandle, window_id: impl Into<WindowId>, device_id: impl Into<InputDeviceId>, button: impl Into<MouseButton>, position: impl Into<DipPoint>, modifiers: impl Into<ModifiersState>, click_count: impl Into<NonZeroU32>, is_repeat: impl Into<bool>, hits: impl Into<HitTestInfo>, target: impl Into<InteractionPath>, ) -> Self
New args from values that convert into the argument types.
Sourcepub fn now(
window_id: impl Into<WindowId>,
device_id: impl Into<InputDeviceId>,
button: impl Into<MouseButton>,
position: impl Into<DipPoint>,
modifiers: impl Into<ModifiersState>,
click_count: impl Into<NonZeroU32>,
is_repeat: impl Into<bool>,
hits: impl Into<HitTestInfo>,
target: impl Into<InteractionPath>,
) -> Self
pub fn now( window_id: impl Into<WindowId>, device_id: impl Into<InputDeviceId>, button: impl Into<MouseButton>, position: impl Into<DipPoint>, modifiers: impl Into<ModifiersState>, click_count: impl Into<NonZeroU32>, is_repeat: impl Into<bool>, hits: impl Into<HitTestInfo>, target: impl Into<InteractionPath>, ) -> Self
Arguments for event that happened now (INSTANT.now).
Source§impl MouseClickArgs
impl MouseClickArgs
Sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
If the button is the primary.
Sourcepub fn is_context(&self) -> bool
pub fn is_context(&self) -> bool
If the button is the context (right).
Sourcepub fn is_single(&self) -> bool
pub fn is_single(&self) -> bool
If the click_count is 1.
Sourcepub fn is_double(&self) -> bool
pub fn is_double(&self) -> bool
If the click_count is 2.
Sourcepub fn is_triple(&self) -> bool
pub fn is_triple(&self) -> bool
If the click_count is 3.
Sourcepub fn position_wgt(&self) -> Option<PxPoint>
pub fn position_wgt(&self) -> Option<PxPoint>
Gets position in the widget inner bounds.
Trait Implementations§
Source§impl AnyEventArgs for MouseClickArgs
impl AnyEventArgs for MouseClickArgs
Source§fn delivery_list(&self, list: &mut UpdateDeliveryList)
fn delivery_list(&self, list: &mut UpdateDeliveryList)
The target.
Source§fn clone_any(&self) -> Box<dyn AnyEventArgs>
fn clone_any(&self) -> Box<dyn AnyEventArgs>
Source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
Source§impl Clone for MouseClickArgs
impl Clone for MouseClickArgs
Source§fn clone(&self) -> MouseClickArgs
fn clone(&self) -> MouseClickArgs
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MouseClickArgs
impl Debug for MouseClickArgs
Source§impl EventArgs for MouseClickArgs
impl EventArgs for MouseClickArgs
Source§impl From<MouseClickArgs> for ClickArgs
impl From<MouseClickArgs> for ClickArgs
Source§fn from(args: MouseClickArgs) -> Self
fn from(args: MouseClickArgs) -> Self
Auto Trait Implementations§
impl Freeze for MouseClickArgs
impl RefUnwindSafe for MouseClickArgs
impl Send for MouseClickArgs
impl Sync for MouseClickArgs
impl Unpin for MouseClickArgs
impl UnwindSafe for MouseClickArgs
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more