Skip to content

Commit

Permalink
Tab Book Update
Browse files Browse the repository at this point in the history
Previously the tab book was barely functional. Positioning the tabs to the right, left, or bottom did not work and there was no option to have the tabs draw without images. These changes fix that, but leave off support (for now) of image skinned tabs. It makes heavy use of the new border model.
  • Loading branch information
greenfire27 committed Mar 5, 2019
1 parent 66b8d40 commit 50a3198
Show file tree
Hide file tree
Showing 30 changed files with 407 additions and 328 deletions.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added engine/compilers/VisualStudio 2017/Torque 2D.aps
Binary file not shown.
10 changes: 5 additions & 5 deletions engine/compilers/VisualStudio 2017/Torque 2D.rc
Expand Up @@ -62,8 +62,8 @@ END
// //


VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,0,0,0 FILEVERSION 4,0,0,0
PRODUCTVERSION 2,0,0,0 PRODUCTVERSION 4,0,0,0
FILEFLAGSMASK 0x17L FILEFLAGSMASK 0x17L
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
Expand All @@ -80,12 +80,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "GarageGames LLC" VALUE "CompanyName", "GarageGames LLC"
VALUE "FileDescription", "Torque 2D MIT" VALUE "FileDescription", "Torque 2D MIT"
VALUE "FileVersion", "2, 0, 0, 0" VALUE "FileVersion", "4, 0, 0, 0"
VALUE "InternalName", "Torque 2D" VALUE "InternalName", "Torque 2D"
VALUE "LegalCopyright", "Copyright (c) 2013 GarageGames, LLC" VALUE "LegalCopyright", "Copyright (c) 2019 GarageGames, LLC"
VALUE "OriginalFilename", "Torque2D.exe" VALUE "OriginalFilename", "Torque2D.exe"
VALUE "ProductName", "Torque 2D MIT" VALUE "ProductName", "Torque 2D MIT"
VALUE "ProductVersion", "2, 0, 0, 0" VALUE "ProductVersion", "4, 0, 0, 0"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
Expand Down
1 change: 1 addition & 0 deletions engine/compilers/VisualStudio 2017/Torque 2D.vcxproj
Expand Up @@ -890,6 +890,7 @@
<ClInclude Include="..\..\source\graphics\TextureObject.h" /> <ClInclude Include="..\..\source\graphics\TextureObject.h" />
<ClInclude Include="..\..\source\gui\buttons\guiCheckBoxCtrl_ScriptBinding.h" /> <ClInclude Include="..\..\source\gui\buttons\guiCheckBoxCtrl_ScriptBinding.h" />
<ClInclude Include="..\..\source\gui\containers\guiGridCtrl.h" /> <ClInclude Include="..\..\source\gui\containers\guiGridCtrl.h" />
<ClInclude Include="..\..\source\gui\containers\guiTabBookCtrl_ScriptBinding.h" />
<ClInclude Include="..\..\source\gui\guiArrayCtrl.h" /> <ClInclude Include="..\..\source\gui\guiArrayCtrl.h" />
<ClInclude Include="..\..\source\gui\guiBackgroundCtrl.h" /> <ClInclude Include="..\..\source\gui\guiBackgroundCtrl.h" />
<ClInclude Include="..\..\source\gui\guiBitmapCtrl.h" /> <ClInclude Include="..\..\source\gui\guiBitmapCtrl.h" />
Expand Down
3 changes: 3 additions & 0 deletions engine/compilers/VisualStudio 2017/Torque 2D.vcxproj.filters
Expand Up @@ -3156,6 +3156,9 @@
<ClInclude Include="..\..\source\gui\buttons\guiCheckBoxCtrl_ScriptBinding.h"> <ClInclude Include="..\..\source\gui\buttons\guiCheckBoxCtrl_ScriptBinding.h">
<Filter>gui\buttons</Filter> <Filter>gui\buttons</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\source\gui\containers\guiTabBookCtrl_ScriptBinding.h">
<Filter>gui\containers</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="..\..\source\math\mMath_ASM.asm"> <CustomBuild Include="..\..\source\math\mMath_ASM.asm">
Expand Down
4 changes: 2 additions & 2 deletions engine/source/2d/gui/guiSceneObjectCtrl.cc
Expand Up @@ -468,10 +468,10 @@ void GuiSceneObjectCtrl::onRender(Point2I offset, const RectI& updateRect)


captionRect.inset(1, 1); captionRect.inset(1, 1);
dglSetBitmapModulation( ColorI(0,0,0,255) ); dglSetBitmapModulation( ColorI(0,0,0,255) );
renderJustifiedText(captionRect.point, captionRect.extent, mCaption); renderText(captionRect.point, captionRect.extent, mCaption, mProfile);
captionRect.inset(1, 1); captionRect.inset(1, 1);
dglSetBitmapModulation( mProfile->mFontColor ); dglSetBitmapModulation( mProfile->mFontColor );
renderJustifiedText(captionRect.point, captionRect.extent, mCaption); renderText(captionRect.point, captionRect.extent, mCaption, mProfile);






Expand Down
8 changes: 4 additions & 4 deletions engine/source/gui/buttons/guiButtonCtrl.cc
Expand Up @@ -253,7 +253,7 @@ void GuiButtonCtrl::onRender(Point2I offset, const RectI& updateRect)
currentState = GuiControlState::HighlightState; currentState = GuiControlState::HighlightState;
} }


RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState); RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState, mProfile);
RectI boundsRect(offset, mBounds.extent); RectI boundsRect(offset, mBounds.extent);


if(mProfile->mBitmapName != NULL && mProfile->constructBitmapArray() >= 36) if(mProfile->mBitmapName != NULL && mProfile->constructBitmapArray() >= 36)
Expand All @@ -275,9 +275,9 @@ void GuiButtonCtrl::onRender(Point2I offset, const RectI& updateRect)


//Render Text //Render Text
dglSetBitmapModulation(mProfile->getFontColor(currentState)); dglSetBitmapModulation(mProfile->getFontColor(currentState));
RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, currentState); RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, currentState, mProfile);
RectI contentRect = applyPadding(fillRect.point, fillRect.extent, currentState); RectI contentRect = applyPadding(fillRect.point, fillRect.extent, currentState, mProfile);
renderJustifiedText(contentRect.point, contentRect.extent, mText); renderText(contentRect.point, contentRect.extent, mText, mProfile);


//Render the childen //Render the childen
renderChildControls(contentRect.point, contentRect, updateRect); renderChildControls(contentRect.point, contentRect, updateRect);
Expand Down
8 changes: 4 additions & 4 deletions engine/source/gui/buttons/guiCheckBoxCtrl.cc
Expand Up @@ -78,9 +78,9 @@ void GuiCheckBoxCtrl::onRender(Point2I offset, const RectI &updateRect)
currentState = GuiControlState::HighlightState; currentState = GuiControlState::HighlightState;
} }


RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState); RectI ctrlRect = applyMargins(offset, mBounds.extent, currentState, mProfile);
RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, currentState); RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, currentState, mProfile);
RectI contentRect = applyPadding(fillRect.point, fillRect.extent, currentState); RectI contentRect = applyPadding(fillRect.point, fillRect.extent, currentState, mProfile);
RectI boxRect(contentRect.point + mBoxOffset, mBoxExtent); RectI boxRect(contentRect.point + mBoxOffset, mBoxExtent);


//Contrain the Box Rect. It must fit in the content Rect. //Contrain the Box Rect. It must fit in the content Rect.
Expand Down Expand Up @@ -134,7 +134,7 @@ void GuiCheckBoxCtrl::onRender(Point2I offset, const RectI &updateRect)


//Render Text //Render Text
dglSetBitmapModulation(mProfile->getFontColor(currentState)); dglSetBitmapModulation(mProfile->getFontColor(currentState));
renderJustifiedText(textRect.point, textRect.extent, mText); renderText(textRect.point, textRect.extent, mText, mProfile);


//Render the childen //Render the childen
renderChildControls(offset, contentRect, updateRect); renderChildControls(offset, contentRect, updateRect);
Expand Down
4 changes: 2 additions & 2 deletions engine/source/gui/containers/guiFormCtrl.cc
Expand Up @@ -243,7 +243,7 @@ void GuiFormCtrl::onRender(Point2I offset, const RectI &updateRect)
if(size() <= 1) if(size() <= 1)
{ {
dglSetBitmapModulation(ColorI(0,0,0)); dglSetBitmapModulation(ColorI(0,0,0));
renderJustifiedText(boundsRect.point, boundsRect.extent, "[none]"); renderText(boundsRect.point, boundsRect.extent, "[none]", mProfile);
} }


S32 textWidth = 0; S32 textWidth = 0;
Expand Down Expand Up @@ -286,7 +286,7 @@ void GuiFormCtrl::onRender(Point2I offset, const RectI &updateRect)
mProfile->mBitmapArrayRects[4]); mProfile->mBitmapArrayRects[4]);


dglSetBitmapModulation((mMouseOver ? mProfile->mFontColorHL : mProfile->mFontColor)); dglSetBitmapModulation((mMouseOver ? mProfile->mFontColorHL : mProfile->mFontColor));
renderJustifiedText(Point2I(mThumbSize.x, 0) + offset, Point2I(mBounds.extent.x - mThumbSize.x - mProfile->mBitmapArrayRects[4].extent.x, mThumbSize.y), (mUseSmallCaption ? mSmallCaption : mCaption) ); renderText(Point2I(mThumbSize.x, 0) + offset, Point2I(mBounds.extent.x - mThumbSize.x - mProfile->mBitmapArrayRects[4].extent.x, mThumbSize.y), (mUseSmallCaption ? mSmallCaption : mCaption), mProfile);


} }


Expand Down
2 changes: 1 addition & 1 deletion engine/source/gui/containers/guiRolloutCtrl.cc
Expand Up @@ -352,7 +352,7 @@ void GuiRolloutCtrl::onRender(Point2I offset, const RectI &updateRect)
dglGetBitmapModulation( &currColor ); dglGetBitmapModulation( &currColor );
Point2I textPosition = mHeader.point + offset + mProfile->mTextOffset; Point2I textPosition = mHeader.point + offset + mProfile->mTextOffset;
dglSetBitmapModulation( mProfile->mFontColor ); dglSetBitmapModulation( mProfile->mFontColor );
renderJustifiedText( textPosition, mHeader.extent, mCaption ); renderText( textPosition, mHeader.extent, mCaption, mProfile);
dglSetBitmapModulation( currColor ); dglSetBitmapModulation( currColor );


// If we're collapsed we contain the first child as our content // If we're collapsed we contain the first child as our content
Expand Down

0 comments on commit 50a3198

Please sign in to comment.