本文整理汇总了C++中UndoManager::ClearStates方法的典型用法代码示例。如果您正苦于以下问题:C++ UndoManager::ClearStates方法的具体用法?C++ UndoManager::ClearStates怎么用?C++ UndoManager::ClearStates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UndoManager
的用法示例。
在下文中一共展示了UndoManager::ClearStates方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnApplyToFiles
//.........这里部分代码省略.........
if (dlog.ShowModal() != wxID_OK) {
return;
}
wxArrayString files;
dlog.GetPaths(files);
files.Sort();
wxDialog * pD = safenew wxDialog(this, wxID_ANY, GetTitle());
pD->SetName(pD->GetTitle());
ShuttleGui S(pD, eIsCreating);
S.StartVerticalLay(false);
{
S.StartStatic(_("Applying..."), 1);
{
wxImageList *imageList = new wxImageList(9, 16);
imageList->Add(wxIcon(empty9x16_xpm));
imageList->Add(wxIcon(arrow_xpm));
S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES |
wxLC_SINGLE_SEL);
mList = S.Id(CommandsListID).AddListControlReportMode();
mList->AssignImageList(imageList, wxIMAGE_LIST_SMALL);
mList->InsertColumn(0, _("File"), wxLIST_FORMAT_LEFT);
}
S.EndStatic();
S.StartHorizontalLay(wxCENTER, false);
{
S.Id(wxID_CANCEL).AddButton(_("&Cancel"));
}
S.EndHorizontalLay();
}
S.EndVerticalLay();
int i;
for (i = 0; i < (int)files.GetCount(); i++ ) {
mList->InsertItem(i, files[i], i == 0);
}
// Set the column size for the files list.
mList->SetColumnWidth(0, wxLIST_AUTOSIZE);
int width = mList->GetColumnWidth(0);
wxSize sz = mList->GetClientSize();
if (width > sz.GetWidth() && width < 500) {
sz.SetWidth(width);
mList->SetInitialSize(sz);
}
pD->Layout();
pD->Fit();
pD->SetSizeHints(pD->GetSize());
pD->CenterOnScreen();
pD->Move(-1, 0);
pD->Show();
Hide();
mBatchCommands.ReadChain(name);
for (i = 0; i < (int)files.GetCount(); i++) {
wxWindowDisabler wd(pD);
if (i > 0) {
//Clear the arrow in previous item.
mList->SetItemImage(i - 1, 0, 0);
}
mList->SetItemImage(i, 1, 1);
mList->EnsureVisible(i);
project->Import(files[i]);
project->OnSelectAll();
if (!mBatchCommands.ApplyChain()) {
break;
}
if (!pD->IsShown() || mAbort) {
break;
}
UndoManager *um = project->GetUndoManager();
um->ClearStates();
project->OnSelectAll();
project->OnRemoveTracks();
}
project->OnRemoveTracks();
// Under Linux an EndModal() here crashes (Bug #1221).
// But sending a close message instead is OK.
#if !defined(__WXMAC__)
wxCloseEvent Evt;
Evt.SetId( wxID_OK );
Evt.SetEventObject( this);
ProcessWindowEvent( Evt );
#else
EndModal(wxID_OK);
#endif
// Raise myself again, and the parent window with me
Show();
}
示例2: OnApplyToFiles
//.........这里部分代码省略.........
return;
}
wxString path = gPrefs->Read(wxT("/DefaultOpenPath"), ::wxGetCwd());
wxString prompt = project->GetCleanSpeechMode() ?
_("Select vocal file(s) for batch CleanSpeech Chain...") :
_("Select file(s) for batch processing...");
wxString fileSelector = project->GetCleanSpeechMode() ?
_("Vocal files (*.wav;*.mp3)|*.wav;*.mp3|WAV files (*.wav)|*.wav|MP3 files (*.mp3)|*.mp3") :
_("All files (*.*)|*.*|WAV files (*.wav)|*.wav|AIFF files (*.aif)|*.aif|AU files (*.au)|*.au|MP3 files (*.mp3)|*.mp3|Ogg Vorbis files (*.ogg)|*.ogg|FLAC files (*.flac)|*.flac"
);
FileDialog dlog(this, prompt,
path, wxT(""), fileSelector,
wxFD_OPEN | wxFD_MULTIPLE | wxRESIZE_BORDER);
if (dlog.ShowModal() != wxID_OK) {
return;
}
wxArrayString files;
dlog.GetPaths(files);
files.Sort();
wxDialog d(this, wxID_ANY, GetTitle());
ShuttleGui S(&d, eIsCreating);
S.StartVerticalLay(false);
{
S.StartStatic(_("Applying..."), 1);
{
wxImageList *imageList = new wxImageList(9, 16);
imageList->Add(wxIcon(empty_9x16_xpm));
imageList->Add(wxIcon(arrow_xpm));
S.SetStyle(wxSUNKEN_BORDER | wxLC_REPORT | wxLC_HRULES | wxLC_VRULES |
wxLC_SINGLE_SEL);
mList = S.AddListControlReportMode();
mList->AssignImageList(imageList, wxIMAGE_LIST_SMALL);
mList->InsertColumn(0, _("File"), wxLIST_FORMAT_LEFT);
}
S.EndStatic();
S.StartHorizontalLay(wxCENTER, false);
{
S.Id(wxID_CANCEL).AddButton(_("&Cancel"));
}
S.EndHorizontalLay();
}
S.EndVerticalLay();
int i;
for (i = 0; i < (int)files.GetCount(); i++ ) {
mList->InsertItem(i, files[i], i == 0);
}
// Set the column size for the files list.
mList->SetColumnWidth(0, wxLIST_AUTOSIZE);
int width = mList->GetColumnWidth(0);
wxSize sz = mList->GetClientSize();
if (width > sz.GetWidth() && width < 500) {
sz.SetWidth(width);
mList->SetInitialSize(sz);
}
d.Layout();
d.Fit();
d.SetSizeHints(d.GetSize());
d.CenterOnScreen();
d.Move(-1, 0);
d.Show();
Hide();
mBatchCommands.ReadChain(name);
for (i = 0; i < (int)files.GetCount(); i++) {
wxWindowDisabler wd(&d);
if (i > 0) {
//Clear the arrow in previous item.
mList->SetItemImage(i - 1, 0, 0);
}
mList->SetItemImage(i, 1, 1);
mList->EnsureVisible(i);
project->OnRemoveTracks();
project->Import(files[i]);
project->OnSelectAll();
if (!mBatchCommands.ApplyChain()) {
break;
}
if (!d.IsShown() || mAbort) {
break;
}
UndoManager *um = project->GetUndoManager();
um->ClearStates();
}
project->OnRemoveTracks();
}