ソースを参照

Text Edit Update

These changes update the text edit control to work with the latest settings. It also does a little to the scroll control but there is more to do still.
Peter Robinson 6 年 前
コミット
03ef9ca1aa

+ 4 - 4
engine/source/gui/containers/guiScrollCtrl.cc

@@ -521,7 +521,7 @@ bool GuiScrollCtrl::onKeyDown(const GuiEvent &event)
    return Parent::onKeyDown(event);
    return Parent::onKeyDown(event);
 }
 }
 
 
-void GuiScrollCtrl::onMouseDown(const GuiEvent &event)
+void GuiScrollCtrl::onTouchDown(const GuiEvent &event)
 {
 {
    mouseLock();
    mouseLock();
 
 
@@ -548,7 +548,7 @@ void GuiScrollCtrl::onMouseDown(const GuiEvent &event)
    }
    }
 }
 }
 
 
-void GuiScrollCtrl::onMouseUp(const GuiEvent &)
+void GuiScrollCtrl::onTouchUp(const GuiEvent &)
 {
 {
    mouseUnlock();
    mouseUnlock();
 
 
@@ -558,7 +558,7 @@ void GuiScrollCtrl::onMouseUp(const GuiEvent &)
    stateDepressed = false;
    stateDepressed = false;
 }
 }
 
 
-void GuiScrollCtrl::onMouseDragged(const GuiEvent &event)
+void GuiScrollCtrl::onTouchDragged(const GuiEvent &event)
 {
 {
    Point2I curMousePos = globalToLocalCoord(event.mousePoint);
    Point2I curMousePos = globalToLocalCoord(event.mousePoint);
    setUpdate();
    setUpdate();
@@ -813,7 +813,7 @@ void GuiScrollCtrl::onRender(Point2I offset, const RectI &updateRect)
    // create a rect to intersect with the updateRect
    // create a rect to intersect with the updateRect
    RectI contentRect(mContentPos.x + offset.x, mContentPos.y + offset.y, mContentExt.x, mContentExt.y);
    RectI contentRect(mContentPos.x + offset.x, mContentPos.y + offset.y, mContentExt.x, mContentExt.y);
    if(contentRect.intersect(updateRect))
    if(contentRect.intersect(updateRect))
-      renderChildControls(offset, mBounds, contentRect);
+      renderChildControls(offset, contentRect, updateRect);
 
 
    // Finally draw the last vis rect (debug aid, BJG)
    // Finally draw the last vis rect (debug aid, BJG)
    //RectI renderRect = lastVisRect;
    //RectI renderRect = lastVisRect;

+ 3 - 4
engine/source/gui/containers/guiScrollCtrl.h

@@ -202,10 +202,9 @@ public:
    Region getCurHitRegion(void) { return curHitRegion; }
    Region getCurHitRegion(void) { return curHitRegion; }
 
 
    bool onKeyDown(const GuiEvent &event);
    bool onKeyDown(const GuiEvent &event);
-   void onMouseDown(const GuiEvent &event);
-   void onMouseRepeat(const GuiEvent &event);
-   void onMouseUp(const GuiEvent &event);
-   void onMouseDragged(const GuiEvent &event);
+   void onTouchDown(const GuiEvent &event);
+   void onTouchUp(const GuiEvent &event);
+   void onTouchDragged(const GuiEvent &event);
    bool onMouseWheelUp(const GuiEvent &event);
    bool onMouseWheelUp(const GuiEvent &event);
    bool onMouseWheelDown(const GuiEvent &event);
    bool onMouseWheelDown(const GuiEvent &event);
 
 

+ 3 - 0
engine/source/gui/guiConsoleTextCtrl.cc

@@ -90,6 +90,8 @@ void GuiConsoleTextCtrl::calcResize()
       return;
       return;
 
 
    //resize
    //resize
+   //DEPRECIATED
+   /*
    if (mProfile->mAutoSizeWidth)
    if (mProfile->mAutoSizeWidth)
    {
    {
       if (mProfile->mAutoSizeHeight)
       if (mProfile->mAutoSizeHeight)
@@ -101,6 +103,7 @@ void GuiConsoleTextCtrl::calcResize()
    {
    {
       resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
       resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
    }
    }
+   */
 }
 }
 
 
 
 

