Skip to content
Permalink
Browse files

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.
  • Loading branch information...
greenfire27 committed Mar 21, 2019
1 parent 50a3198 commit 03ef9ca1aa20f8bbc5f53aaa0a348fdb4a4a5b14
@@ -521,7 +521,7 @@ bool GuiScrollCtrl::onKeyDown(const GuiEvent &event)
return Parent::onKeyDown(event);
}

void GuiScrollCtrl::onMouseDown(const GuiEvent &event)
void GuiScrollCtrl::onTouchDown(const GuiEvent &event)
{
mouseLock();

@@ -548,7 +548,7 @@ void GuiScrollCtrl::onMouseDown(const GuiEvent &event)
}
}

void GuiScrollCtrl::onMouseUp(const GuiEvent &)
void GuiScrollCtrl::onTouchUp(const GuiEvent &)
{
mouseUnlock();

@@ -558,7 +558,7 @@ void GuiScrollCtrl::onMouseUp(const GuiEvent &)
stateDepressed = false;
}

void GuiScrollCtrl::onMouseDragged(const GuiEvent &event)
void GuiScrollCtrl::onTouchDragged(const GuiEvent &event)
{
Point2I curMousePos = globalToLocalCoord(event.mousePoint);
setUpdate();
@@ -813,7 +813,7 @@ void GuiScrollCtrl::onRender(Point2I offset, const RectI &updateRect)
// create a rect to intersect with the updateRect
RectI contentRect(mContentPos.x + offset.x, mContentPos.y + offset.y, mContentExt.x, mContentExt.y);
if(contentRect.intersect(updateRect))
renderChildControls(offset, mBounds, contentRect);
renderChildControls(offset, contentRect, updateRect);

// Finally draw the last vis rect (debug aid, BJG)
//RectI renderRect = lastVisRect;
@@ -202,10 +202,9 @@ class GuiScrollCtrl : public GuiControl
Region getCurHitRegion(void) { return curHitRegion; }

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 onMouseWheelDown(const GuiEvent &event);

@@ -90,6 +90,8 @@ void GuiConsoleTextCtrl::calcResize()
return;

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


@@ -712,9 +712,9 @@ bool GuiControl::renderTooltip(Point2I cursorPos, const char* tipText )

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;

S32 size = objectList.size();
@@ -1671,7 +1671,7 @@ void GuiControl::renderText(Point2I offset, Point2I extent, const char *text, Gu
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)
@@ -33,7 +33,6 @@ IMPLEMENT_CONOBJECT(GuiTabPageCtrl);
GuiTabPageCtrl::GuiTabPageCtrl(void)
{
mBounds.extent.set(100, 200);
mMinSize.set(50, 50);
//dStrcpy(mText,(UTF8*)"TabPage");
mActive = true;
mIsContainer = true;
@@ -32,7 +32,6 @@ class GuiTabPageCtrl : public GuiControl
private:
typedef GuiControl Parent;

Point2I mMinSize;
S32 mTabIndex;

public:
@@ -112,6 +112,8 @@ bool GuiTextCtrl::onWake()
}

//resize
//DEPRECIATED
/*
if ( mProfile->mAutoSizeWidth )
{
if ( mProfile->mAutoSizeHeight )
@@ -122,6 +124,7 @@ bool GuiTextCtrl::onWake()
else if ( mProfile->mAutoSizeHeight )
resize( mBounds.point, Point2I( mBounds.extent.x, mFont->getHeight() + 4 ) );
*/
return true;
}

@@ -156,6 +159,8 @@ void GuiTextCtrl::setText(const char *txt)
}

//resize
//DEPRECIATED
/*
if (mProfile->mAutoSizeWidth)
{
if (mProfile->mAutoSizeHeight)
@@ -167,6 +172,7 @@ void GuiTextCtrl::setText(const char *txt)
{
resize(mBounds.point, Point2I(mBounds.extent.x, mFont->getHeight() + 4));
}
*/

setVariable((char*)mText);
setUpdate();
Oops, something went wrong.

0 comments on commit 03ef9ca

Please sign in to comment.
You can’t perform that action at this time.