The Battle for Wesnoth
1.19.5+dev
gui
dialogs
editor
edit_pbl_translation.cpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2023 - 2024
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
#define GETTEXT_DOMAIN "wesnoth-lib"
16
17
#include "
gui/dialogs/editor/edit_pbl_translation.hpp
"
18
19
#include "
gui/widgets/text_box.hpp
"
20
21
namespace
gui2::dialogs
22
{
23
24
REGISTER_DIALOG
(editor_edit_pbl_translation)
25
26
editor_edit_pbl_translation
::
editor_edit_pbl_translation
(
27
std::
string
& language, std::
string
& title, std::
string
& description)
28
:
modal_dialog
(window_id())
29
, language_(language)
30
, title_(title)
31
, description_(description)
32
{
33
}
34
35
void
editor_edit_pbl_translation::pre_show
()
36
{
37
text_box
* language = find_widget<text_box>(
"language"
,
false
,
true
);
38
keyboard_capture
(language);
39
}
40
41
void
editor_edit_pbl_translation::post_show
()
42
{
43
language_
= find_widget<text_box>(
"language"
).get_value();
44
title_
= find_widget<text_box>(
"lang_title"
).get_value();
45
description_
= find_widget<text_box>(
"description"
).get_value();
46
}
47
48
}
// namespace gui2::dialogs
gui2::dialogs::editor_edit_pbl_translation
Definition:
edit_pbl_translation.hpp:26
gui2::dialogs::editor_edit_pbl_translation::title_
std::string & title_
Definition:
edit_pbl_translation.hpp:40
gui2::dialogs::editor_edit_pbl_translation::description_
std::string & description_
Definition:
edit_pbl_translation.hpp:41
gui2::dialogs::editor_edit_pbl_translation::language_
std::string & language_
Definition:
edit_pbl_translation.hpp:39
gui2::dialogs::editor_edit_pbl_translation::post_show
virtual void post_show() override
Actions to be taken after the window has been shown.
Definition:
edit_pbl_translation.cpp:41
gui2::dialogs::editor_edit_pbl_translation::pre_show
virtual void pre_show() override
The execute function.
Definition:
edit_pbl_translation.cpp:35
gui2::dialogs::modal_dialog
Abstract base class for all modal dialogs.
Definition:
modal_dialog.hpp:146
gui2::text_box
A widget that allows the user to input text in single line.
Definition:
text_box.hpp:125
gui2::window::keyboard_capture
void keyboard_capture(widget *widget)
Definition:
window.cpp:1207
edit_pbl_translation.hpp
gui2::dialogs
Definition:
achievements_dialog.cpp:36
gui2::dialogs::REGISTER_DIALOG
REGISTER_DIALOG(editor_edit_unit)
text_box.hpp
Generated by
1.9.1