Photon microGUI widgets library 0.6.0
Numeric.h
1#ifndef PHWIDGETS_NUMERIC_H
2#define PHWIDGETS_NUMERIC_H
3
4#include <photon/PtNumeric.h>
5
6#include "./Compound.h"
7
8
9namespace PhWidgets
10{
17
26 class Numeric:
27 public Compound
28 {
29 public:
30
32 struct ThisArgs
33 {
35 struct ArgPChar
36 {
38
48 {
49 numeric_prefix = Pt_ARG_NUMERIC_PREFIX,
50 numeric_suffix = Pt_ARG_NUMERIC_SUFFIX
51 };
52 };
53
56 {
58
68 {
69 numeric_spacing = Pt_ARG_NUMERIC_SPACING,
70 numeric_updown_width = Pt_ARG_NUMERIC_UPDOWN_WIDTH
71 };
72
74
84 {
85 numeric_flags = Pt_ARG_NUMERIC_FLAGS
86 };
87 };
88 };
89
91 struct ThisFlags
92 {
94
102 {
103 AutoHighlight = Pt_NUMERIC_AUTO_HIGHLIGHT,
104 EnableUpDown = Pt_NUMERIC_ENABLE_UPDOWN,
105 Hexadecimal = Pt_NUMERIC_HEXADECIMAL,
106 UseSeparators = Pt_NUMERIC_USE_SEPARATORS,
107 Wrap = Pt_NUMERIC_WRAP
108 };
109 };
110
113 public ArgumentsEx<Compound::ArgUnsignedShort>,
115 {
118 };
119
121 struct ArgPChar:
122 public ArgumentsEx<Compound::ArgPChar>,
123 public ThisArgs::ArgPChar
124 {
126 };
127
129 struct Arguments:
130 public ArgUnsignedShort,
131 public ArgPChar,
133 { };
134
136 struct Flags:
137 public ThisFlags,
138 public Compound::Flags
139 { };
140
141 typedef ResourceFrom<Compound::WidgetResourcesSingleton>::
142 Define::String<ThisArgs::ArgPChar::eArgPChar>::
143 Define::Scalar<ThisArgs::ArgUnsignedShort::eArgUnsignedShort, unsigned short>::
144 Define::Flag<ThisArgs::ArgUnsignedShort::eArgUnsignedShortFlag, unsigned short>::
145
146 resource_type WidgetResourcesSingleton;
147
148 protected:
149 virtual void check();
150
151 public:
153
157 WidgetResourcesSingleton resource;
158
160
164 explicit Numeric(int abn);
165
167
171 explicit Numeric(PtWidget_t *wdg);
172
174
178 Numeric(const Numeric &other);
179
181
185 Numeric &operator=(const Numeric &other);
186
189
190
192
193 };
194
195} // namespace PhWidgets
196
197cppbitmasks::bitmask<unsigned short, PhWidgets::Numeric::Flags::eNumericFlags> operator|(const PhWidgets::Numeric::Flags::eNumericFlags &flag1, const PhWidgets::Numeric::Flags::eNumericFlags &flag2);
198cppbitmasks::bitmask<unsigned short, PhWidgets::Numeric::Flags::eNumericFlags> operator&(const PhWidgets::Numeric::Flags::eNumericFlags &flag1, const PhWidgets::Numeric::Flags::eNumericFlags &flag2);
199cppbitmasks::bitmask<unsigned short, PhWidgets::Numeric::Flags::eNumericFlags> operator^(const PhWidgets::Numeric::Flags::eNumericFlags &flag1, const PhWidgets::Numeric::Flags::eNumericFlags &flag2);
200
201
202#endif // PHWIDGETS_NUMERIC_H
Superclass for all compound widgets.
Definition: Compound.h:25
A superclass for numeric widgets.
Definition: Numeric.h:28
Numeric(const Numeric &other)
(copy constructor)
Numeric(int abn)
(constructor)
WidgetResourcesSingleton resource
Resources of the Numeric.
Definition: Numeric.h:157
Numeric(PtWidget_t *wdg)
(constructor)
Numeric & operator=(const Numeric &other)
Assigns value in Numeric widget.
The main namespace for all widgets.
Definition: Basic.h:11
Contains flags for all Basic resources.
Definition: Basic.h:269
Contains resource IDs for all Compound arguments.
Definition: Compound.h:31
Contains resource IDs for arguments of type char*.
Definition: Numeric.h:124
Contains resource IDs for arguments of type unsigned short.
Definition: Numeric.h:115
Contains resource IDs for all Numeric arguments.
Definition: Numeric.h:133
Contains flags for all Numeric resources.
Definition: Numeric.h:139
Contains resource IDs for Numeric arguments of type char*.
Definition: Numeric.h:36
eArgPChar
Resource IDs for Numeric arguments of type char*.
Definition: Numeric.h:48
Contains resource IDs for Numeric arguments of type unsigned short.
Definition: Numeric.h:56
eArgUnsignedShort
Resource IDs for Numeric arguments of type unsigned short.
Definition: Numeric.h:68
eArgUnsignedShortFlag
Resource IDs for Numeric flags of type unsigned short.
Definition: Numeric.h:84
Contains resource IDs for Numeric arguments.
Definition: Numeric.h:33
Contains flags for Numeric resources.
Definition: Numeric.h:92
eNumericFlags
Numeric flags for Numeric resource Numeric::Arguments::cbox_flags.
Definition: Numeric.h:102
@ EnableUpDown
Display the up/down buttons.
Definition: Numeric.h:104
@ UseSeparators
Insert comma separators in values (e.g. 1,000).
Definition: Numeric.h:106
@ Hexadecimal
Display the value as a hexadecimal number (applies only to NumericInteger).
Definition: Numeric.h:105
@ Wrap
Wrap numbers from minimum to maximum and from maximum to minimum.
Definition: Numeric.h:107
@ AutoHighlight
Autohighlight text when selected.
Definition: Numeric.h:103