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

CUI_EditableTextBox Class Reference

An editable text box. More...

#include <CUI_EditableTextBox.h>

Inheritance diagram for CUI_EditableTextBox:

CUI_TextBox CUI_Widget CUI_Frame List of all members.

Public Member Functions

 CUI_EditableTextBox (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, int columns=30, int rows=40, int startcolumn=0, int startrow=0, bool wordWrap=true, unsigned int cursorPosition=0, unsigned short cursorType=UI_CURSOR_NONE)
 constructor

virtual ~CUI_EditableTextBox ()
 destructor

bool SetText (const char *text)
 overloaded settext

bool MoveCursor (int cursorPosition)
 Move the cursor & update start.

int GetCursorPosition ()
 Get cursor position.

bool SetCursorType (unsigned short cursorType)
 Set the cursor type.

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

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

virtual bool SetMaxRows (unsigned long maxrows)
 set the maximum number of rows to allow

virtual bool IsClickable (void)
 click to move the cursor

virtual bool Click (int &id, int &numparam, void **param)
 Call the click action function.

virtual bool IsDraggable (void)
 grab drag input for cursor movement (selection)

virtual bool Drag (float x, float y, float dx, float dy, int &id, int &numparam, void **param)
 Update the cursor's position as this is being dragged (in global space).

virtual void DeleteParam (void *param)
 Delete a parameter allocated by this frame.


Protected Attributes

unsigned long m_cursorPosition
 position of the cursor

unsigned short m_cursorType
 type of cursor

unsigned long m_maxRows
 maximum number of rows to allow during input


Detailed Description

An editable text box.

Adds character/key processing and cursor movement

TODO: up/down arrow functionality

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE
UI_INVERT


Member Function Documentation

bool CUI_EditableTextBox::Click int &  id,
int &  numparam,
void **  param
[virtual]
 

Call the click action function.

The UI will only call this function when the button is let up while over the same button it was clicked on.
Knowing the type of the parameters is up to the callback function which should be written specifically for the buttons it was designed to handle.

Parameters:
id modified frameID
numparam [modified] number of parameters in the list
param [modified] pointer to a list of parameters

Reimplemented from CUI_Frame.

virtual void CUI_EditableTextBox::DeleteParam void *  param  )  [inline, virtual]
 

Delete a parameter allocated by this frame.

EditableTextBoxes return no param

Reimplemented from CUI_Frame.


Member Data Documentation

unsigned short CUI_EditableTextBox::m_cursorType [protected]
 

type of cursor

See also:
UI_CURSOR_NONE

UI_CURSOR_BAR

UI_CURSOR_UNDERLINE


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