Example #1
0
void WorkspacePanel::projectMaterialAdded(EventArgs& args)
{
	ProjectEventArgs pea = dynamic_cast<ProjectEventArgs&>(args);
	Project* project = pea.getProject();
	MaterialController* material = pea.getMaterial();

	wxTreeItemId projectId = mProjectIdMap[project];
	wxTreeItemId id = mTreeCtrl->AppendItem(projectId, material->getMaterial()->getName().c_str(), MATERIAL_IMAGE);
	mTreeCtrl->SelectItem(id, true);

	mMaterialIdMap[material] = id;

	subscribe(material);
}
Example #2
0
void PropertiesPanel::materialRemoved(EventArgs& args)
{
	// Consider: Should this method also attempt to remove all
	//           of the page associated with this Materials, Techniques,
	//           and Passes?

	ProjectEventArgs pea = dynamic_cast<ProjectEventArgs&>(args);
	MaterialController* mc = pea.getMaterial();

	MaterialPageIndexMap::iterator it = mMaterialPageIndexMap.find(mc);
	if(it != mMaterialPageIndexMap.end())
	{
		mPropertyGrid->RemovePage(mMaterialPageIndexMap[mc]);
		mMaterialPageIndexMap.erase(it);
	}
}