+ 4 - 4
engine/source/gui/guiControl.cc

@@ -712,9 +712,9 @@ bool GuiControl::renderTooltip(Point2I cursorPos, const char* tipText )
 
 
 void GuiControl::renderChildControls(Point2I offset, RectI content, const RectI &updateRect)
 void GuiControl::renderChildControls(Point2I offset, RectI content, const RectI &updateRect)
 {
 {
-   // offset is the upper-left corner of this control in screen coordinates
-   // updateRect is the intersection rectangle in screen coords of the control
-   // hierarchy.  This can be set as the clip rectangle in most cases.
+   // offset is the upper-left corner of this control in screen coordinates. It should almost always be the same offset passed into the onRender method.
+   // updateRect is the area that this control was allowed to draw in. It should almost always be the same as the value in onRender.
+   // content is the area that child controls are allowed to draw in.
    RectI clipRect = updateRect;
    RectI clipRect = updateRect;
 
 
    S32 size = objectList.size();
    S32 size = objectList.size();
@@ -1671,7 +1671,7 @@ void GuiControl::renderText(Point2I offset, Point2I extent, const char *text, Gu
 		rotation = -90.0f;
 		rotation = -90.0f;
 	}
 	}
 
 
-	dglDrawText( font, start + offset, text, profile->mFontColors, 9, rotation );
+	dglDrawText( font, start + offset + profile->mTextOffset, text, profile->mFontColors, 9, rotation );
 }
 }
 
 
 void GuiControl::getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent)
 void GuiControl::getCursor(GuiCursor *&cursor, bool &showCursor, const GuiEvent &lastGuiEvent)

+ 0 - 1
engine/source/gui/guiTabPageCtrl.cc

@@ -33,7 +33,6 @@ IMPLEMENT_CONOBJECT(GuiTabPageCtrl);
 GuiTabPageCtrl::GuiTabPageCtrl(void)
 GuiTabPageCtrl::GuiTabPageCtrl(void)
 {
 {
    mBounds.extent.set(100, 200);
    mBounds.extent.set(100, 200);
-   mMinSize.set(50, 50);
    //dStrcpy(mText,(UTF8*)"TabPage");
    //dStrcpy(mText,(UTF8*)"TabPage");
    mActive = true;
    mActive = true;
    mIsContainer = true;
    mIsContainer = true;

+ 0 - 1
engine/source/gui/guiTabPageCtrl.h

@@ -32,7 +32,6 @@ class GuiTabPageCtrl : public GuiControl
    private:
    private:
       typedef GuiControl Parent;
       typedef GuiControl Parent;
 
 
-      Point2I        mMinSize;
       S32            mTabIndex;
       S32            mTabIndex;
 
 
    public:
    public:

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

@@ -112,6 +112,8 @@ bool GuiTextCtrl::onWake()
    }
    }
    
    
    //resize
    //resize
+   //DEPRECIATED
+   /*
    if ( mProfile->mAutoSizeWidth )
    if ( mProfile->mAutoSizeWidth )
    {
    {
       if ( mProfile->mAutoSizeHeight )
       if ( mProfile->mAutoSizeHeight )
@@ -122,6 +124,7 @@ bool GuiTextCtrl::onWake()
    else if ( mProfile->mAutoSizeHeight )
    else if ( mProfile->mAutoSizeHeight )
       resize( mBounds.point, Point2I( mBounds.extent.x, mFont->getHeight() + 4 ) );
       resize( mBounds.point, Point2I( mBounds.extent.x, mFont->getHeight() + 4 ) );
 
 
+*/
    return true;
    return true;
 }
 }
 
 
@@ -156,6 +159,8 @@ void GuiTextCtrl::setText(const char *txt)
 	}
 	}
 
 
 	//resize
 	//resize
