ScummVM API documentation
menu_dlg.h
1
2/* ScummVM - Graphic Adventure Engine
3 *
4 * ScummVM is the legal property of its developers, whose names
5 * are too numerous to list here. Please refer to the COPYRIGHT
6 * file distributed with this source distribution.
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 3 of the License, or
11 * (at your option) 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
23#ifndef BAGEL_BAGLIB_MENU_DLG_H
24#define BAGEL_BAGLIB_MENU_DLG_H
25
26#include "bagel/spacebar/baglib/storage_dev_win.h"
27#include "bagel/spacebar/baglib/sprite_object.h"
28
29namespace Bagel {
30namespace SpaceBar {
31
32class CBagMenu : public CBagStorageDev {
33private:
34 static CBofList<CBagObject *> *_pUniversalObjectList; // Objects used in every menu
35 static int _nDefaultDelay;
36
37 int16 _nDelay;
38 int16 _nY; // Replaces _nNextPos
39
40public:
41 CBagMenu();
42 static void initialize();
43
44 ErrorCode setBackground(CBofBitmap * /*pBmp*/) {
45 assert(false);
46 return ERR_NONE;
47 }
48 CBofBitmap *getBackground() {
49 assert(false);
50 return nullptr;
51 }
52
53 bool addItem(CBagObject *pObj, void *(*func)(int, void *), void *info);
54 bool deleteItem(const CBofString &sLabel);
55
56 bool isChecked(const CBofString &sLabel, const CBofString &sSubLabel = CBofString());
57 bool isChecked(int nRefId);
58 bool isCheckedPos(int nRow, int nCol = -1);
59 bool check(const CBofString &sLabel, const CBofString &sSubLabel = CBofString());
60 bool check(int nRefId);
61 bool unCheck(const CBofString &sLabel, const CBofString &sSubLabel = CBofString());
62 bool unCheck(int nRefId);
63
64 bool trackPopupMenu(uint32 nFlags, int x, int y, CBofWindow *pWnd, CBofPalette *pPal, CBofRect *lpRect = nullptr);
65
66 static bool removeUniversalObjectList();
67 static bool setUniversalObjectList(CBofList<CBagObject *> *pObjList);
68 static CBofList<CBagObject *> *getUniversalObjectList() {
69 return _pUniversalObjectList;
70 }
71
72 CBagObject *onNewSpriteObject(const CBofString &);
73};
74
76 friend class CBagMenu;
77
78private:
79 bool _bMultipleDialogs;
80 bool _bAcceptInput;
81
82public:
83 static CBagObject *_pSelectedObject;
84 static void initialize();
85
87 virtual ~CBagMenuDlg();
88
89 ErrorCode createDlg(CBofWindow *pWnd, CBofPalette *pPal, CBofRect *cRect);
90
91 virtual void onMouseMove(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
92 virtual void onLButtonUp(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
93
94 virtual void onDeActivate();
95
96 virtual void onTimer(uint32 nID);
97 virtual void onPaint(CBofRect *pRect);
98};
99
100extern bool g_pauseTimerFl;
101
102} // namespace SpaceBar
103} // namespace Bagel
104
105#endif
Definition: point.h:32
Definition: rect.h:35
Definition: string.h:38
Definition: menu_dlg.h:75
Definition: menu_dlg.h:32
Definition: object.h:86
Definition: storage_dev_win.h:486
Definition: storage_dev_win.h:79
Definition: bitmap.h:57
Definition: list.h:60
Definition: palette.h:64
Definition: window.h:53