OpendTect-6_4
6.4
|
Class to handle undo/redo information. More...
Public Member Functions | |
Undo () | |
virtual | ~Undo () |
void | removeAll () |
int | maxLength () const |
void | setMaxLength (int) |
int | addEvent (UndoEvent *event, const char *description=0) |
int | currentEventID () const |
int | firstEventID () const |
int | lastEventID () const |
void | removeAllAfterCurrentEvent () |
void | removeAllBeforeCurrentEvent () |
bool | isUserInteractionEnd (int eventid) const |
void | setUserInteractionEnd (int eventid, bool=true) |
int | getNextUserInteractionEnd (int start) const |
BufferString | getDesc (int eventid) const |
void | setDesc (int eventid, const char *d) |
BufferString | unDoDesc () const |
BufferString | reDoDesc () const |
bool | canUnDo () const |
bool | unDo (int nrtimes=1, bool userinteraction=true) |
bool | canReDo () const |
bool | reDo (int nrtimes=1, bool userinteraction=true) |
Public Member Functions inherited from CallBacker | |
CallBacker () | |
CallBacker (const CallBacker &) | |
virtual | ~CallBacker () |
bool | attachCB (NotifierAccess &, const CallBack &, bool onlyifnew=false) |
bool | attachCB (NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) |
void | detachCB (NotifierAccess &, const CallBack &) |
void | detachCB (NotifierAccess *notif, const CallBack &cb) |
bool | isNotifierAttached (NotifierAccess *) const |
Only for debugging purposes, don't use. More... | |
Public Attributes | |
Notifier< Undo > | changenotifier |
Notifier< Undo > | undoredochange |
Protected Member Functions | |
int | indexOf (int eventid) const |
void | removeOldEvents () |
void | removeStartToAndIncluding (int) |
Protected Member Functions inherited from CallBacker | |
void | detachAllNotifiers () |
Call from the destructor of your inherited object. More... | |
Protected Attributes | |
int | currenteventid_ |
int | firsteventid_ |
int | maxsize_ |
ObjectSet< UndoEvent > | events_ |
int | userendscount_ |
Threads::Lock | addlock_ |
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). |
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 for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019