xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
mouse_buttons.h
Go to the documentation of this file.
1
4#pragma once
5#include <xtd/ustring.h>
6
8namespace xtd {
10 namespace forms {
18 enum class mouse_buttons {
20 none = 0,
22 left = 0x100000,
24 right = 0x200000,
26 middle = 0x400000,
28 x_button1 = 0x800000,
30 x_button2 = 0x1000000
31 };
32
34 inline mouse_buttons& operator +=(mouse_buttons& lhs, mouse_buttons rhs) {lhs = static_cast<mouse_buttons>(static_cast<int>(lhs) + static_cast<int>(rhs)); return lhs;}
35 inline mouse_buttons& operator -=(mouse_buttons& lhs, mouse_buttons rhs) {lhs = static_cast<mouse_buttons>(static_cast<int>(lhs) - static_cast<int>(rhs)); return lhs;}
36 inline mouse_buttons& operator &=(mouse_buttons& lhs, mouse_buttons rhs) {lhs = static_cast<mouse_buttons>(static_cast<int>(lhs) & static_cast<int>(rhs)); return lhs;}
37 inline mouse_buttons& operator |=(mouse_buttons& lhs, mouse_buttons rhs) {lhs = static_cast<mouse_buttons>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
38 inline mouse_buttons& operator ^=(mouse_buttons& lhs, mouse_buttons rhs) {lhs = static_cast<mouse_buttons>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return lhs;}
39 inline mouse_buttons operator +(mouse_buttons lhs, mouse_buttons rhs) {return static_cast<mouse_buttons>(static_cast<int>(lhs) + static_cast<int>(rhs));}
40 inline mouse_buttons operator -(mouse_buttons lhs, mouse_buttons rhs) {return static_cast<mouse_buttons>(static_cast<int>(lhs) - static_cast<int>(rhs));}
41 inline mouse_buttons operator ~(mouse_buttons rhs) {return static_cast<mouse_buttons>(~static_cast<int>(rhs));}
42 inline mouse_buttons operator &(mouse_buttons lhs, mouse_buttons rhs) {return static_cast<mouse_buttons>(static_cast<int>(lhs) & static_cast<int>(rhs));}
43 inline mouse_buttons operator |(mouse_buttons lhs, mouse_buttons rhs) {return static_cast<mouse_buttons>(static_cast<int>(lhs) | static_cast<int>(rhs));}
44 inline mouse_buttons operator ^(mouse_buttons lhs, mouse_buttons rhs) {return static_cast<mouse_buttons>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
45 inline std::ostream& operator<<(std::ostream& os, mouse_buttons value) {return os << to_string(value, {{mouse_buttons::none, "none"}, {mouse_buttons::left, "left"}, {mouse_buttons::right, "right"}, {mouse_buttons::middle, "middle"}, {mouse_buttons::x_button1, "x_button1"}, {mouse_buttons::x_button2, "x_button2"}});}
46 inline std::wostream& operator<<(std::wostream& os, mouse_buttons value) {return os << to_string(value, {{mouse_buttons::none, L"none"}, {mouse_buttons::left, L"left"}, {mouse_buttons::right, L"right"}, {mouse_buttons::middle, L"middle"}, {mouse_buttons::x_button1, L"x_button1"}, {mouse_buttons::x_button2, L"x_button2"}});}
48 }
49}
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition to_string.h:37
mouse_buttons
Specifies constants that define which mouse button was pressed. This enumeration has a flag attribute...
Definition mouse_buttons.h:18
@ none
The cause of the closure was not defined or could not be determined.
@ right
The Microsoft Windows Task Manager is closing the application.
@ left
The user is closing the form through the user interface (UI), for example by clicking the Close butto...
@ none
No mouse button was pressed.
@ middle
he middle mouse button was pressed.
@ right
The right mouse button was pressed.
@ left
The left mouse button was pressed.
@ x_button1
The first XButton (XBUTTON1) on Microsoft IntelliMouse Explorer was pressed.
@ x_button2
The second XButton (XBUTTON2) on Microsoft IntelliMouse Explorer was pressed.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::ustring class.