xtd 1.0.0
Loading...
Searching...
No Matches
xtd::forms::mouse_event_args Class Reference
Inheritance diagram for xtd::forms::mouse_event_args:
xtd::event_args xtd::object

Definition

Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down, and xtd::forms::control::mouse_move events.

Header
#include <xtd/forms/mouse_event_args>
Namespace
xtd::forms
Library
xtd.forms
Examples
ball.cpp.

Public Constructors

 mouse_event_args ()=default
 Initializes a new instance of the MouseEventArgs class.
 mouse_event_args (xtd::forms::mouse_buttons button, xtd::int32 clicks, xtd::int32 x, xtd::int32 y, xtd::int32 delta)
 Initializes a new instance of the MouseEventArgs class.
 mouse_event_args (xtd::forms::mouse_buttons button, xtd::int32 clicks, const xtd::drawing::point &location, xtd::int32 delta)
 Initializes a new instance of the MouseEventArgs class.

Public Properties

auto button () const noexcept -> xtd::forms::mouse_buttons
 Gets which mouse button was pressed.
auto clicks () const noexcept -> xtd::int32
 Gets the number of times the mouse button was pressed and released.
auto delta () const noexcept -> xtd::int32
 Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel.
auto location () const noexcept -> const xtd::drawing::point &
 Gets the location of the mouse during the generating mouse event.
auto x () const noexcept -> xtd::int32
 Gets the x-coordinate of the mouse during the generating mouse event.
auto y () const noexcept -> xtd::int32
 Gets the y-coordinate of the mouse during the generating mouse event.

Additional Inherited Members

static const event_args empty
 Provides a value to use with events that do not have event data.
 event_args ()=default
 Initializes a new instance of the event_args class.
 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.

Constructor & Destructor Documentation

◆ mouse_event_args() [1/3]

xtd::forms::mouse_event_args::mouse_event_args ( )
default

Initializes a new instance of the MouseEventArgs class.

◆ mouse_event_args() [2/3]

xtd::forms::mouse_event_args::mouse_event_args ( xtd::forms::mouse_buttons button,
xtd::int32 clicks,
xtd::int32 x,
xtd::int32 y,
xtd::int32 delta )
inline

Initializes a new instance of the MouseEventArgs class.

Parameters
buttonOne of the xtd::forms::mouse_buttons values that indicate which mouse button was pressed.
clicksThe number of times a mouse button was pressed.
xThe x-coordinate of a mouse click, in pixels.
yThe y-coordinate of a mouse click, in pixels.
deltaA signed count of the number of detents the wheel has rotated.

◆ mouse_event_args() [3/3]

xtd::forms::mouse_event_args::mouse_event_args ( xtd::forms::mouse_buttons button,
xtd::int32 clicks,
const xtd::drawing::point & location,
xtd::int32 delta )
inline

Initializes a new instance of the MouseEventArgs class.

Parameters
buttonOne of the xtd::forms::mouse_buttons values that indicate which mouse button was pressed.
clicksThe number of times a mouse button was pressed.
locationThe location of a mouse click, in pixels.
deltaA signed count of the number of detents the wheel has rotated.

Member Function Documentation

◆ button()

auto xtd::forms::mouse_event_args::button ( ) const -> xtd::forms::mouse_buttons
inlinenodiscardnoexcept

Gets which mouse button was pressed.

Returns
One of the xtd::forms::mouse_buttons values.

◆ clicks()

auto xtd::forms::mouse_event_args::clicks ( ) const -> xtd::int32
inlinenodiscardnoexcept

Gets the number of times the mouse button was pressed and released.

Returns
An std::int32_t that contains the number of times the mouse button was pressed and released.

◆ delta()

auto xtd::forms::mouse_event_args::delta ( ) const -> xtd::int32
inlinenodiscardnoexcept

Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel.

Returns
A signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant.

◆ location()

auto xtd::forms::mouse_event_args::location ( ) const -> const xtd::drawing::point &
inlinenodiscardnoexcept

Gets the location of the mouse during the generating mouse event.

Returns
A xtd::drawing::point that contains the x- and y- mouse coordinates, in pixels, relative to the upper-left corner of the form.

◆ x()

auto xtd::forms::mouse_event_args::x ( ) const -> xtd::int32
inlinenodiscardnoexcept

Gets the x-coordinate of the mouse during the generating mouse event.

Returns
The x-coordinate of the mouse, in pixels.

◆ y()

auto xtd::forms::mouse_event_args::y ( ) const -> xtd::int32
inlinenodiscardnoexcept

Gets the y-coordinate of the mouse during the generating mouse event.

Returns
The y-coordinate of the mouse, in pixels.

The documentation for this class was generated from the following file: