VAPOR3
3.9.4
apps
vaporgui
AbstractWidgetGroup.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <initializer_list>
4
#include <vector>
5
9
10
template
<
class
This,
class
W
id
get>
class
AbstractWidgetGroup
{
11
protected
:
12
std::vector<Widget *>
_children
;
13
14
public
:
15
typedef
std::initializer_list<Widget *>
List
;
16
18
virtual
This *
Add
(Widget *w)
19
{
20
_children
.push_back(w);
21
return
(This *)
this
;
22
}
25
This *
AddM
(
const
List
&list)
26
{
27
for
(
const
auto
&w : list)
Add
(w);
28
return
(This *)
this
;
29
}
30
};
31
35
36
template
<
class
This,
class
W
id
get,
class
That>
class
WidgetGroupWrapper
:
public
AbstractWidgetGroup
<This, Widget> {
37
protected
:
38
That *
_group
;
39
40
public
:
41
WidgetGroupWrapper
(That *group) :
_group
(group) {}
42
43
virtual
This *
Add
(Widget *w)
override
44
{
45
_group
->Add(w);
46
return
AbstractWidgetGroup<This, Widget>::Add
(w);
47
}
48
};
AbstractWidgetGroup
Provides an interface that standardizes widget grouping classes.
Definition:
AbstractWidgetGroup.h:10
AbstractWidgetGroup::Add
virtual This * Add(Widget *w)
Adds a widget.
Definition:
AbstractWidgetGroup.h:18
AbstractWidgetGroup::List
std::initializer_list< Widget * > List
Definition:
AbstractWidgetGroup.h:15
AbstractWidgetGroup::_children
std::vector< Widget * > _children
Definition:
AbstractWidgetGroup.h:12
AbstractWidgetGroup::AddM
This * AddM(const List &list)
Definition:
AbstractWidgetGroup.h:25
WidgetGroupWrapper
Automates the creation of widget groups that wrap other widget groups.
Definition:
AbstractWidgetGroup.h:36
WidgetGroupWrapper::_group
That * _group
Definition:
AbstractWidgetGroup.h:38
WidgetGroupWrapper::WidgetGroupWrapper
WidgetGroupWrapper(That *group)
Definition:
AbstractWidgetGroup.h:41
WidgetGroupWrapper::Add
virtual This * Add(Widget *w) override
Adds a widget.
Definition:
AbstractWidgetGroup.h:43
Generated by
1.9.6