GuiTextEditCtrl Class Reference

#include <guiTextEditCtrl.h>

Inheritance diagram for GuiTextEditCtrl:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GuiTextEditCtrl ()
 ~GuiTextEditCtrl ()
 DECLARE_CONOBJECT (GuiTextEditCtrl)
bool onAdd ()
 Called when this object is added to the scene.
bool onWake ()
 Called when this object is asked to wake up returns true if it's actually awake at the end.
void onSleep ()
 Called when this object is asked to sleep.
void getText (char *dest)
 Get the contents of the control.
void setText (S32 tag)
virtual void setText (const UTF8 *txt)
virtual void setText (const UTF16 *txt)
S32 getCursorPos ()
void reallySetCursorPos (const S32 newPos)
void selectAllText ()
void forceValidateText ()
const char * getScriptValue ()
 Returns the value of the variable bound to this object.
void setScriptValue (const char *value)
 Sets the value of the variable bound to this object.
bool onKeyDown (const GuiEvent &event)
 Happens when a key is depressed.
void onMouseDown (const GuiEvent &event)
void onMouseDragged (const GuiEvent &event)
void onMouseUp (const GuiEvent &event)
void onCopy (bool andCut)
void onPaste ()
void onUndo ()
virtual void setFirstResponder ()
 Sets this object to be a first responder.
virtual void onLoseFirstResponder ()
 Occurs when the first responder for this chain is lost.
void parentResized (const RectI &oldParentRect, const RectI &newParentRect)
 Called when this objects parent is resized.
bool hasText ()
void onStaticModified (const char *slotName, const char *newValue=NULL)
 Called when a static field is modified.
void onPreRender ()
 Do special pre-render processing.
void onRender (Point2I offset, const RectI &updateRect)
 Called when this control is to render itself.
virtual void drawText (const RectI &drawRect, bool isFocused)

Static Public Member Functions

static void initPersistFields ()
 Register dynamic fields in a subclass of ConsoleObject.

Protected Member Functions

void saveUndoState ()
S32 setCursorPos (const Point2I &offset)
void updateHistory (StringBuffer *txt, bool moveIndex)
void playDeniedSound ()
void execConsoleCallback ()
 Executes mConsoleCommand, and returns the result.

Protected Attributes

StringBuffer mTextBuffer
StringTableEntry mValidateCommand
StringTableEntry mEscapeCommand
SFXProfilemDeniedSound
S32 mNumFramesElapsed
U32 mTimeLastCursorFlipped
ColorI mCursorColor
bool mCursorOn
bool mInsertOn
S32 mMouseDragStart
Point2I mTextOffset
bool mTextOffsetReset
bool mDragHit
bool mTabComplete
S32 mScrollDir
StringBuffer mUndoText
S32 mUndoBlockStart
S32 mUndoBlockEnd
S32 mUndoCursorPos
S32 mBlockStart
S32 mBlockEnd
S32 mCursorPos
bool mHistoryDirty
S32 mHistoryLast
S32 mHistoryIndex
S32 mHistorySize
bool mPasswordText
StringTableEntry mPasswordMask
bool mSinkAllKeyEvents
 If set, any non-ESC key is handled here or not at all.
UTF16 ** mHistoryBuf

Private Types

typedef GuiTextCtrl Parent

Static Private Attributes

static U32 smNumAwake

Member Typedef Documentation

Reimplemented from GuiTextCtrl.

Reimplemented in GuiConsoleEditCtrl, and GuiTextEditSliderCtrl.


Constructor & Destructor Documentation

GuiTextEditCtrl::GuiTextEditCtrl (  ) 

GuiTextEditCtrl::~GuiTextEditCtrl (  ) 


Member Function Documentation

void GuiTextEditCtrl::saveUndoState (  )  [protected]

S32 GuiTextEditCtrl::setCursorPos ( const Point2I offset  )  [protected]

void GuiTextEditCtrl::updateHistory ( StringBuffer txt,
bool  moveIndex 
) [protected]

void GuiTextEditCtrl::playDeniedSound (  )  [protected]

void GuiTextEditCtrl::execConsoleCallback (  )  [protected]

Executes mConsoleCommand, and returns the result.

Reimplemented from GuiControl.

GuiTextEditCtrl::DECLARE_CONOBJECT ( GuiTextEditCtrl   ) 

static void GuiTextEditCtrl::initPersistFields (  )  [static]

Register dynamic fields in a subclass of ConsoleObject.

See also:
addField(), addFieldV(), addDeprecatedField(), addGroup(), endGroup()

Reimplemented from GuiTextCtrl.

