ScummVM API documentation
select_number.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 MM1_VIEWS_ENH_SELECT_NUMBER_H
23#define MM1_VIEWS_ENH_SELECT_NUMBER_H
24
25#include "mm/mm1/views_enh/scroll_view.h"
26#include "mm/shared/xeen/sprites.h"
27
28namespace MM {
29namespace MM1 {
30namespace ViewsEnh {
31
32typedef void (*SelectNumberProc)(int choiceNum);
33
35private:
36 SelectNumberProc _callback = nullptr;
37 int _maxNumber = 0;
38
39public:
41 virtual ~SelectNumberSubview() {}
42
43 void open(int maxNum, SelectNumberProc callback);
44 void close() override;
45
46 void draw() override;
47 bool msgMouseDown(const MouseDownMessage &msg) override;
48};
49
50class SelectNumber : public ScrollView {
51private:
52 SelectNumberSubview _subView;
53
54protected:
58 void openNumbers(int maxNum);
59
63 void closeNumbers() {
64 _subView.close();
65 }
66
67public:
68 SelectNumber(const Common::String &name) : ScrollView(name) {}
69 virtual ~SelectNumber() {}
70
71 bool msgMouseDown(const MouseDownMessage &msg) override;
72};
73
74} // namespace ViewsEnh
75} // namespace MM1
76} // namespace MM
77
78#endif
Definition: str.h:59
Definition: scroll_view.h:41
Definition: select_number.h:50
bool msgMouseDown(const MouseDownMessage &msg) override
void closeNumbers()
Definition: select_number.h:63
Definition: select_number.h:34
bool msgMouseDown(const MouseDownMessage &msg) override
Definition: detection.h:27
Definition: messages.h:72