+	//DEPRECIATED
+   /*
    if (mProfile->mAutoSizeWidth)
    if (mProfile->mAutoSizeWidth)
    {
    {
       if (mProfile->mAutoSizeHeight)
       if (mProfile->mAutoSizeHeight)
@@ -167,6 +172,7 @@ void GuiTextCtrl::setText(const char *txt)
    {
    {
       resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
       resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
    }
    }
+   */
       
       
    setVariable((char*)mText);
    setVariable((char*)mText);
    setUpdate();
    setUpdate();

+ 58 - 56
engine/source/gui/guiTextEditCtrl.cc

@@ -315,7 +315,7 @@ S32 GuiTextEditCtrl::setCursorPos( const Point2I &offset )
    return count;
    return count;
 }
 }
 
 
-void GuiTextEditCtrl::onMouseDown( const GuiEvent &event )
+void GuiTextEditCtrl::onTouchDown( const GuiEvent &event )
 {
 {
    mDragHit = false;
    mDragHit = false;
 
 
@@ -357,17 +357,17 @@ void GuiTextEditCtrl::onMouseDown( const GuiEvent &event )
    setFirstResponder();
    setFirstResponder();
 
 
    // Notify Script.
    // Notify Script.
-    if( isMethod("onMouseDown") )
+    if( isMethod("onTouchDown") )
     {
     {
         char buf[3][32];
         char buf[3][32];
         dSprintf(buf[0], 32, "%d", event.modifier);
         dSprintf(buf[0], 32, "%d", event.modifier);
         dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
         dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
         dSprintf(buf[2], 32, "%d", event.mouseClickCount);
         dSprintf(buf[2], 32, "%d", event.mouseClickCount);
-        Con::executef(this, 4, "onMouseDown", buf[0], buf[1], buf[2]);
+        Con::executef(this, 4, "onTouchDown", buf[0], buf[1], buf[2]);
     }
     }
 }
 }
 
 
-void GuiTextEditCtrl::onMouseDragged( const GuiEvent &event )
+void GuiTextEditCtrl::onTouchDragged( const GuiEvent &event )
 {
 {
    S32 pos = setCursorPos( event.mousePoint );
    S32 pos = setCursorPos( event.mousePoint );
 
 
@@ -395,30 +395,30 @@ void GuiTextEditCtrl::onMouseDragged( const GuiEvent &event )
    Parent::onTouchDragged(event);
    Parent::onTouchDragged(event);
 
 
    // Notify Script.
    // Notify Script.
-    if( isMethod("onMouseDragged") )
+    if( isMethod("onTouchDragged") )
     {
     {
         char buf[3][32];
         char buf[3][32];
         dSprintf(buf[0], 32, "%d", event.modifier);
         dSprintf(buf[0], 32, "%d", event.modifier);
         dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
         dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
         dSprintf(buf[2], 32, "%d", event.mouseClickCount);
         dSprintf(buf[2], 32, "%d", event.mouseClickCount);
-        Con::executef(this, 4, "onMouseDragged", buf[0], buf[1], buf[2]);
+        Con::executef(this, 4, "onTouchDragged", buf[0], buf[1], buf[2]);
     }
     }
 }
 }
 
 
-void GuiTextEditCtrl::onMouseUp(const GuiEvent &event)
+void GuiTextEditCtrl::onTouchUp(const GuiEvent &event)
 {
 {
    mDragHit = false;
    mDragHit = false;
    mScrollDir = 0;
    mScrollDir = 0;
    mouseUnlock();
    mouseUnlock();
 
 
     // Notify Script.
     // Notify Script.
-    if( isMethod("onMouseUp") )
+    if( isMethod("onTouchUp") )
     {
     {
         char buf[3][32];
         char buf[3][32];
         dSprintf(buf[0], 32, "%d", event.modifier);
         dSprintf(buf[0], 32, "%d", event.modifier);
         dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
         dSprintf(buf[1], 32, "%d %d", event.mousePoint.x, event.mousePoint.y);
         dSprintf(buf[2], 32, "%d", event.mouseClickCount);
         dSprintf(buf[2], 32, "%d", event.mouseClickCount);
-        Con::executef(this, 4, "onMouseUp", buf[0], buf[1], buf[2]);
+        Con::executef(this, 4, "onTouchUp", buf[0], buf[1], buf[2]);
     }
     }
 }
 }
 
 
