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); }
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; } } }
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); }
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(); } } }
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); }