Click here to Skip to main content
15,886,137 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to Undo/Redo drawing operation in a dialog based application.? Pin
mbatra319-Jul-12 1:55
mbatra319-Jul-12 1:55 
AnswerRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
Chris Losinger9-Jul-12 2:20
professionalChris Losinger9-Jul-12 2:20 
GeneralRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
mbatra319-Jul-12 2:32
mbatra319-Jul-12 2:32 
GeneralRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
Chris Losinger9-Jul-12 3:14
professionalChris Losinger9-Jul-12 3:14 
GeneralRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
Maximilien9-Jul-12 3:18
Maximilien9-Jul-12 3:18 
AnswerRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
CPallini9-Jul-12 2:20
mveCPallini9-Jul-12 2:20 
GeneralRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
mbatra319-Jul-12 2:33
mbatra319-Jul-12 2:33 
AnswerRe: How to Undo/Redo drawing operation in a dialog based application.? Pin
Sunil P V10-Jul-12 0:01
Sunil P V10-Jul-12 0:01 
Well Undo/Redo can be handled in an easier and simpler way. There are complex ways of achieving it like double buffering etc but they seem to work exceptionally well in OpenGL. For simple MFC applications you can follow a simple approach.

Create a (master)list class that stores the objects to be drawn. As and when you create a new object add it to this list. Maintain another Undo and Redo list.
When the user hits on Undo option pop(remove) the last object added from the master list class add this object to your Undo list class. After this re-draw your dialog.
When the user hits on Redo option pop(remove) the last object added from the Undo list class add this object to your Master list class. After this re-draw your dialog.
Sunil

Generalneed help Opencv with MFC (Solved) Pin
jawadali4779-Jul-12 0:44
jawadali4779-Jul-12 0:44 
GeneralRe: need help Opencv with MFC Pin
CPallini9-Jul-12 0:57
mveCPallini9-Jul-12 0:57 
GeneralRe: need help Opencv with MFC Pin
jawadali4779-Jul-12 1:17
jawadali4779-Jul-12 1:17 
GeneralRe: need help Opencv with MFC Pin
Richard MacCutchan9-Jul-12 1:30
mveRichard MacCutchan9-Jul-12 1:30 
GeneralRe: need help Opencv with MFC Pin
jawadali4779-Jul-12 1:59
jawadali4779-Jul-12 1:59 
GeneralRe: need help Opencv with MFC Pin
Jochen Arndt9-Jul-12 1:03
professionalJochen Arndt9-Jul-12 1:03 
GeneralGeneral driver help Pin
Brandon-X120009-Jul-12 0:28
Brandon-X120009-Jul-12 0:28 
GeneralRe: General driver help Pin
Richard MacCutchan9-Jul-12 1:23
mveRichard MacCutchan9-Jul-12 1:23 
GeneralRe: General driver help Pin
Brandon-X1200010-Jul-12 6:55
Brandon-X1200010-Jul-12 6:55 
GeneralRe: General driver help Pin
Richard MacCutchan10-Jul-12 9:04
mveRichard MacCutchan10-Jul-12 9:04 
GeneralRe: General driver help Pin
WebMaster9-Jul-12 3:04
WebMaster9-Jul-12 3:04 
GeneralRe: General driver help Pin
Brandon-X1200010-Jul-12 9:14
Brandon-X1200010-Jul-12 9:14 
GeneralRe: General driver help Pin
WebMaster10-Jul-12 9:08
WebMaster10-Jul-12 9:08 
GeneralRe: General driver help Pin
Brandon-X1200010-Jul-12 9:13
Brandon-X1200010-Jul-12 9:13 
GeneralDifference Between 'Software Architecture' and 'Software Design' Pin
AmbiguousName9-Jul-12 0:06
AmbiguousName9-Jul-12 0:06 
GeneralRe: Difference Between 'Software Architecture' and 'Software Design' Pin
CPallini9-Jul-12 0:59
mveCPallini9-Jul-12 0:59 
GeneralRe: Difference Between 'Software Architecture' and 'Software Design' Pin
Stefan_Lang10-Jul-12 22:47
Stefan_Lang10-Jul-12 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.