guihint.h

Go to the documentation of this file.
00001 /********************************************************************************/
00002 /*                                                                              */
00003 /*  Netrinjo-Engine - a library for game-development                            */
00004 /*  Copyright (C) 1999, 2000, 2005 by Tobias Nadler und Georg Schnattinger      */
00005 /*                                                                              */
00006 /*  This library is free software; you can redistribute it and/or               */
00007 /*  modify it under the terms of the GNU Lesser General Public                  */
00008 /*  License as published by the Free Software Foundation; either                */
00009 /*  version 2.1 of the License, or (at your option) any later version.          */
00010 /*                                                                              */
00011 /*  This library is distributed in the hope that it will be useful,             */
00012 /*  but WITHOUT ANY WARRANTY; without even the implied warranty of              */
00013 /*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU           */
00014 /*  Lesser General Public License for more details.                             */
00015 /*                                                                              */
00016 /*  You should have received a copy of the GNU Lesser General Public            */
00017 /*  License along with this library; if not, write to the Free Software         */
00018 /*  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   */
00019 /*                                                                              */
00020 /********************************************************************************/
00021 
00022 #ifndef GUIHINT_H
00023 #define GUIHINT_H
00024 
00025 #include "guitext.h"
00026 #include "frametimer.h"
00027 
00039 class DECLSPEC GuiHint : public GuiFlowWindow
00040 {
00041 public:
00042     DECLSPEC GuiHint( const SDL_Rect &r, GuiElement *el, const char *name );
00049     DECLSPEC GuiHint(TiXmlElement *el, GuiElement *p);
00050     virtual DECLSPEC ~GuiHint();
00051     
00052     virtual const char *getClassName()  { return "GuiHint"; }
00053     
00054     DECLSPEC void show( int time );
00055     void setText( const char *t )   { text->setText(t); }
00056     void setTextfont( bool l, GuiText::FontSize s, bool std = false )   { text->chooseFont( s, l ); }
00057     DECLSPEC void showHint( const char *txt, int time = 0, SDL_Rect *r = 0 );
00058 
00059     static void newguiobject(void *presult, BasicObject *o, void *xmldata)
00060     {
00061         GuiElement *r = new GuiHint((TiXmlElement*)xmldata, (GuiElement*)o);
00062         *(GuiElement**)presult = r;
00063     }
00064 protected:
00065     virtual DECLSPEC Uint32 onResize();
00066     virtual DECLSPEC void onInit();
00067     virtual DECLSPEC Uint32 onThemeChanged( UiTheme *t );
00068 
00069 private:
00070     void onTimer();
00071     FrameTimer::CbInfo * timerinfo;
00072     GuiText *text;
00073     static inline void onTimer( void *sender, BasicObject *aim, void * data )
00074     {
00075         ( (GuiHint*)aim )->onTimer();
00076     }
00077     Uint32 tShow;
00078 
00079     friend class UiManager;
00080 };
00081 
00082 #endif

Generated on Wed May 9 17:35:55 2007 for netrinjo by  doxygen 1.5.1