本文整理汇总了C++中History::last_undo方法的典型用法代码示例。如果您正苦于以下问题:C++ History::last_undo方法的具体用法?C++ History::last_undo怎么用?C++ History::last_undo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类History
的用法示例。
在下文中一共展示了History::last_undo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: document
void TestHistory::run_014b ()
{
{
Document document (Model::use (), 123456789UL, 'appl', 'gui ');
History <HistoryStoreMemory> history (document);
Root & root = document.root <Root> ();
root._a._int = 2LL;
root._a._float = 3.5;
auto tx = document.commit ();
history.add_undo_step (tx);
history.clear ();
flip_TEST (history.begin () == history.end ());
flip_TEST (history.last_undo () == history.end ());
flip_TEST (history.first_redo () == history.end ());
}
}
示例2: document
void TestUseCaseUndo::run_005 ()
{
Document document (Model::use (), 123456789UL, 'appl', 'gui ');
Song & song = document.root <Song> ();
Track & track = *song._tracks.emplace ();
Clip & clip1 = *track._clips.emplace (1.0, 1.0);
Clip & clip2 = *track._clips.emplace (5.0, 1.0);
track._clips.emplace (2.5, 2.0);
song._selection.emplace (clip1);
song._selection.emplace (clip2);
document.commit ();
document.push ();
History <HistoryStoreMemory> history (document);
clip1._position = 2.0;
document.commit ();
auto tx = document.squash ();
history.add_undo_step (tx);
clip1._position = 3.5;
document.commit ();
tx = document.squash ();
*history.last_undo () = tx;
bool ok_flag = history.execute_undo ();
flip_TEST (ok_flag);
flip_TEST (clip1._position == 1.0);
ok_flag = history.execute_redo ();
flip_TEST (ok_flag);
flip_TEST (clip1._position == 3.5);
}