mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +00:00
Adds ability to set the split point of a guiSplitContainer
This commit is contained in:
parent
775ca57047
commit
2d1ee7c5a0
2 changed files with 25 additions and 0 deletions
|
|
@ -613,3 +613,25 @@ void GuiSplitContainer::onMouseDragged( const GuiEvent &event )
|
|||
solvePanelConstraints(newDragPos, firstPanel, secondPanel, clientRect);
|
||||
}
|
||||
}
|
||||
|
||||
void GuiSplitContainer::setSplitPoint(Point2I splitPoint)
|
||||
{
|
||||
GuiContainer *firstPanel = dynamic_cast<GuiContainer*>(at(0));
|
||||
GuiContainer *secondPanel = dynamic_cast<GuiContainer*>(at(1));
|
||||
|
||||
// This function will constrain the panels to their minExtents and update the mSplitPoint
|
||||
if (firstPanel && secondPanel)
|
||||
{
|
||||
RectI clientRect = getClientRect();
|
||||
|
||||
solvePanelConstraints(splitPoint, firstPanel, secondPanel, clientRect);
|
||||
|
||||
layoutControls(clientRect);
|
||||
}
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiSplitContainer, setSplitPoint, void, (Point2I splitPoint), ,
|
||||
"Set the positin of the split handler.")
|
||||
{
|
||||
object->setSplitPoint(splitPoint);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue