00001
00015 #ifndef CUI_WIDGET_H
00016 #define CUI_WIDGET_H
00017
00018 #include <list>
00019
00020 #include "CUI_Frame.h"
00021
00023
00035 class GLGUI_ENTRY CUI_Widget : public CUI_Frame
00036 {
00037 public:
00039 CUI_Widget( CUI_UI *ui = NULL, float x = 0, float y = 0, float x2 = 1, float y2 = 1,
00040 CUI_Frame *parent = NULL, IUI_Shader *shader = NULL,
00041 IUI_Shader *cursor = NULL, CUI_CoordSys *coordsys = NULL,
00042
00043 char *text = NULL, IUI_Font *font = NULL, float textscale = 0.8,
00044 IUI_Border *border = NULL
00045 );
00046
00048 virtual ~CUI_Widget();
00049
00051 virtual bool Render( double dtime, IUI_Renderer *renderer );
00053 virtual CUI_Frame* TestHit( float x, float y );
00054
00056 virtual bool SetBorder( IUI_Border *border );
00057
00059 virtual IUI_Border *GetBorder( )
00060 { return m_border; }
00061
00063 virtual bool SetText( const char *text );
00064
00066 virtual char *GetText( );
00067
00069 virtual bool SetFont( IUI_Font *font );
00070
00072 virtual IUI_Font *GetFont( )
00073 { return m_font; }
00074
00076
00080 virtual bool SetTextScale( float scale );
00081
00082 protected:
00083
00085
00086 virtual bool ExpandBuffer( unsigned long amount );
00087
00089 IUI_Border *m_border;
00090
00092 char *m_text;
00093
00095
00096 unsigned long m_textLength;
00097
00099 unsigned long m_bufferLength;
00100
00102 IUI_Font *m_font;
00103
00105 float m_textscale;
00106
00107 };
00108
00109 #endif