Root/src/inputdialog.h

Source at commit 73ceffa51d3450d2d20ce933e7fc6da187e09fc8 created 7 years 5 months ago.
By Maarten ter Huurne, Fix bug in section directory creation method
1/***************************************************************************
2 * Copyright (C) 2006 by Massimiliano Torromeo *
3 * massimiliano.torromeo@gmail.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20
21#ifndef INPUTDIALOG_H
22#define INPUTDIALOG_H
23
24#include "dialog.h"
25#include "buttonbox.h"
26
27#include <SDL.h>
28#include <string>
29#include <vector>
30
31class InputManager;
32
33class InputDialog : protected Dialog {
34public:
35    InputDialog(GMenu2X& gmenu2x, InputManager &inputMgr,
36            const std::string &text, const std::string &startvalue="",
37            const std::string &title="", const std::string &icon="");
38
39    bool exec();
40    const std::string &getInput() { return input; }
41
42private:
43    void backspace();
44    void space();
45    void confirm();
46    void changeKeys();
47
48    void drawVirtualKeyboard();
49    void setKeyboard(int);
50
51    InputManager &inputMgr;
52    int selRow, selCol;
53    bool close, ok;
54    std::string title, text, icon;
55    short curKeyboard;
56    std::vector<std::vector<std::string>> keyboard;
57    std::vector<std::string> *kb;
58    int kbLength, kbWidth, kbHeight, kbLeft;
59    SDL_Rect kbRect;
60    ButtonBox buttonbox;
61    std::string input;
62};
63
64#endif // INPUTDIALOG_H
65

Archive Download this file



interactive