xtd 0.2.0
Loading...
Searching...
No Matches
mouse_event_args.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "message.hpp"
6#include "mouse_buttons.hpp"
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
35 public:
37
40 mouse_event_args() = default;
47 mouse_event_args(mouse_buttons button, int32 clicks, int32 x, int32 y, int32 delta) : button_(button), location_(x, y), clicks_(clicks), delta_(delta) {}
53 mouse_event_args(mouse_buttons button, int32 clicks, const drawing::point& location, int32 delta) : button_(button), location_(location), clicks_(clicks), delta_(delta) {}
55
58 mouse_event_args& operator =(const mouse_event_args& mouse_event_args) = default;
60
62
66 mouse_buttons button() const noexcept {return button_;}
67
70 int32 clicks() const noexcept {return clicks_;}
71
74 int32 delta() const noexcept {return delta_;}
75
78 const drawing::point& location() const noexcept {return location_;}
79
82 int32 x() const noexcept {return location().x();}
83
86 int32 y() const noexcept {return location().y();}
88
89 private:
90 friend class button;
91 friend class control;
92 friend class check_box;
93 friend class light_button;
94 friend class radio_button;
95 friend class toggle_button;
96 static mouse_event_args create(const message& message, bool double_click_fired = false, int32 delta = 0);
97 mouse_buttons button_ = mouse_buttons::none;
98 drawing::point location_;
99 int32 clicks_ = 0;
100 int32 delta_ = 0;
101 };
102 }
103}
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.hpp:18
Represents a Windows button control.
Definition button.hpp:49
Represents a Windows check_box.
Definition check_box.hpp:45
Defines the base class for controls, which are components with visual representation.
Definition control.hpp:81
Represents a Windows light_button.
Definition light_button.hpp:45
Implements a Windows message.
Definition message.hpp:28
Provides data for the xtd::forms::control::mouse_up, xtd::forms::control::mouse_down,...
Definition mouse_event_args.hpp:34
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.hpp:47
mouse_buttons button() const noexcept
Gets which mouse button was pressed.
Definition mouse_event_args.hpp:66
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.hpp:74
const drawing::point & location() const noexcept
Gets the location of the mouse during the generating mouse event.
Definition mouse_event_args.hpp:78
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.hpp:53
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.hpp:82
int32 y() const noexcept
Gets the y-coordinate of the mouse during the generating mouse event.
Definition mouse_event_args.hpp:86
int32 clicks() const noexcept
Gets the number of times the mouse button was pressed and released.
Definition mouse_event_args.hpp:70
Enables the user to select a single option from a group of choices when paired with other xtd::forms:...
Definition radio_button.hpp:40
Represents a Windows toggle_button.
Definition toggle_button.hpp:44
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25
xtd::forms::style_sheets::control toggle_button
The buttton data allows you to specify the box of a toggle_button control.
Definition toggle_button.hpp:25
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
@ 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.hpp:22
@ 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.hpp:12
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10