Browse Source

GuiTextCtrl removed

Successfully removed GuiTextCtrl as its behavior is now part of the base GuiControl.
Peter Robinson 4 years ago
parent
commit
84bfa2769e

+ 0 - 2
engine/compilers/VisualStudio 2017/Torque 2D.vcxproj

@@ -419,7 +419,6 @@
     <ClCompile Include="..\..\source\gui\guiPopUpCtrlEx.cc" />
     <ClCompile Include="..\..\source\gui\guiProgressCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiSliderCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditSliderCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextListCtrl.cc" />
@@ -961,7 +960,6 @@
     <ClInclude Include="..\..\source\gui\guiPopUpCtrlEx.h" />
     <ClInclude Include="..\..\source\gui\guiProgressCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiSliderCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditSliderCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextListCtrl.h" />

+ 0 - 6
engine/compilers/VisualStudio 2017/Torque 2D.vcxproj.filters

@@ -1372,9 +1372,6 @@
     <ClCompile Include="..\..\source\gui\containers\guiTabPageCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\Box2D\Particle\b2Particle.cpp">
       <Filter>Box2D\Particle</Filter>
     </ClCompile>
@@ -3178,9 +3175,6 @@
     <ClInclude Include="..\..\source\gui\containers\guiTabPageCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\Box2D\Particle\b2VoronoiDiagram.h">
       <Filter>Box2D\Particle</Filter>
     </ClInclude>

+ 0 - 2
engine/compilers/VisualStudio 2019/Torque 2D.vcxproj

@@ -419,7 +419,6 @@
     <ClCompile Include="..\..\source\gui\guiPopUpCtrlEx.cc" />
     <ClCompile Include="..\..\source\gui\guiProgressCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiSliderCtrl.cc" />
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextEditSliderCtrl.cc" />
     <ClCompile Include="..\..\source\gui\guiTextListCtrl.cc" />
@@ -961,7 +960,6 @@
     <ClInclude Include="..\..\source\gui\guiPopUpCtrlEx.h" />
     <ClInclude Include="..\..\source\gui\guiProgressCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiSliderCtrl.h" />
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextEditSliderCtrl.h" />
     <ClInclude Include="..\..\source\gui\guiTextListCtrl.h" />

+ 0 - 6
engine/compilers/VisualStudio 2019/Torque 2D.vcxproj.filters

@@ -1372,9 +1372,6 @@
     <ClCompile Include="..\..\source\gui\containers\guiTabPageCtrl.cc">
       <Filter>gui\containers</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\source\gui\guiTextCtrl.cc">
-      <Filter>gui</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\source\Box2D\Particle\b2Particle.cpp">
       <Filter>Box2D\Particle</Filter>
     </ClCompile>
@@ -3178,9 +3175,6 @@
     <ClInclude Include="..\..\source\gui\containers\guiTabPageCtrl.h">
       <Filter>gui\containers</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\source\gui\guiTextCtrl.h">
-      <Filter>gui</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\source\Box2D\Particle\b2VoronoiDiagram.h">
       <Filter>Box2D\Particle</Filter>
     </ClInclude>

+ 1 - 1
engine/source/gui/containers/guiWindowCtrl.cc

@@ -644,7 +644,7 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
    if( textWidth > winRect.extent.x ) start.set( 0, 0 );
    // center the vertical
 //   start.y = ( winRect.extent.y - ( font->getHeight() - 2 ) ) / 2;
-   dglDrawText(mFont, start + offset + mProfile->mTextOffset, mText);
+   dglDrawText(mProfile->mFont, start + offset + mProfile->mTextOffset, mText);
 
    // deal with rendering the titlebar controls
    AssertFatal(root, "Unable to get the root Canvas.");

+ 2 - 2
engine/source/gui/containers/guiWindowCtrl.h

@@ -31,10 +31,10 @@
 ///
 /// @ingroup gui_group Gui System
 /// @{
-class GuiWindowCtrl : public GuiTextCtrl
+class GuiWindowCtrl : public GuiControl
 {
    private:
-      typedef GuiTextCtrl Parent;
+      typedef GuiControl Parent;
 
       bool mResizeWidth;
       bool mResizeHeight;

+ 2 - 2
engine/source/gui/guiBubbleTextCtrl.h

@@ -30,10 +30,10 @@
 #include "gui/guiMLTextCtrl.h"
 #endif
 
-class GuiBubbleTextCtrl : public GuiTextCtrl
+class GuiBubbleTextCtrl : public GuiControl
 {
   private:
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
   protected:
      bool mInAction;

+ 10 - 10
engine/source/gui/guiPopUpCtrl.cc

@@ -951,9 +951,9 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
       }
       //      renderSlightlyRaisedBox(r, mProfile); // DAW: Used to be the only 'else' condition to mInAction above.
 
-      S32 txt_w = mFont->getStrWidth(mText);
+      S32 txt_w = mProfile->mFont->getStrWidth(mText);
       localStart.x = 0;
-      localStart.y = (mBounds.extent.y - (mFont->getHeight())) / 2;
+      localStart.y = (mBounds.extent.y - (mProfile->mFont->getHeight())) / 2;
 
         // DAW: Indices into the bitmap array
         const S32 NumBitmaps = 3;
@@ -1069,28 +1069,28 @@ void GuiPopUpMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
 
          // Draw the first column
          getColumn(mText, buff, 0, "\t");
-         dglDrawText(mFont, globalStart, buff, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, globalStart, buff, mProfile->mFontColors);
 
          // Draw the second column to the right
          getColumn(mText, buff, 1, "\t");
-         S32 txt_w = mFont->getStrWidth(buff);
+         S32 txt_w = mProfile->mFont->getStrWidth(buff);
          if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
          {
             // We're making use of a bitmap border, so take into account the
             // right cap of the border.
             RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
             Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - mBitmapBounds[2].extent.x,localStart.y));
-            dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+            dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
 
          } else
          {
             Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - 12,localStart.y));
-            dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+            dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
          }
 
       } else
       {
-         dglDrawText(mFont, globalStart, mText, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, globalStart, mText, mProfile->mFontColors);
       }
 
       // Restore the clip rectangle.
@@ -1224,8 +1224,8 @@ void GuiPopUpMenuCtrl::onAction()
    bool setScroll = false;
 
    for( U32 i=0; i < (U32)mEntries.size(); ++i )
-      if(S32(mFont->getStrWidth(mEntries[i].buf)) > textWidth)
-         textWidth = mFont->getStrWidth(mEntries[i].buf);
+      if(S32(mProfile->mFont->getStrWidth(mEntries[i].buf)) > textWidth)
+         textWidth = mProfile->mFont->getStrWidth(mEntries[i].buf);
 
    //if(textWidth > mBounds.extent.x)
    S32 sbWidth = 0;//mSc->mProfile->mBorderSize * 2 + mSc->scrollBarThickness(); // DAW: Calculate the scroll bar width
@@ -1242,7 +1242,7 @@ void GuiPopUpMenuCtrl::onAction()
    }
 
    //mTl->setCellSize(Point2I(width, mFont->getHeight()+3));
-   mTl->setCellSize(Point2I(width, mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
+   mTl->setCellSize(Point2I(width, mProfile->mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
 
    for( U32 j = 0; j < (U32)mEntries.size(); ++j )
       mTl->addEntry(mEntries[j].id, mEntries[j].buf);

+ 2 - 2
engine/source/gui/guiPopUpCtrl.h

@@ -70,9 +70,9 @@ public:
    void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
 };
 
-class GuiPopUpMenuCtrl : public GuiTextCtrl
+class GuiPopUpMenuCtrl : public GuiControl
 {
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
 public:
    struct Entry

+ 10 - 10
engine/source/gui/guiPopUpCtrlEx.cc

@@ -960,9 +960,9 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
    }
 //      renderSlightlyRaisedBox(r, mProfile); // DAW: Used to be the only 'else' condition to mInAction above.
 
-   S32 txt_w = mFont->getStrWidth(mText);
+   S32 txt_w = mProfile->mFont->getStrWidth(mText);
    localStart.x = 0;
-   localStart.y = (mBounds.extent.y - (mFont->getHeight())) / 2;
+   localStart.y = (mBounds.extent.y - (mProfile->mFont->getHeight())) / 2;
 
    // align the horizontal
    switch (mProfile->mAlignment)
@@ -1046,28 +1046,28 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
 
       // Draw the first column
       getColumn(mText, buff, 0, "\t");
-      dglDrawText(mFont, globalStart, buff, mProfile->mFontColors);
+      dglDrawText(mProfile->mFont, globalStart, buff, mProfile->mFontColors);
 
 	  // Draw the second column to the right
       getColumn(mText, buff, 1, "\t");
-      S32 txt_w = mFont->getStrWidth(buff);
+      S32 txt_w = mProfile->mFont->getStrWidth(buff);
       if(mProfile->mProfileForChildren && mProfile->mBitmapArrayRects.size())
       {
          // We're making use of a bitmap border, so take into account the
          // right cap of the border.
          RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address();
          Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - mBitmapBounds[2].extent.x,localStart.y));
-         dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
 
       } else
       {
          Point2I textpos = localToGlobalCoord(Point2I(mBounds.extent.x - txt_w - 12,localStart.y));
-         dglDrawText(mFont, textpos, buff, mProfile->mFontColors);
+         dglDrawText(mProfile->mFont, textpos, buff, mProfile->mFontColors);
 	  }
 
    } else
    {
-      dglDrawText(mFont, globalStart, mText, mProfile->mFontColors);
+      dglDrawText(mProfile->mFont, globalStart, mText, mProfile->mFontColors);
    }
 
    // If we're rendering a bitmap border, then it will take care of the arrow.
