00001 /* 00002 GLICT - Graphics Library Interface Creation Toolkit 00003 Copyright (C) 2006-2007 OBJECT Networks 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 00021 #ifndef __GLICT_MESSAGEBOX_H 00022 #define __GLICT_MESSAGEBOX_H 00023 #include <string> 00024 #include <GLICT/window.h> 00025 #include <GLICT/button.h> 00026 #include <GLICT/panel.h> 00027 00029 class glictMessageBox : public glictWindow { 00030 public: 00031 glictMessageBox(); 00032 ~glictMessageBox(); 00033 00034 void Paint(); 00035 void SetMessage(std::string msg); //< Sets the message that will be displayed on the messagebox. (Not the caption, the message itself!) 00036 void SetOnDismiss(void(*OnClickFunction)(glictPos* relmousepos, glictContainer* callerclass)); //< Sets function to be called upon dismiss of the msgbox. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN. 00037 void SetHeight(int height); 00038 void SetWidth(int width); 00039 void SetEnabled(bool enabled); 00040 void SetBGColor(float r, float g, float b, float a); 00041 private: 00042 glictButton btnOk; 00043 glictPanel pnlMessage; 00044 std::string mesg; 00045 void(*OnDismissFunction)(glictPos* relmousepos, glictContainer* callerclass); //< Called upon dismiss of the msgbox. OBJECT MUST NOT DESTROY ITSELF OR REMOVE ITSELF FROM OBJECT LIST OF ITS PARENT FROM WITHIN. 00046 00047 friend void _glictMessageBox_Closer(glictPos* relmousepos, glictContainer* caller); 00048 }; 00049 #endif