-Toolkit::LayoutGroup::LayoutId LayoutGroup::Move( LayoutItem& target, LayoutItem& child )
-{
- // Remove child from the previous position
- for( auto iter = mImpl->mChildren.begin() ; iter != mImpl->mChildren.end() ; ++iter )
- {
- if( iter->child.Get() == &child )
- {
- mImpl->mChildren.erase( iter );
- break;
- }
- }
-
- // Find target position
- std::vector< Impl::ChildLayout >::iterator position;
- for( auto iter = mImpl->mChildren.begin(); iter != mImpl->mChildren.end(); ++iter )
- {
- if( iter->child.Get() == &target )
- {
- position = iter;
- break;
- }
- }
-
- Impl::ChildLayout childLayout;
- childLayout.layoutId = mImpl->mNextLayoutId++;
- childLayout.child = &child;
- mImpl->mChildren.insert( position, childLayout );
-
- RequestLayout();
-
- return childLayout.layoutId;
-}
-
-Toolkit::LayoutGroup::LayoutId LayoutGroup::MoveBack( LayoutItem& child )
-{
- // Remove child from the previous position
- for( auto iter = mImpl->mChildren.begin() ; iter != mImpl->mChildren.end() ; ++iter )
- {
- if( iter->child.Get() == &child )
- {
- mImpl->mChildren.erase( iter );
- break;
- }
- }
-
- Impl::ChildLayout childLayout;
- childLayout.layoutId = mImpl->mNextLayoutId++;
- childLayout.child = &child;
- mImpl->mChildren.emplace_back( childLayout );
-
- RequestLayout();
-
- return childLayout.layoutId;
-}
-