ManaPlus
src
gui
widgets
widgetgroup.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2012-2019 The ManaPlus Developers
4
* Copyright (C) 2019-2021 Andrei Karas
5
*
6
* This file is part of The ManaPlus Client.
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef GUI_WIDGETS_WIDGETGROUP_H
23
#define GUI_WIDGETS_WIDGETGROUP_H
24
25
#include "
gui/widgets/container.h
"
26
27
#include "
listeners/actionlistener.h
"
28
#include "
listeners/widgetlistener.h
"
29
30
#include "
localconsts.h
"
31
32
class
WidgetGroup
notfinal
:
public
Container
,
33
public
WidgetListener
,
34
public
ActionListener
35
{
36
public
:
37
A_DELETE_COPY
(
WidgetGroup
)
38
39
virtual
void
addButton
(
const
std::string &
restrict
text,
40
const
std::string &
restrict
tag,
41
const
bool
pressed);
42
43
void
action
(
const
ActionEvent
&event)
override
;
44
45
virtual
void
addWidget
(
Widget
*
const
widget,
46
const
int
spacing);
47
48
void
clear
()
override
final
;
49
50
void
widgetResized
(
const
Event
&event)
override
final
;
51
52
virtual
Widget
*
createWidget
(
const
std::string &name,
53
const
bool
pressed)
54
const
A_WARN_UNUSED
= 0;
55
56
protected
:
57
WidgetGroup
(
const
Widget2
*
const
widget,
58
const
std::string &group,
59
const
int
height,
60
const
int
spacing);
61
62
int
mSpacing
;
63
int
mCount
;
64
std::string
mGroup
;
65
66
private
:
67
int
mLastX
;
68
};
69
70
#endif
// GUI_WIDGETS_WIDGETGROUP_H
actionlistener.h
ActionEvent
Definition:
actionevent.h:98
ActionListener
Definition:
actionlistener.h:79
Container
Definition:
container.h:39
Event
Definition:
event.h:79
Widget2
Definition:
widget2.h:37
WidgetGroup
Definition:
widgetgroup.h:35
WidgetGroup::mLastX
int mLastX
Definition:
widgetgroup.h:67
WidgetGroup::addWidget
virtual void addWidget(Widget *const widget, const int spacing)
Definition:
widgetgroup.cpp:67
WidgetGroup::addButton
virtual void addButton(const std::string &text, const std::string &tag, const bool pressed)
Definition:
widgetgroup.cpp:42
WidgetGroup::mGroup
std::string mGroup
Definition:
widgetgroup.h:64
WidgetGroup::WidgetGroup
WidgetGroup(const Widget2 *const widget, const std::string &group, const int height, const int spacing)
Definition:
widgetgroup.cpp:26
WidgetGroup::clear
void clear()
Definition:
widgetgroup.cpp:79
WidgetGroup::mCount
int mCount
Definition:
widgetgroup.h:63
WidgetGroup::createWidget
virtual Widget * createWidget(const std::string &name, const bool pressed) const =0
WidgetGroup::widgetResized
void widgetResized(const Event &event)
Definition:
widgetgroup.cpp:86
WidgetGroup::mSpacing
int mSpacing
Definition:
widgetgroup.h:62
WidgetGroup::action
void action(const ActionEvent &event)
Definition:
widgetgroup.cpp:58
WidgetListener
Definition:
widgetlistener.h:81
Widget
Definition:
widget.h:99
container.h
localconsts.h
restrict
#define restrict
Definition:
localconsts.h:165
A_WARN_UNUSED
#define A_WARN_UNUSED
Definition:
localconsts.h:161
notfinal
#define notfinal
Definition:
localconsts.h:261
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
widgetlistener.h
Generated on Wed Mar 17 2021 19:19:07 for ManaPlus by
1.9.1