@@ -1109,27 +1109,39 @@ void GuiTextEditCtrl::parentResized(const Point2I &oldParentExtent, const Point2
 
 
 void GuiTextEditCtrl::onRender(Point2I offset, const RectI & updateRect)
 void GuiTextEditCtrl::onRender(Point2I offset, const RectI & updateRect)
 {
 {
-   RectI ctrlRect( offset, mBounds.extent );
-
-   //if opaque, fill the update rect with the fill color
-   if ( mProfile->mOpaque )
-   {
-      if(isFirstResponder())
-         dglDrawRectFill( ctrlRect, mActive ? mProfile->mFillColor : mProfile->mFillColorNA );
-      else
-         dglDrawRectFill( ctrlRect, mActive ? mProfile->mFillColor : mProfile->mFillColorNA );
-   }
-
-   //if there's a border, draw the border
-   if (mProfile->mBorderDefault && mProfile->mBorderDefault->mBorder > 0)
-   {
-      dglSetBitmapModulation( mActive ? mProfile->mFillColor : mProfile->mFillColorNA );
-      //renderBorder( ctrlRect, mProfile );
-   }
-
-   drawText( ctrlRect, isFirstResponder() );
-   
-   renderChildControls(offset, mBounds, updateRect);
+	//Notice that there's no Highlight state. The HL colors are used for selected text - not hover.
+	//The selected state is used when the box has the focus and can be typed in.
+	GuiControlState currentState = NormalState;
+	if (!mActive)
+	{
+		currentState = DisabledState;
+	}
+	else if (isFirstResponder())
+	{
+		currentState = SelectedState;
+	}
+
+	RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState, mProfile);
+
+	if (!ctrlRect.isValidRect())
+	{
+		return;
+	}
+
+	renderBorderedRect(ctrlRect, mProfile, currentState);
+
+	//Render Text
+	dglSetBitmapModulation(mProfile->mFontColor);
+	RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, NormalState, mProfile);
+	RectI contentRect = applyPadding(fillRect.point, fillRect.extent, NormalState, mProfile);
+
+	if (contentRect.isValidRect())
+	{
+		drawText(contentRect, currentState);
+
+		//Render the childen
+		renderChildControls(offset, contentRect, updateRect);
+	}
 }
 }
 
 
 void GuiTextEditCtrl::onPreRender()
 void GuiTextEditCtrl::onPreRender()
@@ -1157,11 +1169,10 @@ void GuiTextEditCtrl::onPreRender()
    }
    }
 }
 }
 
 
-void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
+void GuiTextEditCtrl::drawText( const RectI &drawRect, GuiControlState currentState )
 {
 {
    StringBuffer textBuffer;
    StringBuffer textBuffer;
    Point2I drawPoint = drawRect.point;
    Point2I drawPoint = drawRect.point;
-   Point2I paddingLeftTop, paddingRightBottom;
 
 
    // Just a little sanity.
    // Just a little sanity.
    if(mCursorPos > (S32)mTextBuffer.length()) 
    if(mCursorPos > (S32)mTextBuffer.length()) 
@@ -1181,34 +1192,25 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
       textBuffer.set(&mTextBuffer);
       textBuffer.set(&mTextBuffer);
    }
    }
 
 
-   paddingLeftTop.set(( mProfile->mTextOffset.x != 0 ? mProfile->mTextOffset.x : 3 ), mProfile->mTextOffset.y);
-   paddingRightBottom = paddingLeftTop;
-
    // Center vertically:
    // Center vertically:
-   drawPoint.y += ( ( drawRect.extent.y - paddingLeftTop.y - paddingRightBottom.y - mFont->getHeight() ) / 2 ) + paddingLeftTop.y;
+   drawPoint.y += ( ( drawRect.extent.y - mFont->getHeight() ) / 2 );
 
 
    // Align horizontally:
    // Align horizontally:
    
    
    S32 textWidth = mFont->getStrNWidth(textBuffer.getPtr(), textBuffer.length());
    S32 textWidth = mFont->getStrNWidth(textBuffer.getPtr(), textBuffer.length());
 
 
