xtd - Reference Guide  0.2.0
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,
31  all = inactive|pushed|checked|flat,
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 }
The button appears pressed.
The default appearance defined by the control class.
The button has a checked or latched appearance. Use this appearance to show that a toggle button has ...
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
All flags except normal are set.
The button has a flat, two-dimensional appearance.
Contains xtd::ustring class.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
button_state
Specifies the appearance of a button.
Definition: button_state.h:19
The button is inactive (grayed).
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