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

CUI_Widget Class Reference

the basic element of the UI controls More...

#include <CUI_Widget.h>

Inheritance diagram for CUI_Widget:

CUI_Frame CUI_Button CUI_ProgressBar CUI_TextBox CUI_MultipleStateButton CUI_ResizeButton CUI_SliderBar CUI_EditableTextBox List of all members.

Public Member Functions

 CUI_Widget (CUI_UI *ui=NULL, float x=0, float y=0, float x2=1, float y2=1, CUI_Frame *parent=NULL, IUI_Shader *shader=NULL, IUI_Shader *cursor=NULL, CUI_CoordSys *coordsys=NULL, char *text=NULL, IUI_Font *font=NULL, float textscale=0.8, IUI_Border *border=NULL)
 constructor

virtual ~CUI_Widget ()
 destructor

virtual bool Render (double dtime, IUI_Renderer *renderer)
 overloaded render

virtual CUI_FrameTestHit (float x, float y)
 overloaded testhit

virtual bool SetBorder (IUI_Border *border)
 set the border for this widget

virtual IUI_BorderGetBorder ()
 get the border for this widget

virtual bool SetText (const char *text)
 set the text label for this widget

virtual char * GetText ()
 get the text label for this widget - returned memory is owned by the CUI_Widget object

virtual bool SetFont (IUI_Font *font)
 set the font for this widget

virtual IUI_FontGetFont ()
 get the font

virtual bool SetTextScale (float scale)
 set the scale value for the text


Protected Member Functions

virtual bool ExpandBuffer (unsigned long amount)
 increase the size of the text buffer


Protected Attributes

IUI_Borderm_border
 widgets can have a non-rectagular border

char * m_text
 text label for this widget

unsigned long m_textLength
 total length of text

unsigned long m_bufferLength
 current size of buffer

IUI_Fontm_font
 font for the text

float m_textscale
 how much to scale the text


Detailed Description

the basic element of the UI controls

The base widget is a static component, it does not have any interaction with the cursor.

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE


Member Function Documentation

bool CUI_Widget::ExpandBuffer unsigned long  amount  )  [protected, virtual]
 

increase the size of the text buffer

Parameters:
amount minimum amount to expand the buffer by

bool CUI_Widget::SetTextScale float  scale  )  [virtual]
 

set the scale value for the text

Set the amount that the text is scaled by in relation to the widget. Default is 1.0.

Parameters:
scale scale value in the range [0,1]


Member Data Documentation

unsigned long CUI_Widget::m_textLength [protected]
 

total length of text

should be udpated any time the text changes


The documentation for this class was generated from the following files:
Generated on Mon Sep 29 23:07:04 2003 for glGUI by doxygen 1.3.4