-   if ( drawRect.extent.x - paddingLeftTop.x > textWidth )
+   if ( drawRect.extent.x > textWidth )
    {
    {
       switch( mProfile->mAlignment )
       switch( mProfile->mAlignment )
       {
       {
       case GuiControlProfile::RightAlign:
       case GuiControlProfile::RightAlign:
-         drawPoint.x += ( drawRect.extent.x - textWidth - paddingRightBottom.x );
+         drawPoint.x += ( drawRect.extent.x - textWidth );
          break;
          break;
       case GuiControlProfile::CenterAlign:
       case GuiControlProfile::CenterAlign:
          drawPoint.x += ( ( drawRect.extent.x - textWidth ) / 2 );
          drawPoint.x += ( ( drawRect.extent.x - textWidth ) / 2 );
          break;
          break;
-      default:
-      case GuiControlProfile::LeftAlign :
-         drawPoint.x += paddingLeftTop.x;
-         break;
       }
       }
    }
    }
-   else
-      drawPoint.x += paddingLeftTop.x;
 
 
    ColorI fontColor = mActive ? mProfile->mFontColor : mProfile->mFontColorNA;
    ColorI fontColor = mActive ? mProfile->mFontColor : mProfile->mFontColorNA;
 
 
@@ -1221,7 +1223,7 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
       mTextOffsetReset = false;
       mTextOffsetReset = false;
    }
    }
 
 
-   if ( drawRect.extent.x - paddingLeftTop.x > textWidth )
+   if ( drawRect.extent.x > textWidth )
       mTextOffset.x = drawPoint.x;
       mTextOffset.x = drawPoint.x;
    else
    else
    {
    {
@@ -1229,13 +1231,13 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
       if ( mProfile->mAlignment == GuiControlProfile::RightAlign
       if ( mProfile->mAlignment == GuiControlProfile::RightAlign
          || mProfile->mAlignment == GuiControlProfile::CenterAlign )
          || mProfile->mAlignment == GuiControlProfile::CenterAlign )
       {
       {
-         if ( mTextOffset.x + textWidth < (drawRect.point.x + drawRect.extent.x) - paddingRightBottom.x)
-            mTextOffset.x = (drawRect.point.x + drawRect.extent.x) - paddingRightBottom.x - textWidth;
+         if ( mTextOffset.x + textWidth < (drawRect.point.x + drawRect.extent.x))
+            mTextOffset.x = (drawRect.point.x + drawRect.extent.x) - textWidth;
       }
       }
    }
    }
 
 
    // calculate the cursor
    // calculate the cursor
-   if ( isFocused )
+   if ( currentState == SelectedState )
    {
    {
       // Where in the string are we?
       // Where in the string are we?
       S32 cursorOffset=0, charWidth=0;
       S32 cursorOffset=0, charWidth=0;
@@ -1252,27 +1254,27 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
       if ( tempChar )
       if ( tempChar )
          charWidth = mFont->getCharWidth( tempChar );
          charWidth = mFont->getCharWidth( tempChar );
       else
       else
-         charWidth = paddingRightBottom.x;
+         charWidth = 0;
 
 
-      if( mTextOffset.x + cursorOffset + charWidth >= (drawRect.point.x + drawRect.extent.x) - paddingLeftTop.x )
+      if( mTextOffset.x + cursorOffset + charWidth >= (drawRect.point.x + drawRect.extent.x))
       {
       {
          // Cursor somewhere beyond the textcontrol,
          // Cursor somewhere beyond the textcontrol,
          // skip forward roughly 25% of the total width (if possible)
          // skip forward roughly 25% of the total width (if possible)
          S32 skipForward = drawRect.extent.x / 4;
          S32 skipForward = drawRect.extent.x / 4;
 
 
          if ( cursorOffset + skipForward > textWidth )
          if ( cursorOffset + skipForward > textWidth )
-            mTextOffset.x = (drawRect.point.x + drawRect.extent.x) - paddingRightBottom.x - textWidth;
+            mTextOffset.x = (drawRect.point.x + drawRect.extent.x) - textWidth;
          else
          else
             mTextOffset.x -= skipForward;
             mTextOffset.x -= skipForward;
       }
       }
-      else if( mTextOffset.x + cursorOffset < drawRect.point.x + paddingLeftTop.x )
+      else if( mTextOffset.x + cursorOffset < drawRect.point.x)
       {
       {
          // Cursor somewhere before the textcontrol
          // Cursor somewhere before the textcontrol
          // skip backward roughly 25% of the total width (if possible)
          // skip backward roughly 25% of the total width (if possible)
          S32 skipBackward = drawRect.extent.x / 4;
          S32 skipBackward = drawRect.extent.x / 4;
 
 
          if ( cursorOffset - skipBackward < 0 )
          if ( cursorOffset - skipBackward < 0 )
-            mTextOffset.x = drawRect.point.x + paddingLeftTop.x;
+            mTextOffset.x = drawRect.point.x;
          else
          else
             mTextOffset.x += skipBackward;
             mTextOffset.x += skipBackward;
       }
       }
@@ -1293,7 +1295,7 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
    }
    }
 
 
    //draw the text
    //draw the text