@@ -1207,8 +1207,8 @@ void GuiPopUpMenuCtrlEx::onAction()
    bool setScroll = false;
       
    for( U32 i = 0; i < (U32)mEntries.size(); ++i )
-      if(S32(mFont->getStrWidth(mEntries[i].buf)) > textWidth)
-         textWidth = mFont->getStrWidth(mEntries[i].buf);
+      if(S32(mProfile->mFont->getStrWidth(mEntries[i].buf)) > textWidth)
+         textWidth = mProfile->mFont->getStrWidth(mEntries[i].buf);
 
    //if(textWidth > mBounds.extent.x)
    S32 sbWidth = 0;//TODO: mSc->mProfile->mBorderSize * 2 + mSc->scrollBarThickness(); // DAW: Calculate the scroll bar width
@@ -1225,7 +1225,7 @@ void GuiPopUpMenuCtrlEx::onAction()
    }
 
    //mTl->setCellSize(Point2I(width, mFont->getHeight()+3));
-   mTl->setCellSize(Point2I(width, mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
+   mTl->setCellSize(Point2I(width, mProfile->mFont->getHeight() + textSpace)); // DAW: Modified the above line to use textSpace rather than the '3' as this is what is used below.
 
    for( U32 j=0; j < (U32)mEntries.size(); ++j )
       mTl->addEntry(mEntries[j].id, mEntries[j].buf);

+ 2 - 2
engine/source/gui/guiPopUpCtrlEx.h

@@ -90,9 +90,9 @@ class GuiPopupTextListCtrlEx : public GuiTextListCtrl
       void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
 };
 
-class GuiPopUpMenuCtrlEx : public GuiTextCtrl
+class GuiPopUpMenuCtrlEx : public GuiControl
 {
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
   public:
    struct Entry

+ 2 - 2
engine/source/gui/guiProgressCtrl.h

@@ -32,10 +32,10 @@
 #endif
 
 
-class GuiProgressCtrl : public GuiTextCtrl
+class GuiProgressCtrl : public GuiControl
 {
 private:
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
    F32 mProgress;
 

+ 0 - 16
engine/source/gui/guiTextCtrl.cc

@@ -157,22 +157,6 @@ void GuiTextCtrl::setText(const char *txt)
 		mProfile->decRefCount();
 		return;
 	}
-
-	//resize
-	//DEPRECIATED
-   /*
-   if (mProfile->mAutoSizeWidth)
-   {
-      if (mProfile->mAutoSizeHeight)
-         resize(mBounds.point, Point2I(mFont->getStrWidth((const UTF8 *)mText), mFont->getHeight() + 4));
-      else
-         resize(mBounds.point, Point2I(mFont->getStrWidth((const UTF8 *)mText), mBounds.extent.y));
-   }
-   else if (mProfile->mAutoSizeHeight)
-   {
-      resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
-   }
-   */
       
    setVariable((char*)mText);
    setUpdate();

+ 134 - 10
engine/source/gui/guiTextEditCtrl.cc

@@ -22,6 +22,7 @@
 
 #include "console/consoleTypes.h"
 #include "console/console.h"
+#include "graphics/gColor.h"
 #include "graphics/dgl.h"
 #include "gui/guiCanvas.h"
 #include "gui/guiMLTextCtrl.h"
@@ -69,6 +70,8 @@ GuiTextEditCtrl::GuiTextEditCtrl()
    mPasswordMask = StringTable->insert( "*" );
 
    mEditCursor = NULL;
+   mMaxStrLen = GuiTextEditCtrl::MAX_STRING_LENGTH;
+   mTruncateWhenUnfocused = false;
 }
 
 GuiTextEditCtrl::~GuiTextEditCtrl()
@@ -95,6 +98,8 @@ void GuiTextEditCtrl::initPersistFields()
    addField("sinkAllKeyEvents",  TypeBool,      Offset(mSinkAllKeyEvents,  GuiTextEditCtrl));
    addField("password",          TypeBool,      Offset(mPasswordText,      GuiTextEditCtrl));
    addField("passwordMask",      TypeString,    Offset(mPasswordMask,      GuiTextEditCtrl));
+   addField("maxLength",		TypeS32, Offset(mMaxStrLen, GuiTextEditCtrl));
+   addField("truncate",			TypeBool, Offset(mTruncateWhenUnfocused, GuiTextEditCtrl));
 }
 
 bool GuiTextEditCtrl::onAdd()
