1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-26 04:30:38 +02:00

MessageBox: header cleanups.

This commit is contained in:
Maarten ter Huurne 2011-10-23 11:32:16 +02:00
parent 3252c777c3
commit 9e876a6f90
2 changed files with 23 additions and 25 deletions

View File

@ -18,10 +18,10 @@
* 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 "messagebox.h" #include "messagebox.h"
#include "gmenu2x.h"
#include <SDL_gfxPrimitives.h>
using namespace std; using namespace std;

View File

@ -18,31 +18,29 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/ ***************************************************************************/
#ifndef MESSAGEBOX_H_ #ifndef MESSAGEBOX_H
#define MESSAGEBOX_H_ #define MESSAGEBOX_H
#define MB_BTN_B 0 #include "inputmanager.h"
#define MB_BTN_X 1
#define MB_BTN_START 2
#define MB_BTN_SELECT 3
#include <SDL.h>
#include <string> #include <string>
#include "gmenu2x.h"
using std::string; class GMenu2X;
class MessageBox { class MessageBox {
private:
string text, icon;
GMenu2X *gmenu2x;
string buttons[BUTTON_TYPE_SIZE];
string buttonLabels[BUTTON_TYPE_SIZE];
SDL_Rect buttonPositions[BUTTON_TYPE_SIZE];
public: public:
MessageBox(GMenu2X *gmenu2x, const string &text, const string &icon=""); MessageBox(GMenu2X *gmenu2x, const std::string &text,
void setButton(InputManager::Button button, const string &label); const std::string &icon="");
void setButton(InputManager::Button button, const std::string &label);
int exec(); int exec();
private:
GMenu2X *gmenu2x;
std::string text, icon;
std::string buttons[BUTTON_TYPE_SIZE];
std::string buttonLabels[BUTTON_TYPE_SIZE];
SDL_Rect buttonPositions[BUTTON_TYPE_SIZE];
}; };
#endif /*MESSAGEBOX_H_*/ #endif // MESSAGEBOX_H