xtd 0.2.0
Loading...
Searching...
No Matches
mouse_event_args.h
Go to the documentation of this file.
1
4#pragma once
5#include "message.h"
6#include "mouse_buttons.h"
7#include <xtd/drawing/point>
8#include <xtd/event_args>
9#include <cstdint>
10
12namespace xtd {
14 namespace forms {
16 class button;
17 class control;
18 class check_box;
19 class light_button;
20 class radio_button;
21 class toggle_button;
23
33 public:
35
38 mouse_event_args() = default;
45 mouse_event_args(mouse_buttons button, int32 clicks, int32 x, int32 y, int32 delta) : button_(button), location_(x, y), clicks_(clicks), delta_(delta) {}
51 mouse_event_args(mouse_buttons button, int32 clicks, const drawing::point& location, int32 delta) : button_(button), location_(location), clicks_(clicks), delta_(delta) {}
53
56 mouse_event_args& operator =(const mouse_event_args& mouse_event_args) = default;
58
60
64 mouse_buttons button() const noexcept {return button_;}
65
68 int32 clicks() const noexcept {return clicks_;}
69
72 int32 delta() const noexcept {return delta_;}
73
76 const drawing::point& location() const noexcept {return location_;}
77
80 int32 x() const noexcept {return location().x();}
81
84 int32 y() const noexcept {return location().y();}
86
87 private:
88 friend class button;
89 friend class control;
90 friend class check_box;
91 friend class light_button;
92 friend class radio_button;
93 friend class toggle_button;
94 static mouse_event_args create(const message& message, bool double_click_fired = false, int32 delta = 0);
95 mouse_buttons button_ = mouse_buttons::none;
96 drawing::point location_;
97 int32 clicks_ = 0;
98 int32 delta_ = 0;
99 };
100 }
101}
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.h:54
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents a Windows button control.
Definition button.h:47
Represents a Windows check_box.
Definition check_box.h:43
Defines the base class for controls, which are components with visual representation.
Definition control.h:79
Represents a Windows light_button.
Definition light_button.h:43
Implements a Windows message.
Definition message.h:26
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.h:32
mouse_event_args(mouse_buttons button, int32 clicks, int32 x, int32 y, int32 delta)
Initializes a new instance of the MouseEventArgs class.
Definition mouse_event_args.h:45
mouse_buttons button() const noexcept
Gets which mouse button was pressed.
Definition mouse_event_args.h:64
int32 delta() const noexcept
Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DEL...
Definition mouse_event_args.h:72
const drawing::point & location() const noexcept
Gets the location of the mouse during the generating mouse event.
Definition mouse_event_args.h:76
mouse_event_args(mouse_buttons button, int32 clicks, const drawing::point &location, int32 delta)
Initializes a new instance of the MouseEventArgs class.
Definition mouse_event_args.h:51
mouse_event_args()=default
Initializes a new instance of the MouseEventArgs class.
int32 x() const noexcept
Gets the x-coordinate of the mouse during the generating mouse event.
Definition mouse_event_args.h:80
int32 y() const noexcept
Gets the y-coordinate of the mouse during the generating mouse event.
Definition mouse_event_args.h:84
int32 clicks() const noexcept
Gets the number of times the mouse button was pressed and released.
Definition mouse_event_args.h:68
Enables the user to select a single option from a group of choices when paired with other xtd::forms:...
Definition radio_button.h:38
Represents a Windows toggle_button.
Definition toggle_button.h:42
#define forms_export_
Define shared library export.
Definition forms_export.h:13
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.h:23
xtd::forms::style_sheets::control toggle_button
The buttton data allows you to specify the box of a toggle_button control.
Definition toggle_button.h:23
int_least32_t int32
Represents a 32-bit signed integer.
Definition types.h:131
@ control
The left or right CTRL modifier key.
@ y
The Y key.
@ x
The X key.
mouse_buttons
Specifies constants that define which mouse button was pressed. This enumeration has a flag attribute...
Definition mouse_buttons.h:20
@ location
Specifies that both the x and y coordinates of the control are defined.
Contains xtd::forms::message class.
Contains xtd::forms::mouse_buttons enum class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10