Photon microGUI widgets library 0.6.0
NumericFloat.h
1#ifndef PHWIDGETS_NUMERIC_FLOAT_H
2#define PHWIDGETS_NUMERIC_FLOAT_H
3
4#include <photon/PtNumericFloat.h>
5
6#include "./Numeric.h"
7
8
9namespace PhWidgets
10{
17
23 public Numeric
24 {
25 public:
26
28 struct ThisArgs
29 {
31 struct ArgInt
32 {
34
44 {
45 numeric_precision = Pt_ARG_NUMERIC_PRECISION
46 };
47 };
48
49 struct ArgDoubleP
50 {
51 enum eArgDoubleP
52 {
53 numeric_increment = Pt_ARG_NUMERIC_INCREMENT,
54 numeric_max = Pt_ARG_NUMERIC_MAX,
55 numeric_min = Pt_ARG_NUMERIC_MIN,
56 numeric_value = Pt_ARG_NUMERIC_VALUE
57 };
58 };
59
60
61 };
62
65 {
67 struct Callback
68 {
70
79 {
80 numeric_changed = Pt_CB_NUMERIC_CHANGED
81 };
82 };
83 };
84
86 struct ArgInt:
87 public ThisArgs::ArgInt
88 { };
89
90 struct ArgDoubleP:
91 public ThisArgs::ArgDoubleP
92 { };
93
95 struct Callback:
96 public ArgumentsEx<ThisCallbacks::Callback>,
98 {
100 };
101
103 struct Arguments:
104 public ArgInt,
105 public ArgDoubleP,
106 public Numeric::Arguments
107 { };
108
110 struct Callbacks:
111 public Callback,
112 public Numeric::Callbacks
113 { };
114
115
116 protected:
117 typedef ResourceFrom<Numeric::WidgetResourcesSingleton>::
118 Define::Struct<ThisArgs::ArgDoubleP::eArgDoubleP, double>::
119 Define::Scalar<ThisArgs::ArgInt::eArgInt, int>::
120
121 Define::Link<ThisCallbacks::Callback::eCallback, PtCallback_t*>::
122
123 resource_type WidgetResourcesSingleton;
124
125 virtual void check();
126
127 double getValue() const;
128 void setValue(double val);
129
130 double getMaxValue() const;
131 void setMaxValue(double val);
132
133 double getMinValue() const;
134 void setMinValue(double val);
135
136
137 public:
139
143 WidgetResourcesSingleton resource;
144
146
150 explicit NumericFloat(int abn);
151
153
157 explicit NumericFloat(PtWidget_t *wdg);
158
160
165
167
172
175
176 property<double>::bind<NumericFloat, &NumericFloat::getValue, &NumericFloat::setValue> Value;
177 property<double>::bind<NumericFloat, &NumericFloat::getMaxValue, &NumericFloat::setMaxValue> MaxValue;
178 property<double>::bind<NumericFloat, &NumericFloat::getMinValue, &NumericFloat::setMinValue> MinValue;
180
182
183 };
184
185} // namespace PhWidgets
186
187
188#endif // PHWIDGETS_NUMERIC_FLOAT_H
Floating-point numeric widget.
Definition: NumericFloat.h:24
NumericFloat(int abn)
(constructor)
WidgetResourcesSingleton resource
Resources of the NumericFloat.
Definition: NumericFloat.h:143
NumericFloat & operator=(const NumericFloat &other)
Assigns value in NumericFloat widget.
NumericFloat(const NumericFloat &other)
(copy constructor)
NumericFloat(PtWidget_t *wdg)
(constructor)
A superclass for numeric widgets.
Definition: Numeric.h:28
An event, which raise a notification to registered subscribers (event handlers) that something of int...
Definition: Widget.h:132
The main namespace for all widgets.
Definition: Basic.h:11
Contains resource IDs for Basic callbacks.
Definition: Basic.h:217
Contains resource IDs for callbacks of type PtCallback_t.
Definition: Container.h:288
eCallback
Resource IDs for Container arguments of type PtCallback_t.
Definition: Container.h:223
Contains resource IDs for all Numeric arguments.
Definition: Numeric.h:133
Contains resource IDs for arguments of type int.
Definition: NumericFloat.h:88
Contains resource IDs for all NumericFloat arguments.
Definition: NumericFloat.h:107
Contains resource IDs for callbacks of type PtCallback_t.
Definition: NumericFloat.h:98
Contains resource IDs for all NumericFloat callbacks.
Definition: NumericFloat.h:113
Contains resource IDs for NumericFloat arguments of type int.
Definition: NumericFloat.h:32
eArgInt
Resource IDs for NumericFloat arguments of type long.
Definition: NumericFloat.h:44
Contains resource IDs for NumericFloat arguments.
Definition: NumericFloat.h:29
Contains resource IDs for NumericFloat callbacks of type PtCallback_t.
Definition: NumericFloat.h:68
eCallback
Resource IDs for NumericFloat arguments of type PtCallback_t.
Definition: NumericFloat.h:79
Contains resource IDs for NumericFloat callbacks.
Definition: NumericFloat.h:65