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_TOOL_OPTIONS_MENU_H
21 #define WL_EDITOR_UI_MENUS_TOOL_OPTIONS_MENU_H
22 
23 #include "editor/editorinteractive.h"
24 #include "ui_basic/unique_window.h"
25 
26 struct EditorToolOptionsMenu : public UI::UniqueWindow {
27 	EditorToolOptionsMenu(EditorInteractive& parent,
28 	                      UI::UniqueWindow::Registry&,
29 	                      const uint32_t width,
30 	                      const uint32_t height,
31 	                      const std::string& title,
32 	                      EditorTool& tool);
33 
34 	/**
35 	 * Selects the correct tool from the parent.
36 	 * This is needed when a selection was made in the options menus.
37 	 */
38 	void select_correct_tool();
39 
spacingEditorToolOptionsMenu40 	uint32_t spacing() const {
41 		return 5;
42 	}
hspacingEditorToolOptionsMenu43 	uint32_t hspacing() const {
44 		return spacing();
45 	}
vspacingEditorToolOptionsMenu46 	uint32_t vspacing() const {
47 		return spacing();
48 	}
hmarginEditorToolOptionsMenu49 	uint32_t hmargin() const {
50 		return spacing();
51 	}
vmarginEditorToolOptionsMenu52 	uint32_t vmargin() const {
53 		return spacing();
54 	}
55 
56 private:
57 	EditorInteractive& parent_;
58 	EditorTool& current_tool_;
59 };
60 
61 #endif  // end of include guard: WL_EDITOR_UI_MENUS_TOOL_OPTIONS_MENU_H
62