ScummVM API documentation
macpopupmenu.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GRAPHICS_MACGUI_MACPOPUPMENU_H
23 #define GRAPHICS_MACGUI_MACPOPUPMENU_H
24 
25 #include "graphics/macgui/macmenu.h"
26 
27 namespace Graphics {
28 
29 class MacMenu;
30 class MacWindowManager;
31 
32 class MacPopUp : public MacMenu {
33 public:
34  MacPopUp(int id, const Common::Rect &bounds, MacWindowManager *wm, const char *string);
35  uint32 drawAndSelectMenu(int x, int y, int item);
36  Common::String getItemText(int item);
37 
38  bool draw(ManagedSurface *g, bool forceRedraw = false) override;
39  void closeMenu() override;
40 
41  // Extra functions
42  void setSmart(bool smart) {
43  _isSmart = smart;
44  }
45 private:
46  int kBlinkDelay = 15; // Blink delay for closing animation
47  int kNumBlinks = 3; // Number of blinks
48 
49  int _mouseX;
50  int _mouseY;
51  int _menuItemId;
52  int _menuId;
53 
54  bool _isSmart = false;
55  int _offsetY = 0;
56  int _prevCheckedItem = -1;
57 
58  bool mouseClicked(int x, int y);
59 };
60 } // End of namespace Graphics
61 #endif
Definition: managed_surface.h:51
bool draw(ManagedSurface *g, bool forceRedraw=false) override
Definition: str.h:59
Definition: rect.h:144
Definition: macpopupmenu.h:32
Definition: macwindowmanager.h:149
Definition: formatinfo.h:28
Definition: macmenu.h:94