コード例 #1
0
void HierarchyTreeController::SelectControl(HierarchyTreeControlNode* control)
{
	if (activeControlNodes.find(control) != activeControlNodes.end())
		return;
	
	//add selection
	activeControlNodes.insert(control);
	UIControl* uiControl = control->GetUIObject();
	if (uiControl)
	{
		uiControl->SetDebugDraw(true);
		uiControl->SetDebugDrawColor(Color(1.f, 0, 0, 1.f));
	
		//YZ draw parent rect
		UIControl* parentUiControl = uiControl->GetParent();
		if (parentUiControl)
		{
			parentUiControl->SetDebugDrawColor(Color(0.55f, 0.55f, 0.55f, 1.f));
			parentUiControl->SetDebugDraw(true);
		}
	}
	
	emit AddSelectedControl(control);
	emit SelectedControlNodesChanged(activeControlNodes);
	UpdateSelection(control);
}
コード例 #2
0
void HintManager::OnAlphaAnimationDone(BaseObject * owner, void * userData, void * callerData)
{
    UIControl *hintControl = (UIControl *)userData;

    for(Vector<HintControl*>::iterator it = hints.begin(); it != hints.end(); ++it)
    {
        if((*it) == hintControl && hintControl)
        {
            if(hintControl->GetParent())
            {
                hintControl->GetParent()->RemoveControl(hintControl);
            }
            
            SafeRelease(hintControl);
            hints.erase(it);
            break;
        }
    }
}
コード例 #3
0
void HierarchyTreeController::UnselectControl(HierarchyTreeControlNode* control, bool emitSelectedControlNodesChanged)
{
	if (activeControlNodes.find(control) == activeControlNodes.end())
		return;
	
	//remove selection
	activeControlNodes.erase(control);
	UIControl* uiControl = control->GetUIObject();
	if (uiControl)
	{
		uiControl->SetDebugDraw(false);
		
		//YZ draw parent rect
		UIControl* parentToRemove = uiControl->GetParent();
		if (parentToRemove)
		{
			bool removeParentDraw = true;
			for (SELECTEDCONTROLNODES::iterator iter = activeControlNodes.begin(); iter != activeControlNodes.end(); ++iter)
			{
				HierarchyTreeControlNode* control = (*iter);
				UIControl* uiControl = control->GetUIObject();
				if (uiControl)
				{
					UIControl* parentUiControl = uiControl->GetParent();
					if (parentToRemove == uiControl ||
						parentToRemove == parentUiControl)
					{
						removeParentDraw = false;
						break;
					}
				}
			}
			if (removeParentDraw)
				parentToRemove->SetDebugDraw(false);
		}
	}
	emit RemoveSelectedControl(control);
	if (emitSelectedControlNodesChanged)
		emit SelectedControlNodesChanged(activeControlNodes);
}
コード例 #4
0
void ComboBox::Update(float32 timeElapsed)
{
    UIScreen *scr =  UIScreenManager::Instance()->GetScreen();
    if (list->GetParent() == scr) 
    {
        UIControl *f = UIControlSystem::Instance()->GetFocusedControl();
        bool isFocused = false;
        if (f == comboButton || f == list) 
        {
            isFocused = true;
        }
        else 
        {
            if (f && f->GetParent() && f->GetParent()->GetParent() == list)
            {
                isFocused = true;
            }
        }
        if (!isFocused) 
        {
            Cancel();
        }
    }
}
コード例 #5
0
void EditorBodyControl::LandscapeEditorStarted()
{
    RemoveControl(modificationPanel);
    savedModificatioMode = modificationPanel->IsModificationMode();
    
    UIControl *toolsPanel = currentLandscapeEditor->GetToolPanel();
    if(!toolsPanel->GetParent())
    {
        AddControl(toolsPanel);
    }
    
	Entity* sceneNode = FindLandscapeEntity(scene);
	if (sceneNode)
	{
		scene->SetSelection(sceneNode);
		SelectNodeAtTree(NULL);
		SelectNodeAtTree(sceneNode);
	}
    landscapeToolsSelection->Show();

	ArrowsNode* arrowsNode = GetArrowsNode(false);
	if (arrowsNode)
		arrowsNode->SetVisible(false);
}