![]() |
OpendTect
7.0
|
Class to handle undo/redo information. More...
Public Member Functions | |
Undo () | |
virtual | ~Undo () |
int | addEvent (UndoEvent *event, const char *description=0) |
bool | canReDo () const |
bool | canUnDo () const |
int | currentEventID () const |
int | firstEventID () const |
BufferString | getDesc (int eventid) const |
int | getNextUserInteractionEnd (int start) const |
bool | isUserInteractionEnd (int eventid) const |
int | lastEventID () const |
int | maxLength () const |
bool | reDo (int nrtimes=1, bool userinteraction=true) |
BufferString | reDoDesc () const |
void | removeAll () |
void | removeAllAfterCurrentEvent () |
void | removeAllBeforeCurrentEvent () |
void | setDesc (int eventid, const char *d) |
void | setMaxLength (int) |
void | setUserInteractionEnd (int eventid, bool=true) |
bool | unDo (int nrtimes=1, bool userinteraction=true) |
BufferString | unDoDesc () const |
![]() | |
CallBacker () | |
CallBacker (const CallBacker &) | |
virtual | ~CallBacker () |
bool | attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const |
bool | attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const |
void | detachAllNotifiers () const |
Call from the destructor of your inherited object. More... | |
void | detachCB (const NotifierAccess &, const CallBack &) const |
void | detachCB (const NotifierAccess *notif, const CallBack &cb) const |
virtual bool | isCapsule () const |
bool | isNotifierAttached (const NotifierAccess *) const |
Only for debugging purposes, don't use. More... | |
void | stopReceivingNotifications () const |
virtual CallBacker * | trueCaller () |
Public Attributes | |
Notifier< Undo > | changenotifier |
Notifier< Undo > | undoredochange |
Protected Member Functions | |
int | indexOf (int eventid) const |
void | removeOldEvents () |
void | removeStartToAndIncluding (int) |
Protected Attributes | |
Threads::Lock | addlock_ |
int | currenteventid_ |
ObjectSet< UndoEvent > | events_ |
int | firsteventid_ |
int | maxsize_ |
int | userendscount_ |
Additional Inherited Members | |
![]() | |
static void | createReceiverForCurrentThread () |
static void | removeReceiverForCurrentThread () |
Class to handle undo/redo information.
Events that can be undone/redone are added to the Undo. One user operation may involve thousands of changes added to the history, but the user does not want to press undo a thousand times.This is managed by setting a UserInteractionEnd flag on the last event in a chain that the user started. When doing undo, one undo step is consists of all events from the current event until the next event with the UserInteraction flag set.
This means that after all user-driven events, the UserInteractionEnd should be set:
<>
Undo::Undo | ( | ) |
|
virtual |
int Undo::addEvent | ( | UndoEvent * | event, |
const char * | description = 0 |
||
) |
event | The new event (becomes mine). |
description |
bool Undo::canReDo | ( | ) | const |
bool Undo::canUnDo | ( | ) | const |
int Undo::currentEventID | ( | ) | const |
int Undo::firstEventID | ( | ) | const |
BufferString Undo::getDesc | ( | int | eventid | ) | const |
int Undo::getNextUserInteractionEnd | ( | int | start | ) | const |
|
protected |
bool Undo::isUserInteractionEnd | ( | int | eventid | ) | const |
int Undo::lastEventID | ( | ) | const |
int Undo::maxLength | ( | ) | const |
Returns maximum number of userevents.
bool Undo::reDo | ( | int | nrtimes = 1 , |
bool | userinteraction = true |
||
) |
BufferString Undo::reDoDesc | ( | ) | const |
void Undo::removeAll | ( | ) |
void Undo::removeAllAfterCurrentEvent | ( | ) |
void Undo::removeAllBeforeCurrentEvent | ( | ) |
|
protected |
|
protected |
void Undo::setDesc | ( | int | eventid, |
const char * | d | ||
) |
void Undo::setMaxLength | ( | int | ) |
void Undo::setUserInteractionEnd | ( | int | eventid, |
bool | = true |
||
) |
bool Undo::unDo | ( | int | nrtimes = 1 , |
bool | userinteraction = true |
||
) |
BufferString Undo::unDoDesc | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Generated at 02/08/2024 10:20:07 for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024