ScummVM API documentation
dialogs.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 HUGO_DIALOGS_H
23#define HUGO_DIALOGS_H
24
25#include "gui/dialog.h"
26#include "gui/widgets/edittext.h"
27
28namespace Hugo {
29
30class HugoEngine;
31
32enum MenuOption {
33 kMenuWhat = 0,
34 kMenuMusic,
35 kMenuSoundFX,
36 kMenuSave,
37 kMenuLoad,
38 kMenuRecall,
39 kMenuTurbo,
40 kMenuLook,
41 kMenuInventory
42};
43
44enum {
45 kMenuWidth = 320,
46 kMenuHeight = 24,
47 kMenuX = 5,
48 kMenuY = 1,
49 kButtonWidth = 20,
50 kButtonHeight = 20,
51 kButtonPad = 1,
52 kButtonSpace = 5
53};
54
55enum {
56 // TopMenu commands
57 kCmdWhat = 'WHAT',
58 kCmdMusic = 'MUZK',
59 kCmdSoundFX = 'SOUN',
60 kCmdSave = 'SAVE',
61 kCmdLoad = 'LOAD',
62 kCmdRecall = 'RECL',
63 kCmdTurbo = 'TURB',
64 kCmdLook = 'LOOK',
65 kCmdInvent = 'INVT',
66
67 // EntryDialog commands
68 kCmdButton = 'BTNP',
69 kCmdFinishEdit = 'FNSH'
70};
71
72class TopMenu : public GUI::Dialog {
73public:
75 ~TopMenu() override;
76
77 void reflowLayout() override;
78 void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) override;
79 void handleMouseUp(int x, int y, int button, int clickCount) override;
80
81 void loadBmpArr(Common::SeekableReadStream &in);
82
83protected:
84 void init();
85
86 HugoEngine *_vm;
87
88 GUI::PicButtonWidget *_whatButton;
89 GUI::PicButtonWidget *_musicButton;
90 GUI::PicButtonWidget *_soundFXButton;
91 GUI::PicButtonWidget *_loadButton;
92 GUI::PicButtonWidget *_saveButton;
93 GUI::PicButtonWidget *_recallButton;
94 GUI::PicButtonWidget *_turboButton;
95 GUI::PicButtonWidget *_lookButton;
96 GUI::PicButtonWidget *_inventButton;
97
98 Graphics::Surface **_arrayBmp;
99 uint16 _arraySize;
100};
101
102class EntryDialog : public GUI::Dialog {
103public:
104 EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue);
105 ~EntryDialog() override;
106
107 void handleCommand(GUI::CommandSender *sender, uint32 command, uint32 data) override;
108
109 const Common::U32String &getEditString() const { return _text->getEditString(); }
110
111protected:
112 GUI::EditTextWidget *_text;
113};
114
115}
116
117#endif // HUGO_DIALOGS_H
Definition: stream.h:745
Definition: str.h:59
Definition: ustr.h:57
Definition: object.h:40
Definition: dialog.h:49
Definition: edittext.h:32
Definition: widget.h:314
Definition: dialogs.h:102
Definition: hugo.h:219
Definition: dialogs.h:72
Definition: console.h:27
Definition: surface.h:67