The Battle for Wesnoth  1.15.12+dev
select_orb_colors.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017-2018 by the Battle for Wesnoth Project https://www.wesnoth.org/
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY.
10 
11  See the COPYING file for more details.
12 */
13 
14 #pragma once
15 
17 #include "gui/widgets/group.hpp"
18 
19 #include <map>
20 
21 namespace gui2::dialogs
22 {
24 {
25 public:
27 
28  /**
29  * The display function.
30  *
31  * See @ref modal_dialog for more information.
32  */
34 
35 private:
36  void setup_orb_toggle(const std::string& base_id, bool& shown);
37  void setup_orb_group(const std::string& base_id, bool& shown, const std::string& initial);
38 
39  void reset_orb_toggle(const std::string& base_id, bool& shown);
40  void reset_orb_group(const std::string& base_id, bool& shown, const std::string& initial);
41 
42  void toggle_orb_callback(bool& storage);
43  void reset_orb_callback();
44 
49  bool show_ally_;
51 
52  std::map<std::string, group<std::string>> groups_;
53 
54  virtual const std::string& window_id() const override;
55 
56  virtual void pre_show(window& window) override;
57 
58  virtual void post_show(window& window) override;
59 };
60 
61 } // namespace dialogs
void reset_orb_group(const std::string &base_id, bool &shown, const std::string &initial)
void setup_orb_group(const std::string &base_id, bool &shown, const std::string &initial)
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
void reset_orb_toggle(const std::string &base_id, bool &shown)
void setup_orb_toggle(const std::string &base_id, bool &shown)
The display function.
virtual const std::string & window_id() const override
The id of the window to build.
Abstract base class for all modal dialogs.
std::map< std::string, group< std::string > > groups_
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:64