Thread: Request: Undo
View Single Post
  #6  
Old 09-14-2005, 06:33 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by calani
and set cursor positon
possibly also setfocus? (as long as it doesn't set the main graal window focus -.-)

and as for the undo's.. it wouldn't be that hard.
just make a small log of everything that's changed
so to undo/redo, all you need to do is parse the next entry in the log.
the format would be simple enough
(action) (row) (col) [to (row) (col)] (data)
ex. "replace 5 0 to 6 4 hello\nworld\n"
or "delete 5 0 "hello\nworld\n"

the same would go for single line text edit boxes. the only difference is keeping track of the rows wouldn't be necessary
I am not sure about your method (you would most likely get a lot of memory being wasted), but I do agree that having undo in GUI controls is a good idea.
__________________
Skyld