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

CUI_TextField Class Reference

A text field. More...

#include <CUI_TextField.h>

Inheritance diagram for CUI_TextField:

CUI_Control CUI_Frame List of all members.

Public Member Functions

 CUI_TextField (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, unsigned int width=20, bool activeupdate=false)
 constructor

virtual ~CUI_TextField ()
 destructor

virtual bool SetUI (CUI_UI *ui)
 Set UI - add the textbox and scrollbars to the ui.

virtual bool ProcessKey (unsigned long key)
 Process a incoming key.

virtual bool CallbackFunc (int id, int numparam, void *param)
 Wrapper to m_callbackFunc to check for NULL and present a simple interface.

virtual bool SetWidth (unsigned int width)
 Set the text width.

virtual bool SetActiveUpdate (bool activeupdate)
 Set the activeupdate option.

virtual char * GetText (void)
 get the text from the box

virtual bool SetText (const char *text)
 set the text for the box to display

virtual bool SetStart (int startColumn=0, int startRow=0)
 set the starting column and row

virtual bool SetFont (IUI_Font *font)
 set the font for the textbox

virtual bool MoveCursor (int pos)
 Set cursor position.

virtual unsigned long GetCursorPosition ()
 Get cursor positoin.


Protected Attributes

CUI_EditableTextBoxm_textBox
 pointer to the editable textbox

unsigned int m_width
 number of characters to allow in the field

bool m_activeUpdate
 update whenever the text changes?


Detailed Description

A text field.

Uses a row-limited editable text box to accept text. On hitting enter (or optionally whenever the text changes), sends a message to the callback function with the text as a parameter.

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE


Member Function Documentation

virtual bool CUI_TextField::CallbackFunc int  id,
int  numparam,
void *  param
[inline, virtual]
 

Wrapper to m_callbackFunc to check for NULL and present a simple interface.

Returns:
false if the global callback needs to be called as well

Reimplemented from CUI_Frame.

virtual char* CUI_TextField::GetText void   )  [inline, virtual]
 

get the text from the box

Returned memory belongs to the CUI_ScrollableTextBox

bool CUI_TextField::ProcessKey unsigned long  key  )  [virtual]
 

Process a incoming key.

Everything except 'enter' gets passed to the textbox

Reimplemented from CUI_Frame.


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