xoreos
0.0.5
src
engines
nwn
gui
main
newmodule.h
Go to the documentation of this file.
1
/* xoreos - A reimplementation of BioWare's Aurora engine
2
*
3
* xoreos is the legal property of its developers, whose names
4
* can be found in the AUTHORS file distributed with this source
5
* distribution.
6
*
7
* xoreos is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 3
10
* of the License, or (at your option) any later version.
11
*
12
* xoreos is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
25
#ifndef ENGINES_NWN_GUI_MAIN_NEWMODULE_H
26
#define ENGINES_NWN_GUI_MAIN_NEWMODULE_H
27
28
#include <vector>
29
30
#include "
src/common/scopedptr.h
"
31
#include "
src/common/ustring.h
"
32
33
#include "
src/graphics/aurora/types.h
"
34
35
#include "
src/engines/nwn/gui/widgets/listbox.h
"
36
37
#include "
src/engines/nwn/gui/gui.h
"
38
39
namespace
Engines
{
40
41
namespace
NWN {
42
43
class
Module;
44
45
class
WidgetListItemModule
:
public
WidgetListItem
{
46
public
:
47
WidgetListItemModule
(::
Engines::GUI
&gui,
const
Common::UString
&font,
48
const
Common::UString
&text,
float
spacing = 0.0f);
49
~WidgetListItemModule
();
50
51
void
show
();
52
void
hide
();
53
54
void
setPosition
(
float
x,
float
y,
float
z);
55
56
float
getWidth
()
const
;
57
float
getHeight
()
const
;
58
59
void
setTag
(
const
Common::UString
&tag);
60
61
protected
:
62
bool
activate
();
63
bool
deactivate
();
64
65
private
:
66
Common::ScopedPtr<Graphics::Aurora::Model>
_button
;
67
Common::ScopedPtr<Graphics::Aurora::Text>
_text
;
68
69
float
_spacing
;
70
};
71
73
class
NewModuleMenu
:
public
GUI
{
74
public
:
75
NewModuleMenu
(
Module
&module,
GUI
&charType, ::
Engines::Console
*console = 0);
76
~NewModuleMenu
();
77
78
void
show
();
79
80
protected
:
81
void
fixWidgetType
(
const
Common::UString
&tag,
WidgetType
&type);
82
83
void
callbackActive
(
Widget
&widget);
84
85
private
:
86
Module
*
_module
;
87
88
std::vector<Common::UString>
_modules
;
89
90
GUI
*
_charType
;
91
92
Common::UString
getSelectedModule
();
93
94
void
initModuleList
();
95
void
selectedModule
();
96
void
loadModule
();
97
};
98
99
}
// End of namespace NWN
100
101
}
// End of namespace Engines
102
103
#endif // ENGINES_NWN_GUI_MAIN_NEWMODULE_H
Engines::NWN::WidgetListItemModule::WidgetListItemModule
WidgetListItemModule(::Engines::GUI &gui, const Common::UString &font, const Common::UString &text, float spacing=0.0f)
Definition:
newmodule.cpp:48
Engines::NWN::WidgetListItemModule::deactivate
bool deactivate()
Definition:
newmodule.cpp:112
Common::UString
A class holding an UTF-8 string.
Definition:
ustring.h:48
Engines::NWN::NewModuleMenu::callbackActive
void callbackActive(Widget &widget)
Callback that's triggered when a widget was activated.
Definition:
newmodule.cpp:167
Engines::NWN::NewModuleMenu::selectedModule
void selectedModule()
Definition:
newmodule.cpp:196
Engines::NWN::NewModuleMenu::_charType
GUI * _charType
Definition:
newmodule.h:90
Engines::NWN::WidgetListItemModule::getWidth
float getWidth() const
Get the widget's width.
Definition:
newmodule.cpp:89
Engines::NWN::NewModuleMenu::fixWidgetType
void fixWidgetType(const Common::UString &tag, WidgetType &type)
Definition:
newmodule.cpp:138
Engines::NWN::NewModuleMenu::~NewModuleMenu
~NewModuleMenu()
Definition:
newmodule.cpp:128
Engines::NWN::WidgetListItem
An item widget within a NWN listbox widget.
Definition:
listbox.h:51
scopedptr.h
A simple scoped smart pointer template.
Engines::NWN::WidgetListItemModule::activate
bool activate()
Definition:
newmodule.cpp:103
listbox.h
A NWN listbox widget.
Engines::GUI
A GUI.
Definition:
gui.h:43
Engines::NWN::WidgetListItemModule
Definition:
newmodule.h:45
Engines::NWN::NewModuleMenu::loadModule
void loadModule()
Definition:
newmodule.cpp:204
types.h
Basic Aurora graphics types.
Engines::NWN::GUI
A NWN GUI.
Definition:
gui.h:54
Engines::NWN::WidgetListItemModule::setPosition
void setPosition(float x, float y, float z)
Set the widget's position.
Definition:
newmodule.cpp:77
Engines::NWN::WidgetListItemModule::_spacing
float _spacing
Definition:
newmodule.h:69
Engines::NWN::NewModuleMenu::initModuleList
void initModuleList()
Definition:
newmodule.cpp:145
Engines::NWN::GUI::WidgetType
WidgetType
Definition:
gui.h:60
Engines::NWN::WidgetListItemModule::_button
Common::ScopedPtr< Graphics::Aurora::Model > _button
Definition:
newmodule.h:66
Engines
Definition:
console.cpp:69
Common::ScopedPtr< Graphics::Aurora::Model >
Engines::NWN::WidgetListItemModule::setTag
void setTag(const Common::UString &tag)
Set the widget's tag.
Definition:
newmodule.cpp:97
Engines::NWN::NewModuleMenu::getSelectedModule
Common::UString getSelectedModule()
Definition:
newmodule.cpp:188
Engines::NWN::WidgetListItemModule::hide
void hide()
Hide the widget.
Definition:
newmodule.cpp:72
ustring.h
Unicode string handling.
Engines::NWN::NewModuleMenu
The NWN new module menu.
Definition:
newmodule.h:73
Engines::NWN::WidgetListItemModule::getHeight
float getHeight() const
Get the widget's height.
Definition:
newmodule.cpp:93
Engines::Widget
A widget in a GUI.
Definition:
widget.h:40
Engines::NWN::NewModuleMenu::show
void show()
Show the GUI.
Definition:
newmodule.cpp:131
Engines::NWN::WidgetListItemModule::show
void show()
Show the widget.
Definition:
newmodule.cpp:67
Engines::NWN::Module
Definition:
module.h:63
gui.h
A NWN GUI.
Engines::Console
Definition:
console.h:190
Engines::NWN::WidgetListItemModule::_text
Common::ScopedPtr< Graphics::Aurora::Text > _text
Definition:
newmodule.h:67
Engines::NWN::NewModuleMenu::_module
Module * _module
Definition:
newmodule.h:86
Engines::NWN::NewModuleMenu::NewModuleMenu
NewModuleMenu(Module &module, GUI &charType, ::Engines::Console *console=0)
Definition:
newmodule.cpp:122
Engines::NWN::WidgetListItemModule::~WidgetListItemModule
~WidgetListItemModule()
Definition:
newmodule.cpp:64
Engines::NWN::NewModuleMenu::_modules
std::vector< Common::UString > _modules
Definition:
newmodule.h:88
Generated on Sun Nov 18 2018 15:13:40 for xoreos by
1.8.14