1 /*
2  * Copyright (C) 2002-2020 by the Widelands Development Team
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17  *
18  */
19 
20 #ifndef WL_EDITOR_UI_MENUS_MAIN_MENU_MAP_OPTIONS_H
21 #define WL_EDITOR_UI_MENUS_MAIN_MENU_MAP_OPTIONS_H
22 
23 #include "ui_basic/box.h"
24 #include "ui_basic/button.h"
25 #include "ui_basic/checkbox.h"
26 #include "ui_basic/dropdown.h"
27 #include "ui_basic/editbox.h"
28 #include "ui_basic/icon.h"
29 #include "ui_basic/listselect.h"
30 #include "ui_basic/multilineeditbox.h"
31 #include "ui_basic/spinbox.h"
32 #include "ui_basic/tabpanel.h"
33 #include "ui_basic/textarea.h"
34 #include "ui_basic/unique_window.h"
35 
36 class EditorInteractive;
37 
38 /**
39  * This is the Main Options Menu. Here, information
40  * about the current map are displayed and you can change
41  * author, name and description
42  */
43 struct MainMenuMapOptions : public UI::UniqueWindow {
44 	MainMenuMapOptions(EditorInteractive&, UI::UniqueWindow::Registry& registry);
45 
46 private:
47 	EditorInteractive& eia();
48 	void changed();
49 	void update();
50 	void clicked_ok();
51 	void clicked_cancel();
52 	void add_tag_checkbox(UI::Box* box, std::string tag, std::string displ_name);
53 
54 	const unsigned int padding_, indent_, labelh_, checkbox_space_, butw_, max_w_;
55 
56 	UI::Button ok_, cancel_;
57 
58 	UI::Box tab_box_;
59 	UI::TabPanel tabs_;
60 	UI::Box main_box_;
61 	UI::Box tags_box_;
62 	UI::Box teams_box_;
63 
64 	UI::EditBox name_, author_;
65 	UI::Textarea size_;
66 	UI::MultilineEditbox* descr_;
67 	UI::MultilineEditbox* hint_;
68 
69 	// Tag, Checkbox
70 	std::map<std::string, UI::Checkbox*> tags_checkboxes_;
71 	UI::Dropdown<std::string> balancing_dropdown_;
72 
73 	UI::Listselect<std::string> teams_list_;
74 	UI::SpinBox* waterway_length_box_;
75 	UI::Icon* waterway_length_warning_;
76 	void update_waterway_length_warning();
77 
78 	UI::UniqueWindow::Registry& registry_;
79 };
80 
81 #endif  // end of include guard: WL_EDITOR_UI_MENUS_MAIN_MENU_MAP_OPTIONS_H
82