Hi Werner, El mar, 02-05-2006 a las 23:32 +0200, Werner Hoch escribió: > Hi Carlos, > > here's another challenge: > > If you hit ESC after doing the first rotation, the rotation remains at > the original selection. > > Undo is possible, but its not what the user expects.
This is tricky, but I have it working. What I do is an undo_savestate in o_move_start, to save the current status. I disabled the undo_savestate inside o_rotate_90 if w_current->inside_action is 1 (we are inside moving, or copying actions). Then, if you hit ESC, i_callback_cancel calls o_undo_callback to restore the previous state. Now, I'm having some troubles with o_copy_end. I do an undo_savestate in o_copy_start, as I want to do it the same way. o_copy_end copies the object and adds it to w_current one by one. What I want to do is: 1. Copy the objects to a new list. 2. Do an o_undo_callback to restore the previous state (as the user can rotate the selection, the original buffer can be also rotated). 3. Add the objects from the step 1. I changed the call the object list parameter when calling to o_*_copy by a new list, like the example below: Original: new_object = (OBJECT *) o_net_copy(w_current, w_current->page_current-> object_tail, + new_objects_list, object); New: OBJECT *new_object_list = NULL; new_object = (OBJECT *) o_net_copy(w_current, new_objects_list, object); And after the loops, I added the new list to w_current: s_basic_link_object (new_objects_list, w_current->page_current->object_tail); This doesn't seem to work... I should have missed something more... FYI, I'm also giving a try to the multiple copy command. Regards, Carlos