The Battle for Wesnoth
1.15.2+dev
gui
dialogs
folder_create.cpp
Go to the documentation of this file.
1
/*
2
Copyright (C) 2011 - 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
#define GETTEXT_DOMAIN "wesnoth-lib"
16
17
#include "
gui/dialogs/folder_create.hpp
"
18
19
#include "
gettext.hpp
"
20
#include "
gui/auxiliary/find_widget.hpp
"
21
#include "
gui/widgets/styled_widget.hpp
"
22
#include "
gui/widgets/settings.hpp
"
23
#include "
gui/widgets/window.hpp
"
24
25
namespace
gui2
26
{
27
namespace
dialogs
28
{
29
30
/*WIKI
31
* @page = GUIWindowDefinitionWML
32
* @order = 2_folder_create
33
*
34
* == Folder Create ==
35
*
36
* Dialog for providing the name of a new folder or bookmark to create.
37
* Used by the file dialog.
38
*
39
* @begin{table}{dialog_widgets}
40
*
41
* title & & styled_widget & m &
42
* Label with the dialog caption. Changed in bookmark mode. $
43
* name & & text_box & m &
44
* Input field for the new folder/bookmark name. $
45
*
46
* @end{table}
47
*/
48
49
REGISTER_DIALOG
(folder_create)
50
51
folder_create
::
folder_create
(
std
::
string
& folder_name)
52
: bookmark_mode_(false)
53
{
54
register_text(
"name"
,
true
, folder_name,
true
);
55
}
56
57
void
folder_create::pre_show
(
window
&
window
)
58
{
59
if
(
bookmark_mode_
) {
60
find_widget<styled_widget>(&window,
"title"
,
false
).set_label(
_
(
"New Bookmark"
));
61
}
62
}
63
64
}
// namespace dialogs
65
}
// namespace gui2
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:45
window.hpp
This file contains the window object, this object is a top level container which has the event manage...
std
STL namespace.
folder_create.hpp
gui2
Generic file dialog.
Definition:
field-fwd.hpp:22
_
static UNUSEDNOWARN std::string _(const char *str)
Definition:
gettext.hpp:91
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
Inherited from modal_dialog.
Definition:
folder_create.cpp:57
dialogs
Various uncategorised dialogs.
gui2::dialogs::folder_create
Definition:
folder_create.hpp:24
gui2::window
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition:
window.hpp:62
Generated by
1.8.13