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

CUI_TextBox Class Reference

A simple widget filled with text. More...

#include <CUI_TextBox.h>

Inheritance diagram for CUI_TextBox:

CUI_Widget CUI_Frame CUI_EditableTextBox List of all members.

Public Member Functions

 CUI_TextBox (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)
 constructor

virtual ~CUI_TextBox ()
 destructor

virtual bool SetSize (int columns=30, int rows=40)
 Set the number of columns and rows.

virtual bool GetSize (int &columns, int &rows)
 Get the number of columns and rows.

virtual bool SetStart (int startColumn=0, int startRow=0)
 Set the row and column that appears in the top left of the box.

virtual bool GetStart (int &startColumn, int &startRow)
 Get the row and column that appears in the top left of the box.

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

virtual bool CatText (const char *text)
 concatenate some text to m_text

virtual bool GetTextSize (int &columns, int &rows)
 get the size of the text itself

virtual bool Count (int &columns, int &rows)
 count and return the size of the text itself

virtual bool SetWordWrap (bool wordwrap)
 Enable/disable word wrap.


Protected Attributes

unsigned int m_columns
 how many columns this TextBox can display

unsigned int m_rows
 how many rows this TextBox can display

unsigned int m_startColumn
 which column is on the left side of the TextBox

unsigned int m_startRow
 which row is at the top of the TextBox

unsigned int m_textColumns
 Total columns used by the text.

unsigned int m_textRows
 Total rows used by the text.

bool m_wordWrap
 word wrap


Detailed Description

A simple widget filled with text.

Extra text functionality over CUI_Widget

Does word-wrap and fixed row & column text rendering

Overall a much more efficient way to render large chunks of text than CUI_Widget

Be aware of the difference between the TextBox size and the size the text itself takes up within the TextBox.

Recognized flags:
[system]
UI_CLICKED
UI_HOVER
UI_SELECTED

UI_DISABLED
UI_INACTIVE
UI_INVERT


Member Function Documentation

bool CUI_TextBox::Count int &  columns,
int &  rows
[virtual]
 

count and return the size of the text itself

This should only be called when GetTextSize could not be. Requires a lot more processing than GetTextSize.

bool CUI_TextBox::GetTextSize int &  columns,
int &  rows
[virtual]
 

get the size of the text itself

Can only be called after it has rendered the text at least once


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