The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
reachmap_options.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2023 - 2025
3 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY.
11
12 See the COPYING file for more details.
13*/
14
15#pragma once
16
18#include "gui/widgets/group.hpp"
19
20#include <map>
21
22namespace gui2::dialogs
23{
25{
26public:
28
30
31private:
32 /**
33 * Sets up the checkbox and row of color buttons for the one-color options, including
34 * connecting the callbacks for user interaction.
35 *
36 * @param base_id which group of checkboxes and buttons to affect
37 * @param initial which color to select (input only)
38 */
39 void setup_reachmap_group(const std::string& base_id, const std::string& initial);
40
41
42 /**
43 * Change the UI's ticked/unticked state. Neither sets up nor triggers callbacks.
44 */
45
46 void reset_reachmap_group(const std::string& base_id, const std::string& initial);
47
48 void reset_reachmap_slider(const std::string& base_id, const int& initial);
49
51
52 std::map<std::string, group<std::string>> groups_;
53
54 virtual void pre_show() override;
55 virtual void post_show() override;
56
57 virtual const std::string& window_id() const override;
58};
59
60} // namespace gui2::dialogs
Abstract base class for all modal dialogs.
virtual void pre_show() override
Actions to be taken before showing the window.
virtual void post_show() override
Actions to be taken after the window has been shown.
void setup_reachmap_group(const std::string &base_id, const std::string &initial)
Sets up the checkbox and row of color buttons for the one-color options, including connecting the cal...
virtual const std::string & window_id() const override
The ID of the window to build.
std::map< std::string, group< std::string > > groups_
void reset_reachmap_group(const std::string &base_id, const std::string &initial)
Change the UI's ticked/unticked state.
void reset_reachmap_slider(const std::string &base_id, const int &initial)
#define DEFINE_SIMPLE_DISPLAY_WRAPPER(dialog)
Adds a bare-bones static display function to a dialog class that immediately invokes the dialogs's mo...