xoreos
0.0.5
src
engines
aurora
kotorjadegui
listbox.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_AURORA_KOTORJADEGUI_LISTBOX_H
26
#define ENGINES_AURORA_KOTORJADEGUI_LISTBOX_H
27
28
#include "
src/engines/aurora/kotorjadegui/kotorjadewidget.h
"
29
30
namespace
Engines
{
31
32
class
WidgetScrollbar;
33
class
WidgetProtoItem;
34
35
enum
ListBoxItemType
{
36
kLBItemTypeDefault
= 0,
37
kLBItemTypeKotORInventory
= 1
38
};
39
40
class
WidgetListBox
:
public
KotORJadeWidget
{
41
public
:
42
WidgetListBox
(
GUI
&gui,
const
Common::UString
&tag);
43
~WidgetListBox
();
44
45
void
load
(
const
Aurora::GFF3Struct
&gff);
46
47
void
setItemType
(
ListBoxItemType
itemType);
48
52
void
setItemSelectionEnabled
(
bool
itemSelectionEnabled);
53
58
void
setAdjustHeight
(
bool
adjustHeight);
59
64
void
setHideScrollbar
(
bool
hideScrollbar);
65
66
void
setPadding
(
uint32
padding);
67
void
setItemTextColor
(
float
r,
float
g,
float
b,
float
a);
68
void
setItemBorderColor
(
float
r,
float
g,
float
b,
float
a);
69
70
// .--- Item widgets
71
72
void
createItemWidgets
(
uint32
count);
73
void
refreshItemWidgets
();
74
75
// '---
76
77
// .--- Underlying items
78
79
void
addItem
(
const
Common::UString
&contents);
80
void
removeAllItems
();
81
82
// '---
83
84
// .--- Item selection
85
86
void
selectItemByWidgetTag
(
const
Common::UString
&tag);
87
void
selectItemByIndex
(
int
index);
88
void
selectNextItem
();
89
void
selectPreviousItem
();
90
91
int
getSelectedIndex
()
const
;
92
93
// '---
94
95
void
setHeight
(
float
height);
96
97
void
subActive
(
Widget
&widget);
98
99
void
mouseWheel
(
uint8
state,
int
x,
int
y);
100
101
void
setSoundSelectItem
(
const
Common::UString
&resRef);
102
void
setSoundHoverItem
(
const
Common::UString
&resRef);
103
void
setSoundClickItem
(
const
Common::UString
&resRef);
104
105
private
:
106
const
Aurora::GFF3Struct
*
_protoItem
;
107
WidgetScrollbar
*
_scrollbar
;
108
std::vector<WidgetProtoItem *>
_itemWidgets
;
109
std::vector<Common::UString>
_items
;
110
111
ListBoxItemType
_itemType
;
112
uint32
_padding
;
113
bool
_leftScrollbar
;
114
bool
_itemSelectionEnabled
;
115
bool
_adjustHeight
;
116
bool
_hideScrollbar
;
117
int
_selectedIndex
;
118
int
_startIndex
;
119
int
_numVisibleItems
;
120
121
bool
_textColorChanged
;
122
float
_textR
,
_textG
,
_textB
,
_textA
;
123
124
bool
_borderColorChanged
;
125
float
_borderR
,
_borderG
,
_borderB
,
_borderA
;
126
127
Common::UString
_soundSelectItem
;
128
Common::UString
_soundHoverItem
;
129
Common::UString
_soundClickItem
;
130
131
void
createScrollbar
(
const
Aurora::GFF3Struct
&gff);
132
void
positionItemWidgets
();
133
void
applyChangesToItemWidgets
();
134
};
135
136
}
// End of namespace Engines
137
138
#endif // ENGINES_AURORA_KOTORJADEGUI_LISTBOX_H
Engines::kLBItemTypeDefault
Definition:
listbox.h:36
Engines::WidgetListBox::_textA
float _textA
Definition:
listbox.h:122
Engines::WidgetListBox::positionItemWidgets
void positionItemWidgets()
Definition:
listbox.cpp:361
Engines::WidgetListBox::WidgetListBox
WidgetListBox(GUI &gui, const Common::UString &tag)
Definition:
listbox.cpp:43
Engines::WidgetListBox::mouseWheel
void mouseWheel(uint8 state, int x, int y)
A mouse wheel was used on the widget.
Definition:
listbox.cpp:392
Engines::WidgetListBox::_leftScrollbar
bool _leftScrollbar
Definition:
listbox.h:113
Common::UString
A class holding an UTF-8 string.
Definition:
ustring.h:48
Engines::WidgetListBox::_borderA
float _borderA
Definition:
listbox.h:125
Engines::WidgetListBox::createItemWidgets
void createItemWidgets(uint32 count)
Definition:
listbox.cpp:131
Engines::WidgetListBox::_scrollbar
WidgetScrollbar * _scrollbar
Definition:
listbox.h:107
Engines::WidgetListBox::_adjustHeight
bool _adjustHeight
Definition:
listbox.h:115
uint8
uint8_t uint8
Definition:
types.h:200
Engines::WidgetListBox::_selectedIndex
int _selectedIndex
Definition:
listbox.h:117
Engines::WidgetScrollbar
Definition:
scrollbar.h:32
Engines::WidgetListBox::selectPreviousItem
void selectPreviousItem()
Definition:
listbox.cpp:282
Engines::WidgetListBox::_borderR
float _borderR
Definition:
listbox.h:125
Engines::WidgetListBox::setSoundClickItem
void setSoundClickItem(const Common::UString &resRef)
Definition:
listbox.cpp:338
Engines::WidgetListBox::_soundClickItem
Common::UString _soundClickItem
Definition:
listbox.h:129
Engines::KotORJadeWidget
Definition:
kotorjadewidget.h:43
Engines::WidgetListBox::setPadding
void setPadding(uint32 padding)
Definition:
listbox.cpp:98
Engines::WidgetListBox::_startIndex
int _startIndex
Definition:
listbox.h:118
Engines::WidgetListBox::_protoItem
const Aurora::GFF3Struct * _protoItem
Definition:
listbox.h:106
Engines::WidgetListBox::_textColorChanged
bool _textColorChanged
Definition:
listbox.h:121
Engines::WidgetListBox::removeAllItems
void removeAllItems()
Definition:
listbox.cpp:126
Engines::WidgetListBox::_soundHoverItem
Common::UString _soundHoverItem
Definition:
listbox.h:128
Engines::GUI
A GUI.
Definition:
gui.h:43
Engines::WidgetListBox::_textB
float _textB
Definition:
listbox.h:122
Engines::WidgetListBox::setItemTextColor
void setItemTextColor(float r, float g, float b, float a)
Definition:
listbox.cpp:102
Engines::WidgetListBox
Definition:
listbox.h:40
Engines::WidgetListBox::setItemSelectionEnabled
void setItemSelectionEnabled(bool itemSelectionEnabled)
Toggle item selection mode.
Definition:
listbox.cpp:82
Engines::WidgetListBox::addItem
void addItem(const Common::UString &contents)
Definition:
listbox.cpp:122
Engines::WidgetListBox::selectItemByWidgetTag
void selectItemByWidgetTag(const Common::UString &tag)
Definition:
listbox.cpp:234
Engines::WidgetListBox::_textR
float _textR
Definition:
listbox.h:122
Engines
Definition:
console.cpp:69
Engines::WidgetListBox::subActive
void subActive(Widget &widget)
A sub-widget was activated.
Definition:
listbox.cpp:321
Engines::WidgetListBox::_numVisibleItems
int _numVisibleItems
Definition:
listbox.h:119
kotorjadewidget.h
Common base for Star Wars: Knights of the Old Republic and Jade Empire widgets.
Engines::WidgetListBox::_soundSelectItem
Common::UString _soundSelectItem
Definition:
listbox.h:127
Engines::WidgetListBox::setHideScrollbar
void setHideScrollbar(bool hideScrollbar)
Toggle scroll bar visibility mode.
Definition:
listbox.cpp:94
Engines::WidgetListBox::selectItemByIndex
void selectItemByIndex(int index)
Definition:
listbox.cpp:251
Engines::WidgetListBox::setAdjustHeight
void setAdjustHeight(bool adjustHeight)
Toggle height adjustment mode.
Definition:
listbox.cpp:90
Engines::WidgetListBox::setItemBorderColor
void setItemBorderColor(float r, float g, float b, float a)
Definition:
listbox.cpp:112
Engines::WidgetListBox::_textG
float _textG
Definition:
listbox.h:122
Engines::WidgetListBox::_borderColorChanged
bool _borderColorChanged
Definition:
listbox.h:124
Engines::WidgetListBox::refreshItemWidgets
void refreshItemWidgets()
Definition:
listbox.cpp:161
Engines::Widget
A widget in a GUI.
Definition:
widget.h:40
Engines::WidgetListBox::_itemType
ListBoxItemType _itemType
Definition:
listbox.h:111
Engines::WidgetListBox::_hideScrollbar
bool _hideScrollbar
Definition:
listbox.h:116
Aurora::GFF3Struct
A struct within a GFF3.
Definition:
gff3file.h:164
uint32
uint32_t uint32
Definition:
types.h:204
Engines::WidgetListBox::load
void load(const Aurora::GFF3Struct &gff)
Definition:
listbox.cpp:65
Engines::WidgetListBox::_borderB
float _borderB
Definition:
listbox.h:125
Engines::WidgetListBox::createScrollbar
void createScrollbar(const Aurora::GFF3Struct &gff)
Definition:
listbox.cpp:343
Engines::WidgetListBox::selectNextItem
void selectNextItem()
Definition:
listbox.cpp:258
Engines::WidgetListBox::~WidgetListBox
~WidgetListBox()
Definition:
listbox.cpp:62
Engines::WidgetListBox::_itemWidgets
std::vector< WidgetProtoItem * > _itemWidgets
Definition:
listbox.h:108
Engines::WidgetListBox::setHeight
void setHeight(float height)
Set the height of the widget.
Definition:
listbox.cpp:310
Engines::WidgetListBox::setItemType
void setItemType(ListBoxItemType itemType)
Definition:
listbox.cpp:78
Engines::WidgetListBox::applyChangesToItemWidgets
void applyChangesToItemWidgets()
Definition:
listbox.cpp:377
Engines::WidgetListBox::_itemSelectionEnabled
bool _itemSelectionEnabled
Definition:
listbox.h:114
Engines::kLBItemTypeKotORInventory
Definition:
listbox.h:37
Engines::WidgetListBox::_padding
uint32 _padding
Definition:
listbox.h:112
Engines::WidgetListBox::_items
std::vector< Common::UString > _items
Definition:
listbox.h:109
Engines::WidgetListBox::setSoundHoverItem
void setSoundHoverItem(const Common::UString &resRef)
Definition:
listbox.cpp:333
Engines::WidgetListBox::getSelectedIndex
int getSelectedIndex() const
Definition:
listbox.cpp:306
Engines::WidgetListBox::_borderG
float _borderG
Definition:
listbox.h:125
Engines::WidgetListBox::setSoundSelectItem
void setSoundSelectItem(const Common::UString &resRef)
Definition:
listbox.cpp:328
Engines::ListBoxItemType
ListBoxItemType
Definition:
listbox.h:35
Generated on Sun Nov 18 2018 15:13:39 for xoreos by
1.8.14