Initial commit
This commit is contained in:
67
Torque/SDK/engine/gui/controls/guiTextCtrl.h
Normal file
67
Torque/SDK/engine/gui/controls/guiTextCtrl.h
Normal file
@@ -0,0 +1,67 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Torque Game Engine
|
||||
// Copyright (C) GarageGames.com, Inc.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef _GUITEXTCTRL_H_
|
||||
#define _GUITEXTCTRL_H_
|
||||
|
||||
#ifndef _GFONT_H_
|
||||
#include "dgl/gNewFont.h"
|
||||
#endif
|
||||
#ifndef _GUITYPES_H_
|
||||
#include "gui/core/guiTypes.h"
|
||||
#endif
|
||||
#ifndef _GUICONTROL_H_
|
||||
#include "gui/core/guiControl.h"
|
||||
#endif
|
||||
#ifndef _GUIMOUSEEVENTCTRL_H_
|
||||
#include "gui/guiMouseEventCtrl.h"
|
||||
#endif
|
||||
|
||||
class GuiTextCtrl : public GuiMouseEventCtrl
|
||||
{
|
||||
private:
|
||||
typedef GuiControl Parent;
|
||||
|
||||
public:
|
||||
enum Constants { MAX_STRING_LENGTH = 255 };
|
||||
|
||||
|
||||
protected:
|
||||
StringTableEntry mInitialText;
|
||||
StringTableEntry mInitialTextID;
|
||||
UTF8 mText[MAX_STRING_LENGTH + 1];
|
||||
S32 mMaxStrLen; // max string len, must be less then or equal to 255
|
||||
Resource<GFont> mFont;
|
||||
|
||||
public:
|
||||
|
||||
//creation methods
|
||||
DECLARE_CONOBJECT(GuiTextCtrl);
|
||||
GuiTextCtrl();
|
||||
static void initPersistFields();
|
||||
|
||||
//Parental methods
|
||||
bool onAdd();
|
||||
virtual bool onWake();
|
||||
virtual void onSleep();
|
||||
|
||||
//text methods
|
||||
virtual void setText(const char *txt = NULL);
|
||||
virtual void setTextID(S32 id);
|
||||
virtual void setTextID(const char *id);
|
||||
const char *getText() { return (const char*)mText; }
|
||||
|
||||
void inspectPostApply();
|
||||
//rendering methods
|
||||
void onPreRender();
|
||||
void onRender(Point2I offset, const RectI &updateRect);
|
||||
void displayText( S32 xOffset, S32 yOffset );
|
||||
|
||||
//Console methods
|
||||
const char *getScriptValue();
|
||||
void setScriptValue(const char *value);
|
||||
};
|
||||
|
||||
#endif //_GUI_TEXT_CONTROL_H_
|
||||
Reference in New Issue
Block a user