mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 23:30:37 +02:00
InputDialog: header cleanup.
This commit is contained in:
parent
cfd294b9ae
commit
40fcd5137e
@ -18,14 +18,20 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
|
||||
#include "inputdialog.h"
|
||||
|
||||
#include "buttonbox.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include <SDL_gfxPrimitives.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace fastdelegate;
|
||||
|
||||
#define KEY_WIDTH 20
|
||||
#define KEY_HEIGHT 20
|
||||
#define KB_TOP 90
|
||||
|
||||
InputDialog::InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr_,
|
||||
Touchscreen &ts_, const string &text,
|
||||
const string &startvalue, const string &title, const string &icon)
|
||||
|
@ -18,53 +18,29 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef INPUTDIALOG_H_
|
||||
#define INPUTDIALOG_H_
|
||||
#ifndef INPUTDIALOG_H
|
||||
#define INPUTDIALOG_H
|
||||
|
||||
#define KEY_WIDTH 20
|
||||
#define KEY_HEIGHT 20
|
||||
#define KB_TOP 90
|
||||
|
||||
#define ID_NO_ACTION 0
|
||||
#define ID_ACTION_CLOSE 1
|
||||
#define ID_ACTION_UP 2
|
||||
#define ID_ACTION_DOWN 3
|
||||
#define ID_ACTION_LEFT 4
|
||||
#define ID_ACTION_RIGHT 5
|
||||
#define ID_ACTION_BACKSPACE 6
|
||||
#define ID_ACTION_SPACE 7
|
||||
#define ID_ACTION_GOUP 8
|
||||
#define ID_ACTION_SELECT 9
|
||||
#define ID_ACTION_KB_CHANGE 10
|
||||
|
||||
#include <string>
|
||||
#include "gmenu2x.h"
|
||||
#include "dialog.h"
|
||||
#include "buttonbox.h"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
typedef vector<string> stringlist;
|
||||
#include <SDL.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class ButtonBox;
|
||||
class InputManager;
|
||||
class Touchscreen;
|
||||
|
||||
class InputDialog : protected Dialog {
|
||||
private:
|
||||
InputManager &inputMgr;
|
||||
Touchscreen &ts;
|
||||
int selRow, selCol;
|
||||
bool close, ok;
|
||||
string title, text, icon;
|
||||
short curKeyboard;
|
||||
vector<stringlist> keyboard;
|
||||
stringlist *kb;
|
||||
int kbLength, kbWidth, kbHeight, kbLeft;
|
||||
SDL_Rect kbRect;
|
||||
ButtonBox *buttonbox;
|
||||
string input;
|
||||
public:
|
||||
InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr, Touchscreen &ts,
|
||||
const std::string &text, const std::string &startvalue="",
|
||||
const std::string &title="", const std::string &icon="");
|
||||
|
||||
bool exec();
|
||||
const std::string &getInput() { return input; }
|
||||
|
||||
private:
|
||||
void backspace();
|
||||
void space();
|
||||
void confirm();
|
||||
@ -73,11 +49,18 @@ private:
|
||||
void drawVirtualKeyboard();
|
||||
void setKeyboard(int);
|
||||
|
||||
public:
|
||||
InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr, Touchscreen &ts, const string &text, const string &startvalue="", const string &title="", const string &icon="");
|
||||
|
||||
bool exec();
|
||||
const string &getInput() { return input; }
|
||||
InputManager &inputMgr;
|
||||
Touchscreen &ts;
|
||||
int selRow, selCol;
|
||||
bool close, ok;
|
||||
std::string title, text, icon;
|
||||
short curKeyboard;
|
||||
std::vector< std::vector<std::string> > keyboard;
|
||||
std::vector<std::string> *kb;
|
||||
int kbLength, kbWidth, kbHeight, kbLeft;
|
||||
SDL_Rect kbRect;
|
||||
ButtonBox *buttonbox;
|
||||
std::string input;
|
||||
};
|
||||
|
||||
#endif /*INPUTDIALOG_H_*/
|
||||
#endif // INPUTDIALOG_H
|
||||
|
@ -17,7 +17,10 @@
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "menusettingstring.h"
|
||||
|
||||
#include "gmenu2x.h"
|
||||
#include "iconbutton.h"
|
||||
#include "inputdialog.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user