Photon microGUI widgets library 0.6.0
Container.h
1#ifndef PHWIDGETS_CONTAINER_H
2#define PHWIDGETS_CONTAINER_H
3
4#include <photon/PtContainer.h>
5#include <photon/PtFillLayout.h>
6
7#include "./Basic.h"
8
9
10namespace PhWidgets
11{
18
22 class Container:
23 public Basic
24 {
25 public:
26
28 struct ThisArgs
29 {
31 struct ArgLong
32 {
34
44 {
45 container_flags = Pt_ARG_CONTAINER_FLAGS
46 };
47 };
48
50 struct ArgInt
51 {
53
63 {
64 layout_type = Pt_ARG_LAYOUT_TYPE
65 };
66 };
67
69 struct ArgBool
70 {
72
82 {
83 cursor_override = Pt_ARG_CURSOR_OVERRIDE
84 };
85 };
86
89 {
91
101 {
102 fill_layout_info = Pt_ARG_FILL_LAYOUT_INFO
103 };
104 };
105
108 {
110
120 {
121 grid_layout_info = Pt_ARG_GRID_LAYOUT_INFO
122 };
123 };
124
127 {
129
139 {
140 layout = Pt_ARG_LAYOUT
141 };
142 };
143
145 struct ArgPVoid
146 {
148
161 {
162 layout_info = Pt_ARG_LAYOUT_INFO
163 };
164 };
165
168 {
170
180 {
181 row_layout_info = Pt_ARG_ROW_LAYOUT_INFO
182 };
183 };
184
186 struct ArgPChar
187 {
189
199 {
200 title = Pt_ARG_TITLE,
201 title_font = Pt_ARG_TITLE_FONT
202 };
203 };
204
205 };
206
209 {
211 struct Callback
212 {
214
223 {
224 child_added_removed = Pt_CB_CHILD_ADDED_REMOVED,
225 child_getting_focus = Pt_CB_CHILD_GETTING_FOCUS,
226 child_losing_focus = Pt_CB_CHILD_LOSING_FOCUS,
227 layout = Pt_CB_LAYOUT,
228 resize = Pt_CB_RESIZE
229 };
230 };
231 };
232
234 struct ArgLong:
235 public ArgumentsEx<Basic::ArgLong>,
236 public ThisArgs::ArgLong
237 {
239 };
240
242 struct ArgInt:
243 public ThisArgs::ArgInt,
244 public ThisArgs::ArgBool
245 { };
246
250 { };
251
255 { };
256
260 { };
261
263 struct ArgPVoid:
264 public ArgumentsEx<Basic::ArgPVoid>,
265 public ThisArgs::ArgPVoid
266 {
268 };
269
273 { };
274
275
277 struct ArgPChar:
278 public ArgumentsEx<Basic::ArgPChar>,
279 public ThisArgs::ArgPChar
280 {
282 };
283
285 struct Callback:
286 public ArgumentsEx<Basic::Callback>,
288 {
290 };
291
293 struct Arguments:
294 public ArgLong,
295 public ArgInt,
296 public ArgPFillLayoutInfo,
297 public ArgPGridLayoutInfo,
299 public ArgPVoid,
300 public ArgPRowLayoutInfo,
301 public ArgPChar,
302 public Basic::Arguments
303 { };
304
306 struct Callbacks:
307 public Callback,
308 public Basic::Callbacks
309 { };
310
311 protected:
312 typedef ResourceFrom<Basic::WidgetResourcesSingleton>::
313 Define::String<ThisArgs::ArgPChar::eArgPChar>::
314 Define::Boolean<ThisArgs::ArgBool::eArgBool, bool>::
315 Define::Scalar<ThisArgs::ArgInt::eArgInt, int>::
316 Define::Struct<ThisArgs::ArgPFillLayoutInfo::eArgPFillLayoutInfo, PtFillLayoutInfo_t>::
317 Define::Struct<ThisArgs::ArgPGridLayoutInfo::eArgPGridLayoutInfo, PtGridLayoutInfo_t>::
318 Define::Struct<ThisArgs::ArgPLayoutDefinition::eArgPLayoutDefinition, PtLayoutDefinition_t>::
319 Define::Struct<ThisArgs::ArgPRowLayoutInfo::eArgPRowLayoutInfo, PtRowLayoutInfo_t>::
320 Define::Struct<ThisArgs::ArgPVoid::eArgPVoid, void*>::
321 Define::Flag<ThisArgs::ArgLong::eArgLong, long>::
322
323 Define::Link<ThisCallbacks::Callback::eCallback, PtCallback_t*>::
324
325 resource_type WidgetResourcesSingleton;
326
327 virtual void check();
328
329 Widget getActiveWidget() const;
330 void setActiveWidget(Widget);
331
332 public:
334
338 WidgetResourcesSingleton resource;
339
341
345 explicit Container(int abn);
346
348
352 explicit Container(PtWidget_t *wdg);
353
355
359 Container(const Container &other);
360
362
367
370
371
373
394 property<Widget>::
395 bind<Container, &Container::getActiveWidget, &Container::setActiveWidget> ActiveWidget;
396
398
400
407 };
408} // namespace PhWidgets
409
410
411#endif // PHWIDGETS_CONTAINER_H
A superclass of basic resources for most widgets.
Definition: Basic.h:41
Layout and geometry management for all container widgets.
Definition: Container.h:24
Container(int abn)
(constructor)
WidgetResourcesSingleton resource
Resources of the Container.
Definition: Container.h:338
Container(PtWidget_t *wdg)
(constructor)
Container(const Container &other)
(copy constructor)
Container & operator=(const Container &other)
Assigns value in Container widget.
property< Widget >::bind< Container, &Container::getActiveWidget, &Container::setActiveWidget > ActiveWidget
Gets or sets the active widget on the Container widget.
Definition: Container.h:395
An event, which raise a notification to registered subscribers (event handlers) that something of int...
Definition: Widget.h:132
Superclass for all widgets.
Definition: Widget.h:110
The main namespace for all widgets.
Definition: Basic.h:11
Contains resource IDs for Basic arguments.
Definition: Basic.h:47
Contains resource IDs for Basic callbacks.
Definition: Basic.h:217
Contains resource IDs for arguments of type int.
Definition: Container.h:245
Contains resource IDs for arguments of type long.
Definition: Container.h:237
Contains resource IDs for arguments of type char*.
Definition: Container.h:280
Contains resource IDs for arguments of type PtFillLayoutInfo_t.
Definition: Container.h:250
Contains resource IDs for arguments of type PtGridLayoutInfo_t.
Definition: Container.h:255
Contains resource IDs for arguments of type PtLayoutDefinition_t.
Definition: Container.h:260
Contains resource IDs for arguments of type PtRowLayoutInfo_t.
Definition: Container.h:273
Contains resource IDs for arguments of type void*.
Definition: Container.h:266
Contains resource IDs for all Container arguments.
Definition: Container.h:303
Contains resource IDs for callbacks of type PtCallback_t.
Definition: Container.h:288
Contains resource IDs for all Container callbacks.
Definition: Container.h:309
Contains resource IDs for Container arguments of type bool.
Definition: Container.h:70
eArgBool
Resource IDs for Container arguments of type bool.
Definition: Container.h:82
Contains resource IDs for Container arguments of type int.
Definition: Container.h:51
eArgInt
Resource IDs for Container arguments of type int.
Definition: Container.h:63
Contains resource IDs for Container arguments of type long.
Definition: Container.h:32
eArgLong
Resource IDs for Container arguments of type long.
Definition: Container.h:44
Contains resource IDs for Container arguments of type char*.
Definition: Container.h:187
eArgPChar
Resource IDs for Container arguments of type char*.
Definition: Container.h:199
Contains resource IDs for Container arguments of type PtFillLayoutInfo_t.
Definition: Container.h:89
eArgPFillLayoutInfo
Resource IDs for Container arguments of type PtFillLayoutInfo_t.
Definition: Container.h:101
Contains resource IDs for Container arguments of type PtGridLayoutInfo_t.
Definition: Container.h:108
eArgPGridLayoutInfo
Resource IDs for Container arguments of type PtGridLayoutInfo_t.
Definition: Container.h:120
Contains resource IDs for Container arguments of type PtLayoutDefinition_t.
Definition: Container.h:127
eArgPLayoutDefinition
Resource IDs for Container arguments of type PtLayoutDefinition_t.
Definition: Container.h:139
Contains resource IDs for Container arguments of type PtRowLayoutInfo_t.
Definition: Container.h:168
eArgPRowLayoutInfo
Resource IDs for Container arguments of type PtRowLayoutInfo_t.
Definition: Container.h:180
Contains resource IDs for Container arguments of type void*.
Definition: Container.h:146
eArgPVoid
Resource IDs for Container arguments of type void* that are stored in widget.
Definition: Container.h:161
Contains resource IDs for Container arguments.
Definition: Container.h:29
Contains resource IDs for Container callbacks of type PtCallback_t.
Definition: Container.h:212
eCallback
Resource IDs for Container arguments of type PtCallback_t.
Definition: Container.h:223
Contains resource IDs for Container callbacks.
Definition: Container.h:209