ScummVM API documentation
textarea.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 /*
23  * This code is based on the CRAB engine
24  *
25  * Copyright (c) Arvind Raja Yadav
26  *
27  * Licensed under MIT
28  *
29  */
30 
31 //=============================================================================
32 // Author: Arvind
33 // Purpose: A box for entering text
34 //=============================================================================
35 #ifndef CRAB_TEXTAREA_H
36 #define CRAB_TEXTAREA_H
37 
38 #include "crab/music/MusicManager.h"
39 #include "crab/ui/HoverInfo.h"
40 
41 namespace Crab {
42 
43 namespace pyrodactyl {
44 namespace ui {
45 class TextArea : public TextData {
46  // The maximum number of characters allowed
47  uint _size;
48 
49  // The name of the text area is stored here
50  HoverInfo _title;
51 
52  // Sound effects
53  pyrodactyl::music::ChunkKey _seEntry, _seErase, _seAccept;
54 
55 public:
56  Common::String _text;
57 
58  TextArea() {
59  _size = 20;
60  _seEntry = -1;
61  _seErase = -1;
62  _seAccept = -1;
63  }
64  ~TextArea() {}
65 
66  void load(rapidxml::xml_node<char> *node);
67 
68  bool handleEvents(const Common::Event &event, bool numbersOnly = false);
69 
70  void draw();
71 
72  void setUI() {
73  _title.setUI();
74  TextData::setUI();
75  }
76 };
77 } // End of namespace ui
78 } // End of namespace pyrodactyl
79 
80 } // End of namespace Crab
81 
82 #endif // CRAB_TEXTAREA_H
Definition: str.h:59
Definition: textarea.h:45
Definition: TextData.h:41
Definition: events.h:199
Definition: moveeffect.h:37
Definition: HoverInfo.h:41