xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
button_state.h
Go to the documentation of this file.
1 #pragma once
5 #include <xtd/ustring.h>
6 
8 namespace xtd {
10  namespace forms {
19  enum class button_state {
21  normal = 0b0,
23  inactive = 0b100000000,
25  pushed = 0b1000000000,
27  checked = 0b10000000000,
29  flat = 0b100000000000000,
32  };
33 
35  inline button_state& operator +=(button_state& lhs, button_state rhs) {lhs = static_cast<button_state>(static_cast<long long>(lhs) + static_cast<long long>(rhs)); return lhs;}
36  inline button_state& operator -=(button_state& lhs, button_state rhs) {lhs = static_cast<button_state>(static_cast<long long>(lhs) - static_cast<long long>(rhs)); return lhs;}
37  inline button_state& operator &=(button_state& lhs, button_state rhs) {lhs = static_cast<button_state>(static_cast<long long>(lhs) & static_cast<long long>(rhs)); return lhs;}
38  inline button_state& operator |=(button_state& lhs, button_state rhs) {lhs = static_cast<button_state>(static_cast<long long>(lhs) | static_cast<long long>(rhs)); return lhs;}
39  inline button_state& operator ^=(button_state& lhs, button_state rhs) {lhs = static_cast<button_state>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs)); return lhs;}
40  inline button_state operator +(button_state lhs, button_state rhs) {return static_cast<button_state>(static_cast<long long>(lhs) + static_cast<long long>(rhs));}
41  inline button_state operator -(button_state lhs, button_state rhs) {return static_cast<button_state>(static_cast<long long>(lhs) - static_cast<long long>(rhs));}
42  inline button_state operator ~(button_state rhs) {return static_cast<button_state>(~static_cast<long long>(rhs));}
43  inline button_state operator &(button_state lhs, button_state rhs) {return static_cast<button_state>(static_cast<long long>(lhs) & static_cast<long long>(rhs));}
44  inline button_state operator |(button_state lhs, button_state rhs) {return static_cast<button_state>(static_cast<long long>(lhs) | static_cast<long long>(rhs));}
45  inline button_state operator ^(button_state lhs, button_state rhs) {return static_cast<button_state>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs));}
46  inline std::ostream& operator<<(std::ostream& os, button_state value) {return os << to_string(value, {{button_state::normal, "normal"}, {button_state::inactive, "inactive"}, {button_state::pushed, "pushed"}, {button_state::checked, "checked"}, {button_state::flat, "flat"}});}
47  inline std::wostream& operator<<(std::wostream& os, button_state value) {return os << to_string(value, {{button_state::normal, L"normal"}, {button_state::inactive, L"inactive"}, {button_state::pushed, L"pushed"}, {button_state::checked, L"checked"}, {button_state::flat, L"flat"}});}
49  }
50 }
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
button_state
Specifies the appearance of a button.
Definition: button_state.h:19
@ inactive
The button is inactive (grayed).
@ checked
The button has a checked or latched appearance. Use this appearance to show that a toggle button has ...
@ flat
The button has a flat, two-dimensional appearance.
@ all
All flags except normal are set.
@ pushed
The button appears pressed.
@ normal
The button has its normal appearance (three-dimensional).
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.