-   if ( !isFocused )
+   if ( currentState != SelectedState )
       mBlockStart = mBlockEnd = 0;
       mBlockStart = mBlockEnd = 0;
 
 
    //also verify the block start/end
    //also verify the block start/end
@@ -1333,7 +1335,7 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
    if(mBlockEnd < (S32)mTextBuffer.length())
    if(mBlockEnd < (S32)mTextBuffer.length())
    {
    {
        // Special handling if we are truncating when the ctrl is unfocused
        // Special handling if we are truncating when the ctrl is unfocused
-       if ( !isFocused && mTruncateWhenUnfocused)
+       if (currentState != SelectedState && mTruncateWhenUnfocused)
        {
        {
           StringBuffer terminationString = "...";
           StringBuffer terminationString = "...";
           S32 width = mBounds.extent.x;
           S32 width = mBounds.extent.x;
@@ -1355,7 +1357,7 @@ void GuiTextEditCtrl::drawText( const RectI &drawRect, bool isFocused )
    }
    }
 
 
    //draw the cursor
    //draw the cursor
-   if ( isFocused && mCursorOn )
+   if (currentState == SelectedState && mCursorOn )
       dglDrawLine( cursorStart, cursorEnd, mProfile->mCursorColor );
       dglDrawLine( cursorStart, cursorEnd, mProfile->mCursorColor );
 }
 }
 
 

+ 6 - 7
engine/source/gui/guiTextEditCtrl.h

@@ -102,21 +102,20 @@ public:
    /// dest should be of size GuiTextCtrl::MAX_STRING_LENGTH+1.
    /// dest should be of size GuiTextCtrl::MAX_STRING_LENGTH+1.
    void getText(char *dest);
    void getText(char *dest);
 
 
-   void setText(S32 tag);
    virtual void setText(const UTF8* txt);
    virtual void setText(const UTF8* txt);
    virtual void setText(const UTF16* txt);
    virtual void setText(const UTF16* txt);
    S32   getCursorPos()   { return( mCursorPos ); }
    S32   getCursorPos()   { return( mCursorPos ); }
    void  reallySetCursorPos( const S32 newPos );
    void  reallySetCursorPos( const S32 newPos );
    
    
-   void selectAllText(); //*** DAW: Added
-   void forceValidateText(); //*** DAW: Added
+   void selectAllText();
+   void forceValidateText();
    const char *getScriptValue();
    const char *getScriptValue();
    void setScriptValue(const char *value);
    void setScriptValue(const char *value);
 
 
    bool onKeyDown(const GuiEvent &event);
    bool onKeyDown(const GuiEvent &event);
-   void onMouseDown(const GuiEvent &event);
-   void onMouseDragged(const GuiEvent &event);
-   void onMouseUp(const GuiEvent &event);
+   void onTouchDown(const GuiEvent &event);
+   void onTouchDragged(const GuiEvent &event);
+   void onTouchUp(const GuiEvent &event);
    
    
    void onCopy(bool andCut);
    void onCopy(bool andCut);
    void onPaste();
    void onPaste();
