void EntitiesGraph::UpdatePropertyPanel() { if(workingEntity) { RecreatePropertiesPanelForEntity(workingEntity); if(propertyControl->GetParent() && propertyControl->GetParent() != propertyPanel) { propertyControl->GetParent()->RemoveControl(propertyControl); } if(!propertyControl->GetParent()) { propertyPanel->AddControl(propertyControl); } RefreshProperties(); } else { if(propertyControl && propertyControl->GetParent()) { propertyPanel->RemoveControl(propertyControl); } } }
/** * Called when the material has changed but not applied. * @param pMaterial The selected material. */ void MaterialPropTreeView::MV_OnMaterialChange(MaterialDoc* pMaterial) { if(materialDocManager->GetCurrentMaterialDoc()) { idStr currentName = materialDocManager->GetCurrentMaterialDoc()->name; if(!internalChange && !pMaterial->name.Icmp(currentName)) { RefreshProperties(); } } }
/** * Initializes the list of properties based on the type (material, stage, special stage). * @param listType The type of list (material, stage, special stage) * @param stageNum The stage from which to get the attributes. */ void MaterialPropTreeView::SetPropertyListType(int listType, int stageNum) { currentListType = listType; currentStage = stageNum; m_Tree.DeleteAllItems(); //idList<MaterialProp_t*>* propList = NULL; MaterialDefList* propList = MaterialDefManager::GetMaterialDefs(currentListType); currentPropDefs = propList; if(!propList) return; CPropTreeItem* pCurrentGroup = NULL; CPropTreeItem* pCurrentNode = NULL; for(int i = 0; i < propList->Num(); i++) { switch((*propList)[i]->type) { case MaterialDef::MATERIAL_DEF_TYPE_GROUP: { pCurrentGroup = m_Tree.InsertItem(new CPropTreeItem()); pCurrentNode = pCurrentGroup; if(!registry.GetBool(va("Expand%d%s", currentListType, (*propList)[i]->displayName.c_str()))) pCurrentGroup->Expand(); } break; case MaterialDef::MATERIAL_DEF_TYPE_BOOL: { CPropTreeItemCheck* pCheck; pCheck = (CPropTreeItemCheck*)m_Tree.InsertItem(new CPropTreeItemCheck(), pCurrentGroup); pCheck->CreateCheckBox(); pCurrentNode = pCheck; } break; case MaterialDef::MATERIAL_DEF_TYPE_STRING: { //pCurrentNode = m_Tree.InsertItem(new CPropTreeItemEdit(), pCurrentGroup); pCurrentNode = m_Tree.InsertItem(new CPropTreeItemFileEdit(), pCurrentGroup); } break; } if(pCurrentNode) { (*propList)[i]->SetViewData(PROP_TREE_VIEW, pCurrentNode->GetCtrlID()); pCurrentNode->SetLabelText((*propList)[i]->displayName); pCurrentNode->SetInfoText((*propList)[i]->displayInfo); } } RefreshProperties(); }
int TrayNotifyDlg::Notify(int id, NMHDR* pnmh) { switch(pnmh->code) { case TVN_SELCHANGED: { NMTREEVIEW* pnmtv = (NMTREEVIEW*)pnmh; int idx = pnmtv->itemNew.lParam; if (idx) { RefreshProperties(_info[idx]); _selectedItem = pnmtv->itemNew.hItem; } else { /* SetDlgItemText(_hwnd, IDC_NOTIFY_TOOLTIP, NULL); SetDlgItemText(_hwnd, IDC_NOTIFY_TITLE, NULL); SetDlgItemText(_hwnd, IDC_NOTIFY_MODULE, NULL); */ CheckRadioButton(_hwnd, IDC_NOTIFY_SHOW, IDC_NOTIFY_AUTOHIDE, 0); } break;} } return 0; }