mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-23 04:29:41 +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. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <SDL.h>
|
|
||||||
#include <SDL_gfxPrimitives.h>
|
|
||||||
|
|
||||||
#include "inputdialog.h"
|
#include "inputdialog.h"
|
||||||
|
|
||||||
|
#include "buttonbox.h"
|
||||||
|
#include "gmenu2x.h"
|
||||||
|
|
||||||
|
#include <SDL_gfxPrimitives.h>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace fastdelegate;
|
using namespace fastdelegate;
|
||||||
|
|
||||||
|
#define KEY_WIDTH 20
|
||||||
|
#define KEY_HEIGHT 20
|
||||||
|
#define KB_TOP 90
|
||||||
|
|
||||||
InputDialog::InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr_,
|
InputDialog::InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr_,
|
||||||
Touchscreen &ts_, const string &text,
|
Touchscreen &ts_, const string &text,
|
||||||
const string &startvalue, const string &title, const string &icon)
|
const string &startvalue, const string &title, const string &icon)
|
||||||
|
@ -18,53 +18,29 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#ifndef INPUTDIALOG_H_
|
#ifndef INPUTDIALOG_H
|
||||||
#define 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 "dialog.h"
|
||||||
#include "buttonbox.h"
|
|
||||||
|
|
||||||
using std::string;
|
#include <SDL.h>
|
||||||
using std::vector;
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
typedef vector<string> stringlist;
|
|
||||||
|
|
||||||
|
class ButtonBox;
|
||||||
class InputManager;
|
class InputManager;
|
||||||
class Touchscreen;
|
class Touchscreen;
|
||||||
|
|
||||||
class InputDialog : protected Dialog {
|
class InputDialog : protected Dialog {
|
||||||
private:
|
public:
|
||||||
InputManager &inputMgr;
|
InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr, Touchscreen &ts,
|
||||||
Touchscreen &ts;
|
const std::string &text, const std::string &startvalue="",
|
||||||
int selRow, selCol;
|
const std::string &title="", const std::string &icon="");
|
||||||
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;
|
|
||||||
|
|
||||||
|
bool exec();
|
||||||
|
const std::string &getInput() { return input; }
|
||||||
|
|
||||||
|
private:
|
||||||
void backspace();
|
void backspace();
|
||||||
void space();
|
void space();
|
||||||
void confirm();
|
void confirm();
|
||||||
@ -73,11 +49,18 @@ private:
|
|||||||
void drawVirtualKeyboard();
|
void drawVirtualKeyboard();
|
||||||
void setKeyboard(int);
|
void setKeyboard(int);
|
||||||
|
|
||||||
public:
|
InputManager &inputMgr;
|
||||||
InputDialog(GMenu2X *gmenu2x, InputManager &inputMgr, Touchscreen &ts, const string &text, const string &startvalue="", const string &title="", const string &icon="");
|
Touchscreen &ts;
|
||||||
|
int selRow, selCol;
|
||||||
bool exec();
|
bool close, ok;
|
||||||
const string &getInput() { return input; }
|
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., *
|
* Free Software Foundation, Inc., *
|
||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include "menusettingstring.h"
|
#include "menusettingstring.h"
|
||||||
|
|
||||||
|
#include "gmenu2x.h"
|
||||||
#include "iconbutton.h"
|
#include "iconbutton.h"
|
||||||
#include "inputdialog.h"
|
#include "inputdialog.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user