Reimplemented in GuiConsoleEditCtrl, and GuiTextEditSliderCtrl.

bool GuiTextEditCtrl::onAdd (  )  [virtual]

Called when this object is added to the scene.

Reimplemented from GuiTextCtrl.

bool GuiTextEditCtrl::onWake (  )  [virtual]

Called when this object is asked to wake up returns true if it's actually awake at the end.

Reimplemented from GuiTextCtrl.

void GuiTextEditCtrl::onSleep (  )  [virtual]

Called when this object is asked to sleep.

Reimplemented from GuiTextCtrl.

void GuiTextEditCtrl::getText ( char *  dest  ) 

Get the contents of the control.

dest should be of size GuiTextCtrl::MAX_STRING_LENGTH+1.

Reimplemented in GuiTextEditSliderCtrl.

void GuiTextEditCtrl::setText ( S32  tag  ) 

Reimplemented in GuiTextEditSliderCtrl.

virtual void GuiTextEditCtrl::setText ( const UTF8 txt  )  [virtual]

Reimplemented from GuiTextCtrl.

Reimplemented in GuiTextEditSliderCtrl.

virtual void GuiTextEditCtrl::setText ( const UTF16 txt  )  [virtual]

S32 GuiTextEditCtrl::getCursorPos (  )  [inline]

void GuiTextEditCtrl::reallySetCursorPos ( const S32  newPos  ) 

void GuiTextEditCtrl::selectAllText (  ) 

void GuiTextEditCtrl::forceValidateText (  ) 

const char* GuiTextEditCtrl::getScriptValue (  )  [virtual]

Returns the value of the variable bound to this object.

Reimplemented from GuiTextCtrl.

void GuiTextEditCtrl::setScriptValue ( const char *  value  )  [virtual]

Sets the value of the variable bound to this object.

Reimplemented from GuiTextCtrl.

bool GuiTextEditCtrl::onKeyDown ( const GuiEvent event  )  [virtual]

Happens when a key is depressed.

Parameters:
event Event descriptor (which contains the key)

Reimplemented from GuiControl.

Reimplemented in GuiConsoleEditCtrl, and GuiTextEditSliderCtrl.

void GuiTextEditCtrl::onMouseDown ( const GuiEvent event  )  [virtual]

Reimplemented from GuiControl.

Reimplemented in GuiTextEditSliderCtrl.

void GuiTextEditCtrl::onMouseDragged ( const GuiEvent event  )  [virtual]

Reimplemented from GuiControl.

Reimplemented in GuiTextEditSliderCtrl.

void GuiTextEditCtrl::onMouseUp ( const GuiEvent event  )  [virtual]

Reimplemented from GuiControl.

Reimplemented in GuiTextEditSliderCtrl.

void GuiTextEditCtrl::onCopy ( bool  andCut  ) 

void GuiTextEditCtrl::onPaste (  ) 

void GuiTextEditCtrl::onUndo (  ) 

virtual void GuiTextEditCtrl::setFirstResponder (  )  [virtual]

Sets this object to be a first responder.

Reimplemented from GuiControl.

virtual void GuiTextEditCtrl::onLoseFirstResponder (  )  [virtual]

Occurs when the first responder for this chain is lost.

Reimplemented from GuiControl.

void GuiTextEditCtrl::parentResized ( const RectI oldParentRect,
const RectI newParentRect 
) [virtual]

Called when this objects parent is resized.

Parameters:
oldParentRect The old rectangle of the parent object
newParentRect The new rectangle of the parent object

Reimplemented from GuiContainer.

bool GuiTextEditCtrl::hasText (  ) 

void GuiTextEditCtrl::onStaticModified ( const char *  slotName,
const char *  newValue = NULL 
) [virtual]

Called when a static field is modified.

Reimplemented from SimObject.

void GuiTextEditCtrl::onPreRender (  )  [virtual]

Do special pre-render processing.

Reimplemented from GuiTextCtrl.

Reimplemented in GuiTextEditSliderCtrl.

void GuiTextEditCtrl::onRender ( Point2I  offset,
const RectI updateRect 
) [virtual]

Called when this control is to render itself.

Parameters:
offset The location this control is to begin rendering
updateRect The screen area this control has drawing access to

Reimplemented from GuiTextCtrl.

Reimplemented in GuiTextEditSliderCtrl.

virtual void GuiTextEditCtrl::drawText ( const RectI drawRect,
bool  isFocused 
) [virtual]


Member Data Documentation

U32 GuiTextEditCtrl::smNumAwake [static, private]

If set, any non-ESC key is handled here or not at all.