本文整理汇总了C++中MaterialDoc::MoveStage方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialDoc::MoveStage方法的具体用法?C++ MaterialDoc::MoveStage怎么用?C++ MaterialDoc::MoveStage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaterialDoc
的用法示例。
在下文中一共展示了MaterialDoc::MoveStage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DropItemOnList
/**
* Performs the stage move when the user has dragged and dropped a stage.
*/
void StageView::DropItemOnList() {
CListCtrl& list = GetListCtrl();
int toStage;
//Get and adjust the drop index based on the direction of the move
dropIndex = list.HitTest(dropPoint);
if(dropIndex < 0) dropIndex = list.GetItemCount()-1;
//Ignore the drop if the index is the same or they are droping on the material
if(dropIndex == dragIndex || dropIndex == 0)
return;
//Move the stage data
MaterialDoc* material = materialDocManager->GetCurrentMaterialDoc();
internalChange = true;
toStage = dropIndex-1;
material->MoveStage(dragIndex-1, dropIndex-1);
internalChange = false;
if(dragIndex < dropIndex) {
dropIndex++;
}
//Get the item
char szLabel[256];
LV_ITEM lvi;
ZeroMemory(&lvi, sizeof(LV_ITEM));
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE | LVIF_PARAM;
lvi.stateMask = LVIS_DROPHILITED | LVIS_FOCUSED | LVIS_SELECTED;
lvi.pszText = szLabel;
lvi.iItem = dragIndex;
lvi.cchTextMax = 255;
list.GetItem(&lvi);
//Insert the item
lvi.iItem = dropIndex;
list.InsertItem(&lvi);
//Adjust the drag index if the move was up in the list
if(dragIndex > dropIndex) {
dragIndex++;
}
//Delete the original item
list.DeleteItem(dragIndex);
int type = -1;
int stageType = currentMaterial->GetAttributeInt(toStage, "stagetype");
switch(stageType) {
case MaterialDoc::STAGE_TYPE_NORMAL:
type = MaterialDefManager::MATERIAL_DEF_STAGE;
break;
case MaterialDoc::STAGE_TYPE_SPECIALMAP:
type = MaterialDefManager::MATERIAL_DEF_SPECIAL_STAGE;
break;
}
m_propView->SetPropertyListType(type, toStage);
}
示例2: Redo
/**
* Performs a redo operation of a moved stage.
*/
void StageMoveModifier::Redo()
{
MaterialDoc *material = manager->CreateMaterialDoc(materialName);
material->MoveStage(from, to, false);
}