00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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