From 9e876a6f90ab91c2b045e0985bf16d2e5694a53e Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Sun, 23 Oct 2011 11:32:16 +0200 Subject: [PATCH] MessageBox: header cleanups. --- src/messagebox.cpp | 10 +++++----- src/messagebox.h | 38 ++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/messagebox.cpp b/src/messagebox.cpp index 0b870af..f0ec01b 100644 --- a/src/messagebox.cpp +++ b/src/messagebox.cpp @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -18,10 +18,10 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include - #include "messagebox.h" +#include "gmenu2x.h" + +#include using namespace std; diff --git a/src/messagebox.h b/src/messagebox.h index f0a6bc5..561cdae 100644 --- a/src/messagebox.h +++ b/src/messagebox.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2006 by Massimiliano Torromeo * - * massimiliano.torromeo@gmail.com * + * Copyright (C) 2006 by Massimiliano Torromeo * + * massimiliano.torromeo@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -18,31 +18,29 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef MESSAGEBOX_H_ -#define MESSAGEBOX_H_ +#ifndef MESSAGEBOX_H +#define MESSAGEBOX_H -#define MB_BTN_B 0 -#define MB_BTN_X 1 -#define MB_BTN_START 2 -#define MB_BTN_SELECT 3 +#include "inputmanager.h" +#include #include -#include "gmenu2x.h" -using std::string; +class GMenu2X; 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: - MessageBox(GMenu2X *gmenu2x, const string &text, const string &icon=""); - void setButton(InputManager::Button button, const string &label); + MessageBox(GMenu2X *gmenu2x, const std::string &text, + const std::string &icon=""); + void setButton(InputManager::Button button, const std::string &label); 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