MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / init

Method init

Engine/source/gui/containers/guiFrameCtrl.cpp:570–619  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

568
569//-----------------------------------------------------------------------------
570bool GuiFrameSetCtrl::init(U32 columns, U32 rows, const U32 columnOffsets[], const U32 rowOffsets[])
571{
572 if (columns != 0 && rows != 0)
573 {
574 mColumnOffsets.clear();
575 mRowOffsets.clear();
576 U32 i;
577 for (i = 0; i < columns; i++)
578 {
579 if (columnOffsets == NULL)
580 mColumnOffsets.push_back(0);
581 else
582 {
583 AssertFatal(columnOffsets != NULL, "GuiFrameSetCtrl::init: NULL column offsets");
584 mColumnOffsets.push_back((U32)columnOffsets[i]);
585 if (i > 0)
586 {
587 AssertFatal(mColumnOffsets[i - 1] < mColumnOffsets[i], "GuiFrameSetCtrl::init: column offsets must be monotonically increasing");
588 mColumnOffsets.clear();
589 return(false);
590 }
591 }
592 }
593 for (i = 0; i < rows; i++)
594 {
595 if (rowOffsets == NULL)
596 mRowOffsets.push_back(0);
597 else
598 {
599 AssertFatal(rowOffsets != NULL, "GuiFrameSetCtrl::init: NULL row offsets");
600 mRowOffsets.push_back((U32)rowOffsets[i]);
601 if (i > 0)
602 {
603 AssertFatal(mRowOffsets[i - 1] < mRowOffsets[i], "GuiFrameSetCtrl::init: row offsets must be monotonically increasing");
604 mRowOffsets.clear();
605 return(false);
606 }
607 }
608 }
609 }
610 mFramesetDetails.mBorderWidth = DEFAULT_BORDER_WIDTH;
611 mFramesetDetails.mBorderEnable = FRAME_STATE_AUTO;
612 mFramesetDetails.mBorderMovable = FRAME_STATE_AUTO;
613 mAutoBalance = false;
614 mFudgeFactor = 0;
615 mCurHitRegion = NONE;
616 mCurVerticalHit = NO_HIT;
617 mCurHorizontalHit = NO_HIT;
618 return(true);
619}
620
621//-----------------------------------------------------------------------------
622// point is assumed to already be in local coordinates.

Callers 1

onRenderMethod · 0.45

Calls 2

clearMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected