Photon microGUI widgets library 0.6.0
Button.h
1#ifndef PHWIDGETS_BUTTON_H
2#define PHWIDGETS_BUTTON_H
3
4#include <photon/PtButton.h>
5
6#include "./Label.h"
7
8
9namespace PhWidgets
10{
17
22 class Button:
23 public Label
24 {
25
26 public:
27
29 struct ThisArgs
30 {
32 struct ArgColor
33 {
35
45 {
46 arm_color = Pt_ARG_ARM_COLOR
47 };
48 };
49
52 {
54
64 {
65 arm_fill = Pt_ARG_ARM_FILL
66 };
67 };
68
70 struct ArgPImage
71 {
73
83 {
84 arm_image = Pt_ARG_ARM_IMAGE
87 };
88 };
89
90 };
91
93 struct ArgColor:
94 public ArgumentsEx<Label::ArgColor>,
96 {
98 };
99
102 public ArgumentsEx<Label::ArgUnsignedChar>,
104 {
106 };
107
109 struct ArgPImage:
110 public ArgumentsEx<Label::ArgPImage>,
112 {
114 };
115
117 struct Arguments:
118 public ArgColor,
119 public ArgUnsignedChar,
120 public ArgPImage,
121 public Label::Arguments
122 {
123 };
124
125 protected:
126 typedef ResourceFrom<Label::WidgetResourcesSingleton>::
127 Define::Image<ArgPImage::eArgPImage>::
128 Define::Color<ThisArgs::ArgColor::eArgColor>::
129 Define::Scalar<ThisArgs::ArgUnsignedChar::eArgUnsignedChar, unsigned char>::
130
131 resource_type WidgetResourcesSingleton;
132
133 virtual void check();
134
135
136 public:
138
142 WidgetResourcesSingleton resource;
143
145
149 explicit Button(int abn);
150
152
156 explicit Button(PtWidget_t *wdg);
157
159
163 Button(const Button &other);
164
166
170 Button &operator=(const Button &other);
171
174
175
177
192 phproperty<Drawing::Color>::bind<Button, ArgColor::eArgColor, Arguments::arm_color> ArmColor;
193
195
206
208 };
209
210} // namespace PhWidgets
211
212
213#endif // PHWIDGETS_BUTTON_H
A button for initiating an action.
Definition: Button.h:24
Button(PtWidget_t *wdg)
(constructor)
Button(const Button &other)
(copy constructor)
WidgetResourcesSingleton resource
Resources of the Button.
Definition: Button.h:142
phproperty< bool >::bind< Button, ArgUnsignedChar::eArgUnsignedChar, Arguments::arm_fill > ArmFill
Determines whether or not to use Button::ArmColor as the background color when the Button is armed (p...
Definition: Button.h:205
Button(int abn)
(constructor)
Button & operator=(const Button &other)
Assigns value in Button widget.
phproperty< Drawing::Color >::bind< Button, ArgColor::eArgColor, Arguments::arm_color > ArmColor
Gets or sets the color of the widget when the Button is armed (pressed in).
Definition: Button.h:192
A text, bitmap, or image label.
Definition: Label.h:151
The main namespace for all widgets.
Definition: Basic.h:11
Contains resource IDs for arguments of type PgColor_t.
Definition: Button.h:96
Contains resource IDs for arguments of type PhImage_t.
Definition: Button.h:112
Contains resource IDs for arguments of type unsigned char.
Definition: Button.h:104
Contains resource IDs for all Button arguments.
Definition: Button.h:122
Contains resource IDs for Button arguments of type PgColor_t.
Definition: Button.h:33
eArgColor
Resource IDs for Button arguments of type PgColor_t.
Definition: Button.h:45
@ arm_color
The background color used when the button is armed (pressed in).
Definition: Button.h:46
Contains resource IDs for Button arguments of type PhImage_t.
Definition: Button.h:71
eArgPImage
Resource IDs for Button arguments of type PhImage_t.
Definition: Button.h:83
@ arm_image
Definition: Button.h:84
Contains resource IDs for Button arguments of type unsigned char.
Definition: Button.h:52
eArgUnsignedChar
Resource IDs for Button arguments of type unsigned char.
Definition: Button.h:64
@ arm_fill
Determines whether or not to use Arguments::arm_color as the background color when the button is arme...
Definition: Button.h:65
Contains resource IDs for Button arguments.
Definition: Button.h:30
Contains resource IDs for all Label arguments.
Definition: Label.h:445