Root/src/contextmenu.h

Source at commit 00d3c3b57008bddf8770c51271db9d766acaf854 created 7 years 5 months ago.
By Maarten ter Huurne, Gave Layer class a protected constructor
1// Various authors.
2// License: GPL version 2 or later.
3
4#ifndef __CONTEXTMENU_H__
5#define __CONTEXTMENU_H__
6
7#include "layer.h"
8
9#include <SDL.h>
10#include <memory>
11
12class GMenu2X;
13class Menu;
14
15
16/**
17 * A popup dialog containing action on the current section or link.
18 */
19class ContextMenu : public Layer {
20public:
21    ContextMenu(GMenu2X &gmenu2x, Menu &menu);
22
23    // Layer implementation:
24    virtual bool runAnimations();
25    virtual void paint(Surface &s);
26    virtual bool handleButtonPress(InputManager::Button button);
27
28private:
29    struct MenuOption;
30
31    GMenu2X &gmenu2x;
32    Menu &menu;
33    std::vector<std::shared_ptr<MenuOption>> options;
34    SDL_Rect box;
35
36    int fadeAlpha;
37    int selected;
38    long tickStart;
39};
40
41#endif // __CONTEXTMENU_H__
42

Archive Download this file



interactive