The Battle for Wesnoth  1.17.0-dev
edit_label.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2018 by Iris Morelle <shadowm2006@gmail.com>
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 
19 namespace gui2::dialogs
20 {
21 
22 /**
23  * @ingroup GUIWindowDefinitionWML
24  *
25  * Dialog for editing gamemap labels.
26  * Key |Type |Mandatory|Description
27  * ------------------|---------------|---------|-----------
28  * title | @ref label |yes |Dialog title label.
29  * label | @ref text_box |yes |Input field for the map label.
30  * team_only_toggle | toggle_button |yes |Checkbox for whether to make the label visible to the player's team only or not.
31  */
32 class edit_label : public modal_dialog
33 {
34 public:
35  /**
36  * Constructor.
37  *
38  * @param [in, out] label The parameter's usage is:
39  * - Input: The initial value of the label.
40  * - Output: The label text the user entered if
41  * the dialog returns retval::OK
42  * undefined otherwise.
43  * @param [in, out] team_only The parameter's usage is:
44  * - Input: The initial value of the team only
45  * toggle.
46  * - Output: The final value of the team only
47  * toggle if the dialog returns retval::OK undefined otherwise.
48  */
49  edit_label(std::string& label, bool& team_only);
50 
51  /** The execute function. See @ref modal_dialog for more information. */
53 
54 private:
55  virtual const std::string& window_id() const override;
56 };
57 } // namespace dialogs
A label displays a text, the text can be wrapped but no scrollbars are provided.
Definition: label.hpp:56
Dialog for editing gamemap labels.
Definition: edit_label.hpp:32
edit_label(std::string &label, bool &team_only)
Constructor.
Definition: edit_label.cpp:26
Abstract base class for all modal dialogs.
virtual const std::string & window_id() const override
The execute function.