The Battle for Wesnoth
1.17.12+dev
gui
dialogs
folder_create.cpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2011 - 2022
3
by Iris Morelle <shadowm2006@gmail.com>
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
18
#include "
gui/dialogs/folder_create.hpp
"
19
20
#include "
gettext.hpp
"
21
#include "
gui/auxiliary/find_widget.hpp
"
22
#include "
gui/widgets/styled_widget.hpp
"
23
#include "
gui/widgets/settings.hpp
"
24
#include "
gui/widgets/window.hpp
"
25
26
namespace
gui2::dialogs
27
{
28
29
REGISTER_DIALOG
(folder_create)
30
31
folder_create
::
folder_create
(
std
::
string
& folder_name)
32
:
modal_dialog
(window_id())
33
, bookmark_mode_(false)
34
{
35
register_text(
"name"
,
true
, folder_name,
true
);
36
}
37
38
void
folder_create::pre_show
(
window
&
window
)
39
{
40
if
(
bookmark_mode_
) {
41
find_widget<styled_widget>(&
window
,
"title"
,
false
).
set_label
(
_
(
"New Bookmark"
));
42
}
43
}
44
45
}
// namespace dialogs
gui2::window::window
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
Definition:
window.cpp:263
REGISTER_DIALOG
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
Definition:
modal_dialog.hpp:89
gettext.hpp
styled_widget.hpp
find_widget.hpp
gui2::dialogs::folder_create::bookmark_mode_
bool bookmark_mode_
Definition:
folder_create.hpp:52
window.hpp
This file contains the window object, this object is a top level container which has the event manage...
std
STL namespace.
_
static std::string _(const char *str)
Definition:
gettext.hpp:93
folder_create.hpp
gui2::styled_widget::set_label
virtual void set_label(const t_string &label)
Definition:
styled_widget.cpp:323
gui2::dialogs
Definition:
achievements_dialog.cpp:26
settings.hpp
This file contains the settings handling of the widget library.
gui2::dialogs::folder_create::pre_show
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Definition:
folder_create.cpp:38
gui2::dialogs::folder_create
Dialog for providing the name of a new folder to create.
Definition:
folder_create.hpp:31
gui2::dialogs::modal_dialog
Abstract base class for all modal dialogs.
Definition:
modal_dialog.hpp:145
gui2::window
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition:
window.hpp:66
Generated by
1.8.13