101 lines
1.7 KiB
C++
101 lines
1.7 KiB
C++
#ifndef __MENUITEMS_H
|
|
#define __MENUITEMS_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include <SDL.h>
|
|
#include "menuitem.h"
|
|
|
|
class MISendSDLEvent : public MenuItem {
|
|
private:
|
|
SDL_Event sendevent;
|
|
public:
|
|
MISendSDLEvent(std::string str, SDL_Event event);
|
|
|
|
void select();
|
|
void resetEvent(SDL_Event event);
|
|
};
|
|
|
|
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);
|
|
|
|
int getMaxValueLen();
|
|
|
|
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);
|
|
int getMaxValueLen();
|
|
std::string getValue();
|
|
void setMaxLen(int _maxlen);
|
|
|
|
};
|
|
|
|
class MICheckBox : public MenuItem {
|
|
private:
|
|
bool state;
|
|
|
|
void updateValue();
|
|
public:
|
|
MICheckBox(std::string str);
|
|
|
|
bool isChecked();
|
|
int getMaxValueLen();
|
|
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);
|
|
};
|
|
|
|
#endif
|