Photon microGUI widgets library 0.6.0
Window.h
1#ifndef PHWIDGETS_WINDOW_H
2#define PHWIDGETS_WINDOW_H
3
4#include <photon/PtWindow.h>
5
6#include "./Disjoint.h"
7
8
9namespace PhWidgets
10{
17
39 class Window:
40 public Disjoint
41 {
42 public:
43
45 struct ThisArgs
46 {
48 struct ArgShort
49 {
51
61 {
62 max_height = Pt_ARG_MAX_HEIGHT,
64
65 max_width = Pt_ARG_MAX_WIDTH,
67
68 min_height = Pt_ARG_MIN_HEIGHT,
70
71 min_width = Pt_ARG_MIN_WIDTH
73 };
74 };
75
77 struct ArgColor
78 {
80
90 {
91 window_active_color = Pt_ARG_WINDOW_ACTIVE_COLOR,
93
94 window_inactive_color = Pt_ARG_WINDOW_INACTIVE_COLOR,
96
97 window_title_color = Pt_ARG_WINDOW_TITLE_COLOR
99
100 };
101 };
102
104 struct ArgPChar
105 {
107
117 {
118 window_title = Pt_ARG_WINDOW_TITLE,
119 window_help_root = Pt_ARG_WINDOW_HELP_ROOT
120
121 };
122 };
123 };
124
127 {
129 struct Callback
130 {
132
141 {
142 window =
143 Pt_CB_WINDOW,
145
147 Pt_CB_WINDOW_CLOSING,
151
153 Pt_CB_WINDOW_OPENING,
156
158 Pt_CB_WINDOW_TRANSPORT
160 };
161 };
162 };
163
165 struct ArgShort:
166 public ThisArgs::ArgShort
167 { };
168
170 struct ArgColor:
171 public ArgumentsEx<Disjoint::ArgColor>,
172 public ThisArgs::ArgColor
173 {
175 };
176
178 struct ArgPChar:
179 public ArgumentsEx<Disjoint::ArgPChar>,
180 public ThisArgs::ArgPChar
181 {
183 };
184
186 struct Callback:
187 public ArgumentsEx<ThisCallbacks::Callback>,
188 public Disjoint::Callback
189 {
191 };
192
194 struct Arguments:
195 public ArgShort,
196 public ArgColor,
197 public ArgPChar,
199 { };
200
202 struct Callbacks:
203 public Callback,
205 { };
206
207 protected:
208 typedef ResourceFrom<Disjoint::WidgetResourcesSingleton>::
209 Define::Scalar<ThisArgs::ArgShort::eArgShort, short>::
210 Define::Color<ThisArgs::ArgColor::eArgColor>::
211 Define::String<ThisArgs::ArgPChar::eArgPChar>::
212
213 Define::Link<ThisCallbacks::Callback::eCallback, PtCallback_t*>::
214
215 resource_type WidgetResourcesSingleton;
216
217 virtual void check();
218
219 //for properties:
220
221 void setTitle(std::string);
222 std::string getTitle() const;
223
224 public:
226
230 explicit Window(int abn);
231
233
237 explicit Window(PtWidget_t *wdg);
238
240
244 Window(const Window &other);
245
247
251 Window &operator=(const Window &other);
252
254
258 WidgetResourcesSingleton resource;
259
262
263
265
272 property<std::string>::bind<Window, &Window::getTitle, &Window::setTitle> Title;
273
274
276
278
282 };
283} // namespace PhWidgets
284
285
286#endif // PHWIDGETS_WINDOW_H
Superclass for disjoint widgets.
Definition: Disjoint.h:25
An event, which raise a notification to registered subscribers (event handlers) that something of int...
Definition: Widget.h:132
An Application window that's managed by the Photon window manager.
Definition: Window.h:41
WidgetResourcesSingleton resource
Resources of the Window.
Definition: Window.h:258
Window(PtWidget_t *wdg)
(constructor)
Window(const Window &other)
(copy constructor)
Window(int abn)
(constructor)
property< std::string >::bind< Window, &Window::getTitle, &Window::setTitle > Title
Gets or sets a window's title.
Definition: Window.h:272
Window & operator=(const Window &other)
Assigns value in Window.
The main namespace for all widgets.
Definition: Basic.h:11
eCallback
Resource IDs for Container arguments of type PtCallback_t.
Definition: Container.h:223
Contains resource IDs for all Disjoint arguments.
Definition: Disjoint.h:100
Contains resource IDs for Disjoint callbacks of type PtCallback_t.
Definition: Disjoint.h:92
Contains resource IDs for all Disjoint callbacks.
Definition: Disjoint.h:106
Contains resource IDs for arguments of type PgColor_t.
Definition: Window.h:173
Contains resource IDs for arguments of type char*< >.
Definition: Window.h:181
Contains resource IDs for arguments of type short.
Definition: Window.h:167
Contains resource IDs for all Window arguments.
Definition: Window.h:199
Contains resource IDs for callbacks of type PtCallback_t.
Definition: Window.h:189
Contains resource IDs for all Window callbacks.
Definition: Window.h:205
Contains resource IDs for Window arguments of type PgColor_t.
Definition: Window.h:78
eArgColor
Resource IDs for Window arguments of type PgColor_t.
Definition: Window.h:90
@ window_active_color
Definition: Window.h:91
@ window_title_color
Definition: Window.h:97
@ window_inactive_color
Definition: Window.h:94
Contains resource IDs for Window arguments of type char*.
Definition: Window.h:105
eArgPChar
Resource IDs for Window arguments of type char*.
Definition: Window.h:117
@ window_title
The string that the Window Manager displays in the title bar.
Definition: Window.h:118
@ window_help_root
Defines the root topic path for the Window.
Definition: Window.h:119
Contains resource IDs for Window arguments of type short.
Definition: Window.h:49
eArgShort
Resource IDs for Window arguments of type short.
Definition: Window.h:61
@ max_width
Definition: Window.h:65
@ min_width
Definition: Window.h:71
@ max_height
Definition: Window.h:62
@ min_height
Definition: Window.h:68
Contains resource IDs for Window arguments.
Definition: Window.h:46
Contains resource IDs for Window callbacks of type PtCallback_t.
Definition: Window.h:130
eCallback
Resource IDs for Window arguments of type PtCallback_t.
Definition: Window.h:141
@ window_closing
Definition: Window.h:146
@ window_opening
Definition: Window.h:152
@ window_transport
Definition: Window.h:157
Contains resource IDs for Window callbacks.
Definition: Window.h:127