本文整理汇总了C++中UIControl::Clone方法的典型用法代码示例。如果您正苦于以下问题:C++ UIControl::Clone方法的具体用法?C++ UIControl::Clone怎么用?C++ UIControl::Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIControl
的用法示例。
在下文中一共展示了UIControl::Clone方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateChilds
void HierarchyTreeAggregatorNode::UpdateChilds()
{
for (CHILDS::iterator iter = childs.begin(); iter != childs.end(); ++iter)
{
HierarchyTreeControlNode* controlNode = (*iter);
UIAggregatorControl* aggregatorControl = dynamic_cast<UIAggregatorControl*>(controlNode->GetUIObject());
DVASSERT(aggregatorControl);
if (!aggregatorControl)
continue;
// Remove any child controls of UIControl to prevent appearance of deleted
// child in case when screen child is aggregator.
/*List<UIControl*> aggregatorChilds = aggregatorControl->GetChildren();
int size = GetScreen()->GetChildren().size();
for (List<UIControl*>::iterator iter = aggregatorChilds.begin(); iter != aggregatorChilds.end();)
{
if (--size < 0)
break;
UIControl* child = (*iter);
++iter;
aggregatorControl->RemoveControl(child);
}*/
aggregatorControl->RemoveAllControls();
const List<UIControl*> & childsList = screen->GetChildren();
UIControl* belowControl = NULL;
List<UIControl*>::const_iterator belowIter = aggregatorControl->GetChildren().begin();
if (belowIter != aggregatorControl->GetChildren().end())
belowControl = (*belowIter);
for (List<UIControl*>::const_iterator iter = childsList.begin(); iter != childsList.end(); ++iter)
{
UIControl* control = (*iter);
UIControl* newControl = control->Clone();
aggregatorControl->InsertChildBelow(newControl, belowControl);
aggregatorControl->AddAggregatorChild(newControl);
}
//aggregatorControl->SetSize(screen->GetSize()); TODO:// update child size
aggregatorControl->SetRect(aggregatorControl->GetRect()); //update childs size and position
}
}