| 1047 | //----------------------------------------------------------------------------- |
| 1048 | |
| 1049 | void GuiEditCtrl::moveSelectionToCtrl( GuiControl *newParent, bool callback ) |
| 1050 | { |
| 1051 | for( U32 i = 0; i < mSelectedControls.size(); ++ i ) |
| 1052 | { |
| 1053 | GuiControl* ctrl = mSelectedControls[i]; |
| 1054 | if( ctrl->getParent() == newParent |
| 1055 | || ctrl->isLocked() |
| 1056 | || selectionContainsParentOf( ctrl ) ) |
| 1057 | continue; |
| 1058 | |
| 1059 | Point2I globalpos = ctrl->localToGlobalCoord(Point2I(0,0)); |
| 1060 | newParent->addObject(ctrl); |
| 1061 | Point2I newpos = ctrl->globalToLocalCoord(globalpos) + ctrl->getPosition(); |
| 1062 | ctrl->setPosition(newpos); |
| 1063 | } |
| 1064 | |
| 1065 | onHierarchyChanged_callback(); |
| 1066 | |
| 1067 | //TODO: undo |
| 1068 | } |
| 1069 | |
| 1070 | //----------------------------------------------------------------------------- |
| 1071 |
nothing calls this directly
no test coverage detected