void CopyPasteController::CopyControls(const HierarchyTreeController::SELECTEDCONTROLNODES& items)
{
	if (!items.size())
		return;
	
	Clear();

    // If at least one subcontrol is selected - block copy, see pls DF-2684.
    if (SubcontrolsSelected(items))
    {
        return;
    }

	for (HierarchyTreeController::SELECTEDCONTROLNODES::const_iterator iter = items.begin();
		 iter != items.end();
		 ++iter)
	{
		//HierarchyTreeNode* item = (*iter);
		const HierarchyTreeControlNode* control = (*iter);
		if (!control)
			continue;

		if (ControlIsChild(items, control))
			continue;
		
		this->items.push_back(control->CreateControlCopy(NULL));
	}
	if (this->items.size())
		copyType = CopyTypeControl;
}
示例#2
0
void CopyPasteController::CopyControls(const HierarchyTreeController::SELECTEDCONTROLNODES& items)
{
	if (!items.size())
		return;
	
	Clear();
	for (HierarchyTreeController::SELECTEDCONTROLNODES::const_iterator iter = items.begin();
		 iter != items.end();
		 ++iter)
	{
		//HierarchyTreeNode* item = (*iter);
		const HierarchyTreeControlNode* control = (*iter);
		if (!control)
			continue;

		if (ControlIsChild(items, control))
			continue;
		
		HierarchyTreeControlNode* copy = NULL;
		const HierarchyTreeAggregatorControlNode* aggregatorControl = dynamic_cast<const HierarchyTreeAggregatorControlNode*>(control);
		if (aggregatorControl)
			copy = new HierarchyTreeAggregatorControlNode(NULL, aggregatorControl);
		else
			copy = new HierarchyTreeControlNode(NULL, control);
		
		this->items.push_back(copy);
	}
	if (this->items.size())
		copyType = CopyTypeControl;
}
void PropertiesGridController::OnSelectedControlNodesChanged(const HierarchyTreeController::SELECTEDCONTROLNODES
                                                             &selectedNodes)
{
    if (selectedNodes.size() == 0)
    {
        HandleNothingSelected();
        return;
    }
    
    UpdatePropertiesForUIControlNodeList(selectedNodes);
}
void PropertiesGridController::UpdatePropertiesForUIControlNodeList(const HierarchyTreeController::SELECTEDCONTROLNODES
                                                                    &selectedNodes)
{
    if (selectedNodes.empty())
    {
        // Nothing is selected - this is OK too.
        // HandleNothingSelected(); TODO!!! IS THIS CORRECT???
        return;
    }

    this->activeNodes = selectedNodes;
    Logger::Debug("Current Active Nodes count: %i", selectedNodes.size());
    emit PropertiesGridUpdated();
}