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/baglib/storage_dev_win.h"
27 #include "bagel/baglib/sprite_object.h"
28 
29 namespace Bagel {
30 
31 class CBagMenu : public CBagStorageDev {
32 private:
33  static CBofList<CBagObject *> *_pUniversalObjectList; // Objects used in every menu
34  static int _nDefaultDelay;
35 
36  int16 _nDelay;
37  int16 _nY; // Replaces _nNextPos
38 
39 public:
40  CBagMenu();
41  static void initialize();
42 
43  ErrorCode setBackground(CBofBitmap * /*pBmp*/) {
44  assert(false);
45  return ERR_NONE;
46  }
47  CBofBitmap *getBackground() {
48  assert(false);
49  return nullptr;
50  }
51 
52  bool addItem(CBagObject *pObj, void *(*func)(int, void *), void *info);
53  bool deleteItem(const CBofString &sLabel);
54 
55  bool isChecked(const CBofString &sLabel, const CBofString &sSubLabel = CBofString());
56  bool isChecked(int nRefId);
57  bool isCheckedPos(int nRow, int nCol = -1);
58  bool check(const CBofString &sLabel, const CBofString &sSubLabel = CBofString());
59  bool check(int nRefId);
60  bool unCheck(const CBofString &sLabel, const CBofString &sSubLabel = CBofString());
61  bool unCheck(int nRefId);
62 
63  bool trackPopupMenu(uint32 nFlags, int x, int y, CBofWindow *pWnd, CBofPalette *pPal, CBofRect *lpRect = nullptr);
64 
65  static bool removeUniversalObjectList();
66  static bool setUniversalObjectList(CBofList<CBagObject *> *pObjList);
67  static CBofList<CBagObject *> *getUniversalObjectList() {
68  return _pUniversalObjectList;
69  }
70 
71  CBagObject *onNewSpriteObject(const CBofString &);
72 };
73 
75  friend class CBagMenu;
76 
77 private:
78  bool _bMultipleDialogs;
79  bool _bAcceptInput;
80 
81 public:
82  static CBagObject *_pSelectedObject;
83  static void initialize();
84 
85  CBagMenuDlg();
86  virtual ~CBagMenuDlg();
87 
88  ErrorCode createDlg(CBofWindow *pWnd, CBofPalette *pPal, CBofRect *cRect);
89 
90  virtual void onMouseMove(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
91  virtual void onLButtonUp(uint32 nFlags, CBofPoint *pPoint, void * = nullptr);
92 
93  virtual void onDeActivate();
94 
95  virtual void onTimer(uint32 nID);
96  virtual void onPaint(CBofRect *pRect);
97 };
98 
99 extern bool g_pauseTimerFl;
100 
101 } // namespace Bagel
102 
103 #endif
Definition: window.h:50
Definition: menu_dlg.h:74
Definition: bitmap.h:55
Definition: rect.h:36
Definition: object.h:85
Definition: string.h:38
Definition: bagel.h:31
Definition: storage_dev_win.h:482
Definition: point.h:34
Definition: palette.h:69
Definition: menu_dlg.h:31
Definition: storage_dev_win.h:78
Definition: list.h:60