ManaPlus
src
gui
widgets
popuplist.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2012-2019 The ManaPlus Developers
4
* Copyright (C) 2019-2021 Andrei Karas
5
*
6
* This file is part of The ManaPlus Client.
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public License
19
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#ifndef GUI_WIDGETS_POPUPLIST_H
23
#define GUI_WIDGETS_POPUPLIST_H
24
25
#include "
enums/simpletypes/modal.h
"
26
27
#include "
gui/widgets/popup.h
"
28
29
#include "
listeners/focuslistener.h
"
30
31
#include "
localconsts.h
"
32
33
class
DropDown
;
34
class
ListBox
;
35
class
ListModel
;
36
class
ScrollArea
;
37
38
class
PopupList
final
:
public
Popup
,
39
public
FocusListener
40
{
41
public
:
42
PopupList
(
DropDown
*
const
widget,
43
ListModel
*
const
listModel,
44
const
bool
extended,
45
const
Modal
modal);
46
47
~PopupList
()
override
final
;
48
49
A_DELETE_COPY
(
PopupList
)
50
51
void
postInit
()
override
final
;
52
53
void
show
(
int
x
,
int
y
);
54
55
void
widgetResized
(
const
Event
&event)
override
final
;
56
57
void
setSelected
(
const
int
selected);
58
59
int
getSelected
()
const
;
60
61
void
setListModel
(
ListModel
*
const
model);
62
63
ListModel
*
getListModel
()
const
64
{
return
mListModel
; }
65
66
void
adjustSize
();
67
68
void
focusGained
(
const
Event
& event
A_UNUSED
)
override
final
;
69
70
void
focusLost
(
const
Event
& event
A_UNUSED
)
override
final
;
71
72
void
mousePressed
(
MouseEvent
& event)
override
final
;
73
74
void
mouseReleased
(
MouseEvent
& event)
override
final
;
75
76
private
:
77
ListModel
*
mListModel
;
78
ListBox
*
mListBox
A_NONNULLPOINTER
;
79
ScrollArea
*
mScrollArea
A_NONNULLPOINTER
;
80
DropDown
*
mDropDown
;
81
int
mPressedIndex
;
82
Modal
mModal
;
83
};
84
85
#endif
// GUI_WIDGETS_POPUPLIST_H
DropDown
Definition:
dropdown.h:57
Event
Definition:
event.h:79
FocusListener
Definition:
focuslistener.h:79
ListBox
Definition:
listbox.h:94
ListModel
Definition:
listmodel.h:80
MouseEvent
Definition:
mouseevent.h:81
PopupList
Definition:
popuplist.h:40
PopupList::widgetResized
void widgetResized(const Event &event)
Definition:
popuplist.cpp:101
PopupList::PopupList
PopupList(DropDown *const widget, ListModel *const listModel, const bool extended, const Modal modal)
Definition:
popuplist.cpp:35
PopupList::mListBox
ListBox * mListBox
Definition:
popuplist.h:78
PopupList::~PopupList
~PopupList()
Definition:
popuplist.cpp:73
PopupList::mScrollArea
ScrollArea * mScrollArea
Definition:
popuplist.h:79
PopupList::setSelected
void setSelected(const int selected)
Definition:
popuplist.cpp:107
PopupList::getSelected
int getSelected() const
Definition:
popuplist.cpp:115
PopupList::setListModel
void setListModel(ListModel *const model)
Definition:
popuplist.cpp:123
PopupList::adjustSize
void adjustSize()
Definition:
popuplist.cpp:130
PopupList::focusLost
void focusLost(const Event &event)
Definition:
popuplist.cpp:185
PopupList::mPressedIndex
int mPressedIndex
Definition:
popuplist.h:81
PopupList::focusGained
void focusGained(const Event &event)
Definition:
popuplist.cpp:166
PopupList::postInit
void postInit()
Definition:
popuplist.cpp:60
PopupList::mouseReleased
void mouseReleased(MouseEvent &event)
Definition:
popuplist.cpp:147
PopupList::mListModel
ListModel * mListModel
Definition:
popuplist.h:77
PopupList::mModal
Modal mModal
Definition:
popuplist.h:82
PopupList::mDropDown
DropDown * mDropDown
Definition:
popuplist.h:80
PopupList::mousePressed
void mousePressed(MouseEvent &event)
Definition:
popuplist.cpp:140
PopupList::show
void show(int x, int y)
Definition:
popuplist.cpp:82
PopupList::getListModel
ListModel * getListModel() const
Definition:
popuplist.h:63
Popup
Definition:
popup.h:52
ScrollArea
Definition:
scrollarea.h:94
focuslistener.h
y
y
Definition:
graphics_calcImageRect.hpp:73
x
x
Definition:
graphics_calcImageRect.hpp:73
localconsts.h
A_NONNULLPOINTER
#define A_NONNULLPOINTER
Definition:
localconsts.h:266
final
#define final
Definition:
localconsts.h:46
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
A_UNUSED
#define A_UNUSED
Definition:
localconsts.h:160
modal.h
Modal
bool Modal
Definition:
modal.h:30
popup.h
Generated on Wed Mar 17 2021 19:19:06 for ManaPlus by
1.9.1