Root/
Source at commit 00d3c3b57008bddf8770c51271db9d766acaf854 created 8 years 11 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 | |
12 | class GMenu2X; |
13 | class Menu; |
14 | |
15 | |
16 | /** |
17 | * A popup dialog containing action on the current section or link. |
18 | */ |
19 | class ContextMenu : public Layer { |
20 | public: |
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 | |
28 | private: |
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 |
Branches:
install_locations
master
opkrun
packages