HierarchyTreeControlNode::HierarchyTreeControlNode(HierarchyTreeNode* parent, const HierarchyTreeControlNode* node): HierarchyTreeNode(node) { this->parent = parent; this->uiObject = node->GetUIObject()->Clone(); this->needReleaseUIObjects = false; // Remove real children & subcontrols - each control is responsible for its // subcontrols by itself. const List<UIControl* > &realChildren = GetUIObject()->GetRealChildrenAndSubcontrols(); for (List<UIControl* >::const_iterator iter = realChildren.begin(); iter != realChildren.end(); ++iter) { GetUIObject()->RemoveControl(*iter); } AddControlToParent(); const HierarchyTreeNode::HIERARCHYTREENODESLIST& child = node->GetChildNodes(); for (HierarchyTreeNode::HIERARCHYTREENODESLIST::const_iterator iter = child.begin(); iter != child.end(); ++iter) { const HierarchyTreeControlNode* controlNode = dynamic_cast<const HierarchyTreeControlNode*>((*iter)); if (!controlNode) continue; AddTreeNode(new HierarchyTreeControlNode(this, controlNode)); } }
HierarchyTreeControlNode::HierarchyTreeControlNode(HierarchyTreeNode* parent, const HierarchyTreeControlNode* node): HierarchyTreeNode(node), listDelegate(NULL) { this->parent = parent; this->uiObject = node->GetUIObject()->Clone(); this->needReleaseUIObjects = false; // All UIList controls should always have a delegate // We set a delegate here to avoid inappropriate loading of saved list UIList *list = dynamic_cast<UIList*>(this->uiObject); UIList *srcList = dynamic_cast<UIList*>(node->GetUIObject()); if (list) { listDelegate = new EditorListDelegate(list->GetRect(), list->GetOrientation()); EditorListDelegate *srcListDelegate = dynamic_cast<EditorListDelegate*>(srcList->GetDelegate()); if (srcListDelegate) { listDelegate->SetAggregatorID(srcListDelegate->GetAggregatorID()); } list->SetDelegate(listDelegate); } // Remove real children & subcontrols - each control is responsible for its // subcontrols by itself. const List<UIControl* > &realChildren = GetUIObject()->GetRealChildren(); for (List<UIControl* >::const_iterator iter = realChildren.begin(); iter != realChildren.end(); ++iter) { GetUIObject()->RemoveControl(*iter); } AddControlToParent(); const HierarchyTreeNode::HIERARCHYTREENODESLIST& child = node->GetChildNodes(); for (HierarchyTreeNode::HIERARCHYTREENODESLIST::const_iterator iter = child.begin(); iter != child.end(); ++iter) { const HierarchyTreeControlNode* controlNode = dynamic_cast<const HierarchyTreeControlNode*>((*iter)); if (!controlNode) continue; AddTreeNode(controlNode->CreateControlCopy(parent ? this : NULL)); } }
void HierarchyTreeControlNode::UpdateUIObject() { // UIWebView contains the interal system object, // which has to be repositioned while screen scale/position is changed. UIWebView* webView = dynamic_cast<UIWebView*>(GetUIObject()); if (!webView) { return; } webView->SetRect(webView->GetRect(true), true); }