@@ -132,7 +131,7 @@ public:
 
 
    void onPreRender();
    void onPreRender();
    void onRender(Point2I offset, const RectI &updateRect);
    void onRender(Point2I offset, const RectI &updateRect);
-   virtual void drawText( const RectI &drawRect, bool isFocused );
+   virtual void drawText( const RectI &drawRect, GuiControlState currentState );
 	
 	
 	void playDeniedSound();
 	void playDeniedSound();
 	void execConsoleCallback();	
 	void execConsoleCallback();	

+ 6 - 6
engine/source/gui/guiTextEditSliderCtrl.cc

@@ -84,7 +84,7 @@ void GuiTextEditSliderCtrl::setValue()
    Parent::setText(buf);
    Parent::setText(buf);
 }
 }
 
 
-void GuiTextEditSliderCtrl::onMouseDown(const GuiEvent &event)
+void GuiTextEditSliderCtrl::onTouchDown(const GuiEvent &event)
 {
 {
    char txt[20];
    char txt[20];
    Parent::getText(txt);
    Parent::getText(txt);
@@ -117,10 +117,10 @@ void GuiTextEditSliderCtrl::onMouseDown(const GuiEvent &event)
       mouseLock();
       mouseLock();
       return;
       return;
    }
    }
-   Parent::onMouseDown(event);
+   Parent::onTouchDown(event);
 }
 }
 
 
-void GuiTextEditSliderCtrl::onMouseDragged(const GuiEvent &event)
+void GuiTextEditSliderCtrl::onTouchDragged(const GuiEvent &event)
 {
 {
    if(mTextAreaHit == None || mTextAreaHit == Slider)
    if(mTextAreaHit == None || mTextAreaHit == Slider)
    {
    {
@@ -158,17 +158,17 @@ void GuiTextEditSliderCtrl::onMouseDragged(const GuiEvent &event)
          return;
          return;
       }
       }
       mTextAreaHit = None;
       mTextAreaHit = None;
-      Parent::onMouseDragged(event);
+      Parent::onTouchDragged(event);
    }
    }
 }
 }
 
 
-void GuiTextEditSliderCtrl::onMouseUp(const GuiEvent &event)
+void GuiTextEditSliderCtrl::onTouchUp(const GuiEvent &event)
 {
 {
    mMulInc = 0.0f;
    mMulInc = 0.0f;
    mouseUnlock();
    mouseUnlock();
   //if we released the mouse within this control, then the parent will call
   //if we released the mouse within this control, then the parent will call
   //the mConsoleCommand other wise we have to call it.
   //the mConsoleCommand other wise we have to call it.
-   Parent::onMouseUp(event);
+   Parent::onTouchUp(event);
   //if we didn't release the mouse within this control, then perform the action
   //if we didn't release the mouse within this control, then perform the action
    if (!cursorInControl())
    if (!cursorInControl())
       Con::evaluate(mConsoleCommand, false);
       Con::evaluate(mConsoleCommand, false);

+ 3 - 4
engine/source/gui/guiTextEditSliderCtrl.h

@@ -61,7 +61,6 @@ public:
    void getText(char *dest);  // dest must be of size
    void getText(char *dest);  // dest must be of size
                                       // StructDes::MAX_STRING_LEN + 1
                                       // StructDes::MAX_STRING_LEN + 1
 
 
-   void setText(S32 tag);
    void setText(const char *txt);
    void setText(const char *txt);
 
 
    void setValue();
    void setValue();
@@ -70,9 +69,9 @@ public:
    void timeInc(U32 elapseTime);
    void timeInc(U32 elapseTime);
 
 
    bool onKeyDown(const GuiEvent &event);
    bool onKeyDown(const GuiEvent &event);
-   void onMouseDown(const GuiEvent &event);
-   void onMouseDragged(const GuiEvent &event);
-   void onMouseUp(const GuiEvent &event);
+   void onTouchDown(const GuiEvent &event);
+   void onTouchDragged(const GuiEvent &event);
+   void onTouchUp(const GuiEvent &event);
 
 
 
 
    void onPreRender();
    void onPreRender();

+ 3 - 0
engine/source/gui/guiTreeViewCtrl.cc

@@ -1107,11 +1107,14 @@ bool GuiTreeViewCtrl::onWake()
    }
    }
 
 
    // Update the row height, if appropriate.
    // Update the row height, if appropriate.
