void PropertyGridContainerWidget::OnPropertiesGridUpdated() { if (PropertiesGridController::Instance()->GetActiveTreeNodesList().empty() == false) { // List of UI Controls is selected. BuildPropertiesGridList(); return; } // Build the Properties Grid based on the active control. const HierarchyTreeNode* activeTreeNode = PropertiesGridController::Instance()->GetActiveTreeNode(); if (activeTreeNode == NULL) { // Nothing is selected - cleanup the properties grid. CleanupPropertiesGrid(); return; } UIControl* activeControl = NULL; const HierarchyTreeControlNode* activeTreeControlNode = dynamic_cast<const HierarchyTreeControlNode*>(activeTreeNode); if (activeTreeControlNode) { activeControl = activeTreeControlNode->GetUIObject(); } BaseMetadata* metaData = GetActiveMetadata(activeTreeNode); BuildPropertiesGrid(activeControl, metaData, activeTreeNode->GetId()); }
void PropertyGridContainerWidget::BuildPropertiesGridList() { // Need to understand which Metadata we need. Since multiple controls of different // type might be selected, we are looking for the most common Metadata. const HierarchyTreeController::SELECTEDCONTROLNODES &activeNodes = PropertiesGridController::Instance()->GetActiveTreeNodesList(); BaseMetadata* metaData = GetActiveMetadata(activeNodes); METADATAPARAMSVECT params; for (HierarchyTreeController::SELECTEDCONTROLNODES::const_iterator iter = activeNodes.begin(); iter != activeNodes.end(); iter ++) { const HierarchyTreeControlNode* controlNode = *iter; BaseMetadataParams controlNodeParam(controlNode->GetId(), controlNode->GetUIObject()); params.push_back(controlNodeParam); } BuildPropertiesGrid(metaData, params); }
void PropertyGridContainerWidget::OnPropertiesGridUpdated() { if (PropertiesGridController::Instance()->GetActiveTreeNodesList().empty() == false) { // List of UI Controls is selected. BuildPropertiesGridList(); return; } // Build the Properties Grid based on the active control. const HierarchyTreeNode* activeTreeNode = PropertiesGridController::Instance()->GetActiveTreeNode(); DVASSERT(activeTreeNode); // This code is executed when Screen/Platform are selected. UIControl* activeControl = NULL; const HierarchyTreeControlNode* activeTreeControlNode = dynamic_cast<const HierarchyTreeControlNode*>(activeTreeNode); if (activeTreeControlNode) { activeControl = activeTreeControlNode->GetUIObject(); } BaseMetadata* metaData = GetActiveMetadata(activeTreeNode); BuildPropertiesGrid(activeControl, metaData, activeTreeNode->GetId()); }