ManaPlus
setupbuttonitem.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-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 
23 
24 #include "gui/widgets/button.h"
27 
29 
30 #include "debug.h"
31 
33  const std::string &restrict description,
34  const std::string &restrict actionEventId,
35  SetupTabScroll *restrict const parent,
36  const std::string &restrict eventName,
37  ActionListener *const listener) :
38  SetupItem(text, description, "", parent, eventName, MainConfig_false),
39  mHorizont(nullptr),
40  mButton(nullptr)
41 {
42  mValueType = VSTR;
43  mWidget = new Button(this,
44  text,
45  actionEventId,
47  listener);
49 }
50 
52 {
53  mHorizont = nullptr;
54  mWidget = nullptr;
55  mButton = nullptr;
56 }
57 
59 {
60 }
61 
62 void SetupButtonItem::cancel(const std::string &eventName A_UNUSED)
63 {
64 }
65 
66 void SetupButtonItem::externalUpdated(const std::string &eventName A_UNUSED)
67 {
68 }
69 
71 {
72 }
73 
75 {
76  mHorizont = new HorizontContainer(this, 32, 2);
77 
78  // TRANSLATORS: setup item button
80 
81  mParent->getContainer()->add2(mHorizont, true, 4);
82  mParent->addControl(this);
83 // mWidget->addActionListener(this);
84 }
85 
87 {
88 }
89 
91 {
92 }
93 
95 {
96 }
97 
98 void SetupButtonItem::apply(const std::string &eventName A_UNUSED)
99 {
100 }
const std::string BUTTON_SKIN
Definition: button.h:89
Definition: button.h:102
void add(Widget *const widget)
void action(const ActionEvent &event)
HorizontContainer * mHorizont
void apply(const std::string &eventName)
SetupButtonItem(const std::string &text, const std::string &description, const std::string &actionEventId, SetupTabScroll *const parent, const std::string &eventName, ActionListener *const listener)
void cancel(const std::string &eventName)
void externalUpdated(const std::string &eventName)
Widget * mWidget
Definition: setupitem.h:143
SetupTabScroll * mParent
Definition: setupitem.h:135
int mValueType
Definition: setupitem.h:147
void addControl(SetupItem *const widget)
VertContainer * getContainer() const
void add2(Widget *const widget, const bool resizable, const int spacing)
#define restrict
Definition: localconsts.h:165
#define nullptr
Definition: localconsts.h:45
#define A_UNUSED
Definition: localconsts.h:160
const bool MainConfig_false
Definition: mainconfig.h:30