TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::UndoHistory Class Reference

The app's undo history: steps that each undo and redo one change. More...

#include <gui_core/input/gui_undo_history.h>

Classes

struct  Step

Public Member Functions

void Push (Step step)
 Adds a step after the current one, dropping any undone steps (or merges it into the last step, see Step::mergeKey).
void EndMerge ()
 The next push starts a step of its own (e.g. when a field loses the focus).
bool CanUndo () const
bool CanRedo () const
void Undo ()
 The step's callback runs from a copy, after the history has moved: it may push, clear or undo / redo again, and carries on with what it captured.
void Redo ()
 As Undo, the other way.
size_t UndoCount () const
size_t RedoCount () const
std::string_view UndoDescription () const
std::string_view RedoDescription () const
void Clear ()
 Drops every step (see Step::drop).

Detailed Description

The app's undo history: steps that each undo and redo one change.

Text fields push their committed edits here, and so can the app's own editors; Undo / Redo walk it.

Member Function Documentation

◆ Push()

void tachyon::UndoHistory::Push ( Step step)
inline

Adds a step after the current one, dropping any undone steps (or merges it into the last step, see Step::mergeKey).

Does not run it.

◆ EndMerge()

void tachyon::UndoHistory::EndMerge ( )
inline

The next push starts a step of its own (e.g. when a field loses the focus).

◆ CanUndo()

bool tachyon::UndoHistory::CanUndo ( ) const
inline

◆ CanRedo()

bool tachyon::UndoHistory::CanRedo ( ) const
inline

◆ Undo()

void tachyon::UndoHistory::Undo ( )
inline

The step's callback runs from a copy, after the history has moved: it may push, clear or undo / redo again, and carries on with what it captured.

◆ Redo()

void tachyon::UndoHistory::Redo ( )
inline

As Undo, the other way.

◆ UndoCount()

size_t tachyon::UndoHistory::UndoCount ( ) const
inline

◆ RedoCount()

size_t tachyon::UndoHistory::RedoCount ( ) const
inline

◆ UndoDescription()

std::string_view tachyon::UndoHistory::UndoDescription ( ) const
inline

◆ RedoDescription()

std::string_view tachyon::UndoHistory::RedoDescription ( ) const
inline

◆ Clear()

void tachyon::UndoHistory::Clear ( )
inline

Drops every step (see Step::drop).

Destroying the history runs no drops: Clear it first, while what they give back to is still there.


The documentation for this class was generated from the following file: