本文整理汇总了C++中MaterialDoc::SetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialDoc::SetAttribute方法的具体用法?C++ MaterialDoc::SetAttribute怎么用?C++ MaterialDoc::SetAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaterialDoc
的用法示例。
在下文中一共展示了MaterialDoc::SetAttribute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPropertyChangeNotification
/**
* Updated the material when an attribute has been changed.
*/
void MaterialPropTreeView::OnPropertyChangeNotification( NMHDR *nmhdr, LRESULT *lresult ) {
NMPROPTREE *nmProp = (NMPROPTREE *)nmhdr;
CPropTreeItem *item = nmProp->pItem;
internalChange = true;
MaterialDef* propItem = FindDefForTreeID(item->GetCtrlID());
if(propItem) {
MaterialDoc* materialDoc = materialDocManager->GetCurrentMaterialDoc();
switch(propItem->type) {
case MaterialDef::MATERIAL_DEF_TYPE_BOOL:
{
BOOL val = item->GetItemValue();
materialDoc->SetAttributeBool(currentStage, propItem->dictName, val ? true : false);
}
break;
case MaterialDef::MATERIAL_DEF_TYPE_STRING:
{
idStr val = (LPCTSTR)item->GetItemValue();
materialDoc->SetAttribute(currentStage, propItem->dictName, val);
}
break;
}
}
internalChange = false;
*lresult = 0;
}
示例2: OnLvnEndlabeledit
/**
* Performs the stage name change after the label edit is done.
*/
void StageView::OnLvnEndlabeledit( NMHDR *pNMHDR, LRESULT *pResult ) {
NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO *>( pNMHDR );
if( pDispInfo->item.pszText ) {
MaterialDoc *material = materialDocManager->GetCurrentMaterialDoc();
internalChange = true;
material->SetAttribute( pDispInfo->item.iItem - 1, "name", pDispInfo->item.pszText );
internalChange = false;
*pResult = 1;
} else {
*pResult = 0;
}
}
示例3: Redo
/**
* Performs a redo operation of a string attribute change.
*/
void AttributeMaterialModifierString::Redo()
{
MaterialDoc *material = manager->CreateMaterialDoc(materialName);
material->SetAttribute(stage, key, value, false);
}