MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / selectParents

Method selectParents

Engine/source/gui/editor/guiEditCtrl.cpp:1708–1736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1706//-----------------------------------------------------------------------------
1707
1708void GuiEditCtrl::selectParents( bool addToSelection )
1709{
1710 Vector< GuiControl* > parents;
1711
1712 // Collect all parents.
1713
1714 for( U32 i = 0; i < mSelectedControls.size(); ++ i )
1715 {
1716 GuiControl* ctrl = mSelectedControls[ i ];
1717 if( ctrl != mContentControl && ctrl->getParent() != mContentControl )
1718 parents.push_back( mSelectedControls[ i ]->getParent() );
1719 }
1720
1721 // If there's no parents to select, don't
1722 // change the selection.
1723
1724 if( parents.empty() )
1725 return;
1726
1727 // Blast selection if need be.
1728
1729 if( !addToSelection )
1730 clearSelection();
1731
1732 // Add the parents.
1733
1734 for( U32 i = 0; i < parents.size(); ++ i )
1735 addSelection( parents[ i ] );
1736}
1737
1738//-----------------------------------------------------------------------------
1739

Callers 1

guiEditCtrl.cppFile · 0.80

Calls 4

sizeMethod · 0.45
getParentMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected