Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CUI_Frame.h

Go to the documentation of this file.
00001 
00015 #ifndef CUI_FRAME_H
00016 #define CUI_FRAME_H
00017 
00018 #include <list>
00019 #include <stdio.h>
00020 
00021 #include "UI_Lib.h"
00022 #include "UI_types.h"
00023 #include "IUI_Border.h"
00024 #include "IUI_Renderer.h"
00025 #include "IUI_Font.h"
00026 #include "CUI_CoordSys.h"
00027 
00028 
00030 #define UI_INACTIVE             0x0001
00031 
00032 #define UI_DISABLED             0x0002
00033 
00034 #define UI_HOVER                0x0004
00035 
00036 #define UI_CLICKED              0x0008
00037 
00038 #define UI_SELECTED             0x0010
00039 
00040 #define UI_VERTICAL             0x0020
00041 
00042 #define UI_SQUEEZE              0x0040
00043 
00044 #define UI_INVERT               0x0080
00045 
00047 class CUI_UI;
00048 
00050 
00058 class GLGUI_ENTRY CUI_Frame
00059 {
00060 public: 
00062         CUI_Frame( CUI_UI *ui = NULL, float x = 0, float y = 0, float x2 = 1, float y2 = 1,
00063                                 CUI_Frame *parent = NULL, IUI_Shader *shader = NULL,
00064                                 IUI_Shader *cursor = NULL, CUI_CoordSys *coordsys = NULL );
00065 
00067         virtual ~CUI_Frame();
00068 
00070         virtual bool SetUI( CUI_UI *ui )
00071         { m_ui = ui; return false; }
00072 
00074 
00078         virtual bool AddChild( CUI_Frame *frame, bool back = false );
00079 
00081 
00082         virtual bool DeleteChild( CUI_Frame *frame );
00083 
00085 
00086         virtual bool SetParent( CUI_Frame *frame );
00087 
00089         virtual CUI_Frame *GetParent( void );
00090 
00092         virtual bool SetCursor( IUI_Shader *cursor );
00093 
00095         virtual bool SetShader( IUI_Shader *shader );
00096 
00098         virtual bool SetCoordSys( CUI_CoordSys *coordsys );
00099 
00101         virtual CUI_CoordSys *GetCoordSys( void ) { return m_coordsys; }
00102 
00104         virtual bool SetBorder( IUI_Border *border ) { return false; }
00105 
00107         virtual IUI_Border *GetBorder( void ) { return NULL; }
00108 
00110         virtual bool SetFont( IUI_Font *font ) { return false; }
00111 
00113         virtual IUI_Font *GetFont( void ) { return NULL; }
00114 
00116 
00121         virtual bool Move( float x, float y, float x2, float y2 );
00122 
00124 
00127         virtual bool Move( float x, float y );
00128 
00130 
00131         virtual void GetRect( v4_f rect );
00132 
00134 
00137         virtual bool Convert( float &x, float &y );
00138 
00140 
00144         virtual bool ConvertFromGlobal( float &x, float &y );
00145 
00147         virtual bool Save( char *filename );
00149         virtual bool Save( FILE *file );
00150 
00152 
00154         virtual bool SetToRange( IUI_Renderer *renderer );
00155 
00157         virtual bool Render( double dtime, IUI_Renderer *renderer );
00158 
00160         virtual bool RenderStart( double dtime, IUI_Renderer *renderer );
00161 
00163         virtual bool RenderBackground( double dtime, IUI_Renderer *renderer );
00164 
00166         virtual bool RenderChildren( double dtime, IUI_Renderer *renderer );
00167 
00169 
00170         virtual bool Animate( double dtime, IUI_Renderer *renderer );
00171 
00173 
00174         virtual CUI_Frame* TestHit( float x, float y );
00175 
00177         virtual bool BringToFront( void );
00178 
00180         virtual IUI_Shader* GetShader( void );
00181 
00183         virtual IUI_Shader* GetCursor( void );
00184 
00186         virtual bool SetFrameID( unsigned long id )
00187         { m_frameID = id; return false; }
00188 
00190         virtual unsigned long GetFrameID( void )
00191         { return m_frameID; }
00192 
00194         virtual bool SetFlag( unsigned long flag, bool set );
00196         virtual bool GetFlag( unsigned long flag );
00197 
00199         virtual bool Activate( bool active = true );
00201         virtual bool Enable( bool enable = true );
00202 
00204         virtual bool AddClickableToList( void *voidlist );
00205 
00207         virtual bool IsClickable( ) { return false; }
00208 
00210 
00211         virtual bool Click( int &id, int &numparam, void **param ) { return false; }
00212 
00214         virtual bool IsDraggable( ) {return false; }
00215 
00217 
00218         virtual bool Drag( float x, float y, float dx, float dy, int &id, int &numparam, void **param ) { return false; }
00219 
00221 
00223         virtual void DeleteParam( void *param ) { assert( 1 ); };
00224         
00226 
00229         virtual bool ProcessKey( unsigned long key ) { return false; }
00230 
00232         typedef bool (*callbackfunc)(int id, int numparam, void *param);
00233 
00235 
00239         virtual bool SetFrameCallback( callbackfunc func )
00240         { m_callbackFunc = func; return false; }
00241 
00243 
00246         virtual bool CallbackFunc( int id, int numparam, void *param );
00247 
00249 
00255         virtual bool IsControl( )
00256         { return false; }
00257 
00259         virtual bool SetText( const char *text )
00260         { return false; }
00261 
00263         virtual bool SetToolTipText( char *text );
00264 
00266         virtual bool SetToolTipFrame( CUI_Frame *frame )
00267         { m_toolTipFrame = frame; return false; }
00268 
00270 
00274         virtual CUI_Frame *GetToolTipFrame( )
00275         { return m_toolTipFrame; }
00276 
00278         virtual char *GetToolTipText()
00279         { return m_toolTipText; }
00280         
00282 
00284         virtual bool ResetCounter( bool count )
00285         { m_counter = 0; m_count = count; return false; }
00286 
00288         virtual double GetCounter( )
00289         { return m_counter; }
00290 
00292         typedef enum animation_t {UI_NONE, UI_FADELINE, UI_FADESIN};
00293 
00295         virtual bool SetAnimation( animation_t anim )
00296         { m_animation = anim; return false; }
00297 
00299         virtual animation_t GetAnimation( )
00300         { return m_animation; }
00301 
00303 
00306         virtual void SetOwnedByUI( )
00307         { m_ownedByUI = true; }
00308 
00310         virtual bool IsOwnedByUI( )
00311         { return m_ownedByUI; }
00312 
00313 protected:
00314 
00316         CUI_UI *m_ui;
00317 
00319 
00323         unsigned long m_frameID;
00324 
00326 
00329         callbackfunc m_callbackFunc;
00330 
00332         IUI_Shader *m_cursor;
00334         IUI_Shader *m_shader;
00336         CUI_CoordSys *m_coordsys;
00337 
00339         CUI_Frame* m_parent;
00341         std::list<CUI_Frame *> m_frames;
00342 
00344         float m_x;
00346         float m_y;
00348         float m_x2;
00350         float m_y2;
00351 
00353         unsigned int m_flags;
00354 
00356         char *m_toolTipText;
00357 
00359         CUI_Frame *m_toolTipFrame;
00360 
00362         double m_counter;
00363 
00365         bool m_count;
00366 
00368         animation_t m_animation;
00369 
00371         float m_oldFade;
00372 
00374         bool m_ownedByUI;
00375 };
00376 
00377 GLGUI_ENTRY typedef std::list<CUI_Frame*> FRAMELIST;
00378 
00379 #endif

Generated on Mon Sep 29 23:07:02 2003 for glGUI by doxygen 1.3.4