本文整理汇总了C++中UndoManager::GetCurrentState方法的典型用法代码示例。如果您正苦于以下问题:C++ UndoManager::GetCurrentState方法的具体用法?C++ UndoManager::GetCurrentState怎么用?C++ UndoManager::GetCurrentState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UndoManager
的用法示例。
在下文中一共展示了UndoManager::GetCurrentState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyChain
// ApplyChain returns true on success, false otherwise.
// Any error reporting to the user has already been done.
bool BatchCommands::ApplyChain(const wxString & filename)
{
mFileName = filename;
unsigned int i;
bool res = true;
mAbort = false;
for (i = 0; i < mCommandChain.GetCount(); i++) {
if (!ApplyCommandInBatchMode(mCommandChain[i], mParamsChain[i]) || mAbort) {
res = false;
break;
}
}
mFileName.Empty();
AudacityProject *proj = GetActiveProject();
if (!res)
{
if(proj) {
// Chain failed or was cancelled; revert to the previous state
UndoManager *um = proj->GetUndoManager();
proj->SetStateTo(um->GetCurrentState());
}
return false;
}
// Chain was successfully applied; save the new project state
wxString longDesc, shortDesc;
wxString name = gPrefs->Read(wxT("/Batch/ActiveChain"), wxEmptyString);
if (name.IsEmpty())
{
longDesc = wxT("Applied batch chain");
shortDesc = wxT("Apply chain");
}
else
{
longDesc = wxString::Format(wxT("Applied batch chain '%s'"), name.c_str());
shortDesc = wxString::Format(wxT("Apply '%s'"), name.c_str());
}
if (!proj)
return false;
proj->PushState(longDesc, shortDesc);
return true;
}