2008-03-08 23:03:26 +01:00
|
|
|
#ifndef __MENUITEMS_H
|
|
|
|
#define __MENUITEMS_H
|
|
|
|
|
2008-03-23 18:00:55 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2008-03-08 23:03:26 +01:00
|
|
|
#include <SDL.h>
|
|
|
|
#include "menuitem.h"
|
|
|
|
|
|
|
|
class MISendSDLEvent : public MenuItem {
|
|
|
|
private:
|
|
|
|
SDL_Event sendevent;
|
|
|
|
public:
|
|
|
|
MISendSDLEvent(std::string str, SDL_Event event);
|
|
|
|
|
|
|
|
void select();
|
2008-03-23 18:00:55 +01:00
|
|
|
void resetEvent(SDL_Event event);
|
2008-03-08 23:03:26 +01:00
|
|
|
};
|
|
|
|
|
2008-03-23 18:00:55 +01:00
|
|
|
class MITextLabel : public MenuItem {
|
|
|
|
private:
|
|
|
|
|
|
|
|
public:
|
|
|
|
MITextLabel(std::string str);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class MIValueLabel : public MenuItem {
|
|
|
|
private:
|
|
|
|
|
|
|
|
public:
|
|
|
|
MIValueLabel(std::string str);
|
|
|
|
void setValue(std::string);
|
|
|
|
};
|
|
|
|
|
|
|
|
class MIToggle : public MenuItem {
|
|
|
|
private:
|
|
|
|
std::vector<std::string> toggles;
|
|
|
|
int togglepos;
|
|
|
|
public:
|
|
|
|
MIToggle(std::string);
|
|
|
|
|
|
|
|
void left();
|
|
|
|
void right();
|
|
|
|
void select();
|
|
|
|
|
|
|
|
void addToggle(std::string);
|
|
|
|
|
2008-03-31 13:00:13 +02:00
|
|
|
int getMaxValueLen();
|
|
|
|
|
2008-03-23 18:00:55 +01:00
|
|
|
int getValueInt();
|
|
|
|
void setValueInt(int val);
|
|
|
|
std::string getValueString();
|
|
|
|
void setValueString(std::string str);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class MIStringInput : public MenuItem {
|
|
|
|
private:
|
|
|
|
int maxlen;
|
|
|
|
public:
|
|
|
|
MIStringInput(std::string str, int _maxlen=0);
|
|
|
|
void charInput(char c);
|
|
|
|
void setValue(std::string str);
|
2008-03-31 13:00:13 +02:00
|
|
|
int getMaxValueLen();
|
2008-03-23 18:00:55 +01:00
|
|
|
std::string getValue();
|
2008-04-01 21:25:26 +02:00
|
|
|
void setMaxLen(int _maxlen);
|
2008-03-23 18:00:55 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class MICheckBox : public MenuItem {
|
|
|
|
private:
|
|
|
|
bool state;
|
|
|
|
|
|
|
|
void updateValue();
|
|
|
|
public:
|
|
|
|
MICheckBox(std::string str);
|
|
|
|
|
|
|
|
bool isChecked();
|
2008-03-31 13:00:13 +02:00
|
|
|
int getMaxValueLen();
|
2008-03-23 18:00:55 +01:00
|
|
|
void setState(bool _state);
|
|
|
|
void select();
|
|
|
|
void right();
|
|
|
|
void left();
|
|
|
|
};
|
|
|
|
|
|
|
|
class MIEventOnToggle : public MIToggle {
|
|
|
|
private:
|
|
|
|
SDL_Event sendevent;
|
|
|
|
void sendEvent();
|
|
|
|
public:
|
|
|
|
MIEventOnToggle(std::string str, SDL_Event event);
|
|
|
|
|
|
|
|
void select();
|
|
|
|
void left();
|
|
|
|
void right();
|
|
|
|
|
|
|
|
void resetEvent(SDL_Event event);
|
|
|
|
};
|
2008-03-08 23:03:26 +01:00
|
|
|
|
|
|
|
#endif
|