@@ -127,11 +132,41 @@ void GuiTextEditCtrl::onStaticModified(const char* slotName)
       setText(mText);
 }
 
+void GuiTextEditCtrl::inspectPostApply()
+{
+	Parent::inspectPostApply();
+	if (mTextID && *mTextID != 0)
+		setTextID(mTextID);
+	else
+		setText(mText);
+}
+
 bool GuiTextEditCtrl::onWake()
 {
    if (! Parent::onWake())
       return false;
 
+   mFont = mProfile->mFont;
+   AssertFatal(mFont, "GuiTextCtrl::onWake: invalid font in profile");
+
+   if (mConsoleVariable[0])
+   {
+	   const char *txt = Con::getVariable(mConsoleVariable);
+	   if (txt)
+	   {
+		   if (dStrlen(txt) > (U32)mMaxStrLen)
+		   {
+			   char* buf = new char[mMaxStrLen + 1];
+			   dStrncpy(buf, txt, mMaxStrLen);
+			   buf[mMaxStrLen] = 0;
+			   setScriptValue(buf);
+			   delete[] buf;
+		   }
+		   else
+			   setScriptValue(txt);
+	   }
+   }
+
    // If this is the first awake text edit control, enable keyboard translation
    if (smNumAwake == 0)
       Platform::enableKeyboardTranslation();
@@ -143,6 +178,7 @@ bool GuiTextEditCtrl::onWake()
 void GuiTextEditCtrl::onSleep()
 {
    Parent::onSleep();
+   mFont = NULL;
 
    // If this is the last awake text edit control, disable keyboard translation
    --smNumAwake;
@@ -207,6 +243,28 @@ void GuiTextEditCtrl::getText( char *dest )
  
 void GuiTextEditCtrl::setText( const UTF8 *txt )
 {
+	//make sure we don't call this before onAdd();
+	if (!mProfile)
+		return;
+
+	//Make sure we have a font
+	mProfile->incRefCount();
+	mFont = mProfile->mFont;
+
+	//Luma:	If the font isn't found, we want to decrement the profile usage and return now or we may crash!
+	if (mFont.isNull())
+	{
+		//decrement the profile referrence
+		mProfile->decRefCount();
+		return;
+	}
+
+	setVariable((char*)mText);
+	setUpdate();
+
+	//decrement the profile referrence
+	mProfile->decRefCount();
+
    if(txt && txt[0] != 0)
    {
       Parent::setText(txt);
@@ -229,21 +287,29 @@ void GuiTextEditCtrl::setText( const UTF16* txt)
    {
       UTF8* txt8 = convertUTF16toUTF8( txt );
       Parent::setText( txt8 );
+	  setText(txt8);
       delete[] txt8;
-      mTextBuffer.set( txt );
    }
    else
    {
       Parent::setText("");
-      mTextBuffer.set("");
-   }
-   
-    //respect the max size
-    int diff = mTextBuffer.length() - mMaxStrLen; 
-    if( diff > 0 ) {
-        mTextBuffer.cut( mMaxStrLen, diff );
-    }
-   mCursorPos = mTextBuffer.length();   
+      setText("");
+   }  
+}
+
+void GuiTextEditCtrl::setTextID(const char *id)
+{
+	S32 n = Con::getIntVariable(id, -1);
+	if (n != -1)
+	{
+		setTextID(n);
+	}
+}
+void GuiTextEditCtrl::setTextID(S32 id)
+{
+	const UTF8 *str = getGUIString(id);
+	if (str)
+		setText((const char*)str);
 }
 
 void GuiTextEditCtrl::selectAllText()
@@ -1386,6 +1452,64 @@ void GuiTextEditCtrl::setScriptValue(const char *value)
    mCursorPos = getMin((S32)(mTextBuffer.length() - 1), 0);
 }
 
+
+StringBuffer GuiTextEditCtrl::truncate(StringBuffer buffer, StringBuffer terminationString, S32 width)
+{
+	// Check if the buffer width exceeds the specified width
+	S32 bufferWidth = textBufferWidth(buffer);
+
+	// If not, just return the unmodified buffer
+	if (bufferWidth <= width)
+		return buffer;
+
+	// Get the width of the termination string
+	S32 terminationWidth = textBufferWidth(terminationString) + 6; // add an extra bit of space at the end
+
+	// Calculate the new target width with space allowed for the termination string
+	S32 targetWidth = width - terminationWidth;
+
+	// If the target width is zero or less, just replace the entire buffer with the termination string
+	if (targetWidth <= 0)
+		return terminationString;
+
+	// Step backwards in the buffer until we find the character that fits within the target width
+	S32 currentWidth = 0;
+	S32 count = 0;
+	for (S32 i = 0; i < (S32)buffer.length(); i++)
+	{
+		if (currentWidth >= targetWidth)
+			break;
+
+		UTF16 c = buffer.getChar(i);
+		currentWidth += mFont->getCharXIncrement(c);
+		count++;
+	}
+
+	// Get the substring
+	StringBuffer retBuffer = buffer.substring(0, count - 2);
+
+	// Append terminating string
+	retBuffer.append(terminationString);
+
+	return retBuffer;
+}
+
+S32 GuiTextEditCtrl::textBufferWidth(StringBuffer buffer)
+{
+	S32 charLength = 0;
+
+	for (S32 count = 0; count < (S32)buffer.length(); count++)
+	{
+		UTF16 c = buffer.getChar(count);
+		if (!mFont->isValidChar(c))
+			continue;
+
+		charLength += mFont->getCharXIncrement(c);
+	}
+
+	return charLength;
+}
+
 ConsoleMethod( GuiTextEditCtrl, getText, const char*, 2, 2, "() Get the contents of the textedit control\n"
               "@return Returns the current textedit buffer.")
 {

+ 13 - 3
engine/source/gui/guiTextEditCtrl.h

@@ -30,15 +30,18 @@
 #include "gui/guiTextCtrl.h"
 #endif
 
-class GuiTextEditCtrl : public GuiTextCtrl
+class GuiTextEditCtrl : public GuiControl
 {
 private:
-   typedef GuiTextCtrl Parent;
+   typedef GuiControl Parent;
 
    static U32 smNumAwake;
 
 protected:
 
+	S32 mMaxStrLen;   // max string len, must be less then or equal to 255
+	Resource<GFont> mFont;
+	bool     mTruncateWhenUnfocused;
    StringBuffer mTextBuffer;
 
    StringTableEntry mValidateCommand;
@@ -86,6 +89,8 @@ protected:
    UTF16   **mHistoryBuf;
    void updateHistory(StringBuffer *txt, bool moveIndex);
 
+   S32 textBufferWidth(StringBuffer buffer);
+   StringBuffer truncate(StringBuffer buffer, StringBuffer terminationString, S32 width);
 
 public:
    GuiTextEditCtrl();
@@ -94,6 +99,7 @@ public:
    static void initPersistFields();
 
    bool onAdd();
+   void inspectPostApply();
    bool onWake();
    void onSleep();
 
@@ -104,6 +110,8 @@ public:
 
    virtual void setText(const UTF8* txt);
    virtual void setText(const UTF16* txt);
+   virtual void setTextID(S32 id);
+   virtual void setTextID(const char *id);
    S32   getCursorPos()   { return( mCursorPos ); }
    void  reallySetCursorPos( const S32 newPos );
    
@@ -134,7 +142,9 @@ public:
    virtual void drawText( const RectI &drawRect, GuiControlState currentState );
 	
 	void playDeniedSound();
-	void execConsoleCallback();	
+	void execConsoleCallback();
+
+	enum Constants { MAX_STRING_LENGTH = 1024 };
 };
 
 #endif //_GUI_TEXTEDIT_CTRL_H

+ 0 - 1
toybox/Sandbox/1/gui/guiProfiles.cs

@@ -122,7 +122,6 @@ if(!isObject(GuiDefaultProfile)) new GuiControlProfile (GuiDefaultProfile)
 	align = center;
 	vAlign = middle;
 
-    // bitmap information
 	cursorColor = "0 0 0 255";
 
 	borderDefault = GuiDefaultBorderProfile;