1 /*
2    Copyright (C) 2010 - 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 
16 #include "gui/dialogs/modal_dialog.hpp"
17 #include "generators/default_map_generator.hpp"
18 
19 namespace gui2
20 {
21 
22 class label;
23 
24 namespace dialogs
25 {
26 
27 class generator_settings : public modal_dialog
28 {
29 public:
30 	explicit generator_settings(generator_data& data);
31 
32 	/** The execute function. See @ref modal_dialog for more information. */
33 	DEFINE_SIMPLE_EXECUTE_WRAPPER(generator_settings)
34 
35 private:
36 	virtual void pre_show(window& window) override;
37 
38 	void adjust_minimum_size_by_players(window& window);
39 
40 	/** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
41 	virtual const std::string& window_id() const override;
42 
43 	/** We need to own these fields to access the underlying widget */
44 	field_integer* players_;
45 	field_integer* width_;
46 	field_integer* height_;
47 
48 	std::function<void()> update_width_label_, update_height_label_;
49 };
50 
51 } // namespace dialogs
52 } // namespace gui2
53