xoreos  0.0.5
buttonsgroup.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
26 #ifndef ENGINES_NWN_GUI_WIDGETS_BUTTONSGROUP_H
27 #define ENGINES_NWN_GUI_WIDGETS_BUTTONSGROUP_H
28 
29 #include <vector>
30 
31 namespace Common {
32  class UString;
33 }
34 
35 namespace Engines {
36 
37 namespace NWN {
38 
39 class WidgetButton;
40 class WidgetEditBox;
41 
42 class ButtonsGroup {
43 public:
44  ButtonsGroup(WidgetEditBox *helpBox);
45  ~ButtonsGroup();
46 
47  void addButton(WidgetButton *button, const Common::UString &helpTitle, const Common::UString &helpText);
48  void removeButton(WidgetButton *button);
49 
50  void setActive(WidgetButton *button);
51  void setActive(size_t button);
52 
53  void setAllInactive();
54 
55  size_t getChoice() const;
56  const std::vector<WidgetButton *> &getButtonsList() const;
57 
58 private:
59  std::vector<WidgetButton *> _buttonsList;
60 
62  std::vector<Common::UString> _helpTitles;
63  std::vector<Common::UString> _helpTexts;
64 };
65 
66 } // End of namespace NWN
67 
68 } // End of namespace Engines
69 
70 #endif // ENGINES_NWN_GUI_WIDGETS_BUTTONSGROUP_H
std::vector< Common::UString > _helpTitles
Definition: buttonsgroup.h:62
std::vector< Common::UString > _helpTexts
Definition: buttonsgroup.h:63
Definition: 2dafile.h:39
void addButton(WidgetButton *button, const Common::UString &helpTitle, const Common::UString &helpText)
A class holding an UTF-8 string.
Definition: ustring.h:48
A NWN button widget.
Definition: button.h:39
void removeButton(WidgetButton *button)
ButtonsGroup(WidgetEditBox *helpBox)
const std::vector< WidgetButton * > & getButtonsList() const
WidgetEditBox * _helpBox
Definition: buttonsgroup.h:61
A NWN editbox widget.
Definition: editbox.h:43
std::vector< WidgetButton * > _buttonsList
Definition: buttonsgroup.h:59
void setActive(WidgetButton *button)