+   // DEPRECIATED
+   /*
    if(mProfile->mAutoSizeHeight)
    if(mProfile->mAutoSizeHeight)
    {
    {
       // make sure it's big enough for both bitmap AND font...
       // make sure it's big enough for both bitmap AND font...
       mItemHeight = getMax((S32)mFont->getHeight(), (S32)mProfile->mBitmapArrayRects[0].extent.y);
       mItemHeight = getMax((S32)mFont->getHeight(), (S32)mProfile->mBitmapArrayRects[0].extent.y);
    }
    }
+   */
 
 
    return true;
    return true;
 }
 }

+ 0 - 4
engine/source/gui/guiTypes.cc

@@ -257,8 +257,6 @@ GuiControlProfile::GuiControlProfile(void) :
     mModal         = true;
     mModal         = true;
     mAlignment     = LeftAlign;
     mAlignment     = LeftAlign;
 	mVAlignment    = MiddleVAlign;
 	mVAlignment    = MiddleVAlign;
-    mAutoSizeWidth = false;
-    mAutoSizeHeight= false;
     mReturnTab     = false;
     mReturnTab     = false;
     mNumbersOnly   = false;
     mNumbersOnly   = false;
     mProfileForChildren = NULL;
     mProfileForChildren = NULL;
@@ -338,8 +336,6 @@ void GuiControlProfile::initPersistFields()
    addField("align", TypeEnum, Offset(mAlignment, GuiControlProfile), 1, &gAlignTable);
    addField("align", TypeEnum, Offset(mAlignment, GuiControlProfile), 1, &gAlignTable);
    addField("vAlign", TypeEnum, Offset(mVAlignment, GuiControlProfile), 1, &gVAlignTable);
    addField("vAlign", TypeEnum, Offset(mVAlignment, GuiControlProfile), 1, &gVAlignTable);
    addField("textOffset",    TypePoint2I,    Offset(mTextOffset, GuiControlProfile));
    addField("textOffset",    TypePoint2I,    Offset(mTextOffset, GuiControlProfile));
-   addField("autoSizeWidth", TypeBool,       Offset(mAutoSizeWidth, GuiControlProfile));
-   addField("autoSizeHeight",TypeBool,       Offset(mAutoSizeHeight, GuiControlProfile));
    addField("returnTab",     TypeBool,       Offset(mReturnTab, GuiControlProfile));
    addField("returnTab",     TypeBool,       Offset(mReturnTab, GuiControlProfile));
    addField("numbersOnly",   TypeBool,       Offset(mNumbersOnly, GuiControlProfile));
    addField("numbersOnly",   TypeBool,       Offset(mNumbersOnly, GuiControlProfile));
    addField("cursorColor",   TypeColorI,     Offset(mCursorColor, GuiControlProfile));
    addField("cursorColor",   TypeColorI,     Offset(mCursorColor, GuiControlProfile));

+ 0 - 2
engine/source/gui/guiTypes.h

@@ -200,8 +200,6 @@ public:
    };
    };
    VertAlignmentType mVAlignment;				   ///< Vertical text alignment
    VertAlignmentType mVAlignment;				   ///< Vertical text alignment
 
 
-   bool mAutoSizeWidth;                            ///< Auto-size the width-bounds of the control to fit it's contents
-   bool mAutoSizeHeight;                           ///< Auto-size the height-bounds of the control to fit it's contents
    bool mReturnTab;                                ///< Used in GuiTextEditCtrl to specify if a tab-event should be simulated when return is pressed.
    bool mReturnTab;                                ///< Used in GuiTextEditCtrl to specify if a tab-event should be simulated when return is pressed.
    bool mNumbersOnly;                              ///< For text controls, true if this should only accept numerical data
    bool mNumbersOnly;                              ///< For text controls, true if this should only accept numerical data
    bool mMouseOverSelected;                        ///< True if this object should be "selected" while the mouse is over it
    bool mMouseOverSelected;                        ///< True if this object should be "selected" while the mouse is over it