The Battle for Wesnoth  1.19.7+dev
edit_scenario.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2024
3  by Fabian Müller <fabianmueller5@gmx.de>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #define GETTEXT_DOMAIN "wesnoth-lib"
17 
19 
20 #include "gui/widgets/text_box.hpp"
21 #include "gui/widgets/window.hpp"
22 
23 namespace gui2::dialogs
24 {
25 
26 REGISTER_DIALOG(editor_edit_scenario)
27 
29  std::string& id,
30  std::string& name,
31  std::string& description,
32  int& turns,
33  int& experience_modifier,
34  bool& victory_when_enemies_defeated,
35  bool& random_start_time)
36  : modal_dialog(window_id())
37 {
38  register_text("id", true, id, true);
39  register_text("name", true, name, false);
40  register_text("description", true, description, false);
41  register_integer("turns", true, turns);
42  register_integer("experience_modifier", true, experience_modifier);
43  register_bool("victory_when_enemies_defeated",
44  true,
45  victory_when_enemies_defeated);
46  register_bool("random_start_time", true, random_start_time);
47 }
48 
50 {
51  add_to_tab_order(find_widget<text_box>("id", false, true));
52  add_to_tab_order(find_widget<text_box>("name", false, true));
53  add_to_tab_order(find_widget<text_box>("description", false, true));
54 }
55 
56 } // namespace dialogs
virtual void pre_show() override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
void add_to_tab_order(widget *widget, int at=-1)
Add the widget to the tabbing order.
Definition: window.cpp:1225
This file contains the window object, this object is a top level container which has the event manage...
REGISTER_DIALOG(editor_edit_unit)