Mana
Loading...
Searching...
No Matches
popupmenu.h
Go to the documentation of this file.
1/*
2 * The Mana Client
3 * Copyright (C) 2004-2009 The Mana World Development Team
4 * Copyright (C) 2009-2012 The Mana Developers
5 *
6 * This file is part of The Mana 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#pragma once
23
25#include "gui/widgets/popup.h"
26
27class Being;
28class BrowserBox;
29class FloorItem;
30class Item;
31class Window;
32
36class PopupMenu : public Popup, public LinkHandler
37{
38 public:
39 PopupMenu();
40
44 void showPopup(int x, int y, Being *being);
45
50 void showPopup(int x, int y, FloorItem *floorItem);
51
56 void showPopup(Window *parent, int x, int y, Item *item,
57 bool isInventory, bool canDrop = true);
58
62 void handleLink(const std::string &link) override;
63
64 private:
66
67 int mBeingId = 0;
69 Item *mItem = nullptr;
70
72
76 void showPopup(int x, int y);
77};
Definition being.h:65
A simple browser box able to handle links and forward events to the parent conteiner.
Definition browserbox.h:74
An item lying on the floor.
Definition flooritem.h:32
Represents one or more instances of a certain item type.
Definition item.h:35
A simple interface to windows that need to handle links from BrowserBox widget.
Definition linkhandler.h:31
Window showing popup menu.
Definition popupmenu.h:37
Item * mItem
Definition popupmenu.h:69
int mBeingId
Definition popupmenu.h:67
void handleLink(const std::string &link) override
Handles link action.
void showPopup(int x, int y, Being *being)
Shows the being related popup menu at the specified mouse coords.
Definition popupmenu.cpp:66
BrowserBox * mBrowserBox
Definition popupmenu.h:65
Window * mWindow
Definition popupmenu.h:71
FloorItem * mFloorItem
Definition popupmenu.h:68
A light version of the Window class.
Definition popup.h:48
A window.
Definition window.h:59