xtd 1.0.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;
55
57
61 [[nodiscard]] auto button() const noexcept -> xtd::forms::mouse_buttons {return button_;}
62
65 [[nodiscard]] auto clicks() const noexcept -> xtd::int32 {return clicks_;}
66
69 [[nodiscard]] auto delta() const noexcept -> xtd::int32 {return delta_;}
70
73 [[nodiscard]] auto location() const noexcept -> const xtd::drawing::point& {return location_;}
74
77 [[nodiscard]] auto x() const noexcept -> xtd::int32 {return location().x;}
78
81 [[nodiscard]] auto y() const noexcept -> xtd::int32 {return location().y;}
83
84 private:
85 friend class button;
86 friend class control;
87 friend class check_box;
88 friend class light_button;
89 friend class radio_button;
90 friend class toggle_button;
91 [[nodiscard]] static auto create(const xtd::forms::message& message, bool double_click_fired = false, xtd::int32 delta = 0) -> mouse_event_args;
93 xtd::drawing::point location_;
94 xtd::int32 clicks_ = 0;
95 xtd::int32 delta_ = 0;
96 };
97 }
98}
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
friend class button
The buttton data allows you to specify the box of a button control.
Definition mouse_event_args.hpp:85
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.
Definition mouse_event_args.hpp:53
auto y() const noexcept -> xtd::int32
Gets the y-coordinate of the mouse during the generating mouse event.
Definition mouse_event_args.hpp:81
auto delta() const noexcept -> xtd::int32
Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DEL...
Definition mouse_event_args.hpp:69
auto location() const noexcept -> const xtd::drawing::point &
Gets the location of the mouse during the generating mouse event.
Definition mouse_event_args.hpp:73
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.
Definition mouse_event_args.hpp:47
friend class toggle_button
The buttton data allows you to specify the box of a toggle_button control.
Definition mouse_event_args.hpp:90
mouse_event_args()=default
Initializes a new instance of the MouseEventArgs class.
auto clicks() const noexcept -> xtd::int32
Gets the number of times the mouse button was pressed and released.
Definition mouse_event_args.hpp:65
auto button() const noexcept -> xtd::forms::mouse_buttons
Gets which mouse button was pressed.
Definition mouse_event_args.hpp:61
auto x() const noexcept -> xtd::int32
Gets the x-coordinate of the mouse during the generating mouse event.
Definition mouse_event_args.hpp:77
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
std::int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:25
mouse_buttons
Specifies constants that define which mouse button was pressed. This enumeration has a flag attribute...
Definition mouse_buttons.hpp:22
@ none
No mouse button was pressed.
Definition mouse_buttons.hpp:24
Contains xtd::forms::message class.
Contains xtd::forms::mouse_buttons enum class.
The xtd::drawing namespace provides access to GDI+ basic graphics functionality. More advanced functi...
Definition actions_system_images.hpp:10
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional ...
Definition point.hpp:54
Implements a Windows message.
Definition message.hpp:33