void WorkspacePanel::materialNameChanged(EventArgs& args) { MaterialEventArgs mea = dynamic_cast<MaterialEventArgs&>(args); MaterialController* mc = mea.getMaterialController(); wxTreeItemId materialId = mMaterialIdMap[mc]; mTreeCtrl->SetItemText(materialId, mc->getMaterial()->getName().c_str()); }
void WorkspacePanel::materialTechniqueAdded(EventArgs& args) { MaterialEventArgs mea = dynamic_cast<MaterialEventArgs&>(args); MaterialController* mc = mea.getMaterialController(); TechniqueController* tc = mea.getTechniqueController(); wxTreeItemId materialId = mMaterialIdMap[mc]; wxTreeItemId id = mTreeCtrl->AppendItem(materialId, tc->getTechnique()->getName().c_str(), TECHNIQUE_IMAGE); mTreeCtrl->SelectItem(id, true); mTechniqueIdMap[tc] = id; subscribe(tc); }
void PropertiesPanel::techniqueRemoved(EventArgs& args) { // Consider: Should this method also attempt to remove all // of the page associated with this Techniques, Passes? MaterialEventArgs mea = dynamic_cast<MaterialEventArgs&>(args); TechniqueController* tc = mea.getTechniqueController(); TechniquePageIndexMap::iterator it = mTechniquePageIndexMap.find(tc); if(it != mTechniquePageIndexMap.end()) { mPropertyGrid->RemovePage(mTechniquePageIndexMap[tc]); mTechniquePageIndexMap.erase(it); } }