本文整理汇总了C++中CFamiTrackerDoc::ClearPattern方法的典型用法代码示例。如果您正苦于以下问题:C++ CFamiTrackerDoc::ClearPattern方法的具体用法?C++ CFamiTrackerDoc::ClearPattern怎么用?C++ CFamiTrackerDoc::ClearPattern使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFamiTrackerDoc
的用法示例。
在下文中一共展示了CFamiTrackerDoc::ClearPattern方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Undo
void CFrameAction::Undo(CMainFrame *pMainFrm)
{
// Undo action
CFrameEditor *pFrameEditor = pMainFrm->GetFrameEditor();
CFamiTrackerView *pView = (CFamiTrackerView*)pMainFrm->GetActiveView();
CFamiTrackerDoc *pDocument = pView->GetDocument();
m_iRedoFramePos = pView->GetSelectedFrame();
m_iRedoChannelPos = pView->GetSelectedChannel();
pView->SelectFrame(m_iUndoFramePos);
pView->SelectChannel(m_iUndoChannelPos);
switch (m_iAction) {
case ACT_ADD:
pDocument->RemoveFrame(m_iUndoFramePos + 1);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_REMOVE:
pDocument->InsertFrame(m_iUndoFramePos);
RestoreFrame(pDocument);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_DUPLICATE:
pDocument->RemoveFrame(m_iUndoFramePos);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_DUPLICATE_PATTERNS:
for (unsigned int i = 0; i < pDocument->GetAvailableChannels(); ++i) {
pDocument->ClearPattern(m_iUndoFramePos + 1, i);
}
pDocument->RemoveFrame(m_iUndoFramePos + 1);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_CHANGE_COUNT:
pDocument->SetFrameCount(m_iUndoFrameCount);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_SET_PATTERN:
pDocument->SetPatternAtFrame(m_iUndoFramePos, m_iUndoChannelPos, m_iOldPattern);
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
pMainFrm->UpdateControls();
break;
case ACT_SET_PATTERN_ALL:
for (unsigned int i = 0; i < pDocument->GetAvailableChannels(); ++i) {
pDocument->SetPatternAtFrame(m_iUndoFramePos, i, m_iPatterns[i]);
}
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
break;
case ACT_CHANGE_PATTERN:
pDocument->SetPatternAtFrame(m_iUndoFramePos, m_iUndoChannelPos, m_iOldPattern);
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
break;
case ACT_CHANGE_PATTERN_ALL:
for (unsigned int i = 0; i < pDocument->GetAvailableChannels(); ++i) {
pDocument->SetPatternAtFrame(m_iUndoFramePos, i, m_iPatterns[i]);
}
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
break;
case ACT_MOVE_DOWN:
pDocument->MoveFrameUp(m_iUndoFramePos + 1);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_MOVE_UP:
pDocument->MoveFrameDown(m_iUndoFramePos - 1);
pDocument->UpdateAllViews(NULL, CHANGED_FRAMES);
break;
case ACT_PASTE:
RestoreFrame(pDocument);
pDocument->UpdateAllViews(NULL, CHANGED_PATTERN);
break;
}
pView->SelectFrame(m_iUndoFramePos);
pView->SelectChannel(m_iUndoChannelPos);
}