ManaPlus
src
gui
popupmanager.cpp
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2004-2009 The Mana World Development Team
4
* Copyright (C) 2009-2010 The Mana Developers
5
* Copyright (C) 2011-2019 The ManaPlus Developers
6
* Copyright (C) 2019-2021 Andrei Karas
7
*
8
* This file is part of The ManaPlus Client.
9
*
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
19
*
20
* You should have received a copy of the GNU General Public License
21
* along with this program. If not, see <http://www.gnu.org/licenses/>.
22
*/
23
24
#include "
gui/popupmanager.h
"
25
26
#include "
sdlshared.h
"
27
28
#ifndef DYECMD
29
#include "
gui/popups/beingpopup.h
"
30
#include "
gui/popups/itempopup.h
"
31
#include "
gui/popups/popupmenu.h
"
32
#endif
// DYECMD
33
#include "
gui/popups/textpopup.h
"
34
35
#include "
debug.h
"
36
37
PopupManager
*
popupManager
=
nullptr
;
38
39
PopupManager::PopupManager
()
40
{
41
}
42
43
PopupManager::~PopupManager
()
44
{
45
}
46
47
void
PopupManager::closePopupMenu
()
48
{
49
#ifndef DYECMD
50
if
(
popupMenu
!=
nullptr
)
51
popupMenu
->
handleLink
(
"cancel"
,
nullptr
);
52
#endif
// DYECMD
53
}
54
55
void
PopupManager::hideBeingPopup
()
56
{
57
#ifndef DYECMD
58
if
(
beingPopup
!=
nullptr
)
59
beingPopup
->
setVisible
(
Visible_false
);
60
#endif
// DYECMD
61
}
62
63
void
PopupManager::hideTextPopup
()
64
{
65
if
(
textPopup
!=
nullptr
)
66
textPopup
->
setVisible
(
Visible_false
);
67
}
68
69
void
PopupManager::hidePopupMenu
()
70
{
71
#ifndef DYECMD
72
if
(
popupMenu
!=
nullptr
)
73
popupMenu
->
setVisible
(
Visible_false
);
74
#endif
// DYECMD
75
}
76
77
void
PopupManager::hideItemPopup
()
78
{
79
#ifndef DYECMD
80
if
(
itemPopup
!=
nullptr
)
81
itemPopup
->
hide
();
82
#endif
// DYECMD
83
}
84
85
bool
PopupManager::isPopupMenuVisible
()
86
{
87
#ifndef DYECMD
88
return
popupMenu
!=
nullptr
?
popupMenu
->
isPopupVisible
() :
false
;
89
#else
90
return
false
;
91
#endif
// DYECMD
92
}
93
94
void
PopupManager::clearPopup
()
95
{
96
#ifndef DYECMD
97
if
(
popupMenu
!=
nullptr
)
98
popupMenu
->
clear
();
99
#endif
// DYECMD
100
}
101
102
bool
PopupManager::isTextPopupVisible
()
103
{
104
return
textPopup
!=
nullptr
?
textPopup
->
isPopupVisible
() :
false
;
105
}
106
107
bool
PopupManager::isBeingPopupVisible
()
108
{
109
#ifndef DYECMD
110
return
beingPopup
!=
nullptr
?
beingPopup
->
isPopupVisible
() :
false
;
111
#else
// DYECMD
112
return
false
;
113
#endif
// DYECMD
114
}
beingPopup
BeingPopup * beingPopup
Definition:
beingpopup.cpp:47
beingpopup.h
PopupManager
Definition:
popupmanager.h:30
PopupManager::clearPopup
static void clearPopup()
Definition:
popupmanager.cpp:94
PopupManager::hideTextPopup
static void hideTextPopup()
Definition:
popupmanager.cpp:63
PopupManager::isTextPopupVisible
static bool isTextPopupVisible()
Definition:
popupmanager.cpp:102
PopupManager::hideBeingPopup
static void hideBeingPopup()
Definition:
popupmanager.cpp:55
PopupManager::isBeingPopupVisible
static bool isBeingPopupVisible()
Definition:
popupmanager.cpp:107
PopupManager::hidePopupMenu
static void hidePopupMenu()
Definition:
popupmanager.cpp:69
PopupManager::PopupManager
PopupManager()
Definition:
popupmanager.cpp:39
PopupManager::hideItemPopup
static void hideItemPopup()
Definition:
popupmanager.cpp:77
PopupManager::isPopupMenuVisible
static bool isPopupMenuVisible()
Definition:
popupmanager.cpp:85
PopupManager::~PopupManager
~PopupManager()
Definition:
popupmanager.cpp:43
PopupManager::closePopupMenu
static void closePopupMenu()
Definition:
popupmanager.cpp:47
PopupMenu::handleLink
void handleLink(const std::string &link, MouseEvent *event)
Definition:
popupmenu.cpp:1251
PopupMenu::clear
void clear()
Definition:
popupmenu.cpp:2758
Popup::hide
void hide()
Definition:
popup.cpp:265
Popup::isPopupVisible
bool isPopupVisible() const
Definition:
popup.h:174
Widget::setVisible
void setVisible(Visible visible)
Definition:
widget.cpp:225
debug.h
itemPopup
ItemPopup * itemPopup
Definition:
itempopup.cpp:64
itempopup.h
popupManager
PopupManager * popupManager
Definition:
popupmanager.cpp:37
popupmanager.h
popupMenu
PopupMenu * popupMenu
Definition:
popupmenu.cpp:103
popupmenu.h
sdlshared.h
textPopup
TextPopup * textPopup
Definition:
textpopup.cpp:33
textpopup.h
Visible_false
const bool Visible_false
Definition:
visible.h:30
Generated on Wed Mar 17 2021 19:19:06 for ManaPlus by
1.9.1