Crainiate Community

Support and discussion for users of Crainiate component software products
Welcome to Crainiate Community Sign in | Join | Help
in Search

Undo question?

Last post 11-12-2007 5:44 PM by James Westgate. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 07-31-2007 11:38 AM

    Undo question?

    In the Editor Example ,if I Sellect All object on the model ,and I delete all.

    If I click the Undo menuitem,  there is just one object undelete . How could I undelete all? 

    The UnDo function seems only work on a object (element) once a time.

    How could I fix it ? 

    Thanks . 

    • 218.170.230.122
  • 08-01-2007 2:49 AM In reply to

    Re: Undo question?

    By the way... 

    In the sample "Editor Example" and "Diagram Studio" the Redo do nothing.

    How could I fix it ? 

    If I copy a Element , and I delete some element else . The Paste do nothing .

    How could I fix it?

    Thank you. 

    • 218.170.230.122
  • 10-26-2007 3:31 AM In reply to

    Re: Undo question?

    Hello ,would you mind review this issue again ? I still have some strange problems with undo and redo .

    The redo not always work fine. The undo can work with one element once a time. If I change more than one element ,how could I undo that by a "batch".

     

    Thanks. 

    • 211.72.233.9
  • 10-29-2007 3:06 PM In reply to

    Re: Undo question?

    If afraid this is a limitation of the undo/redo system in version 4.0. It cannot seperate undo/redo tasks by "command' only at the "element" level. This is something we will address in version 5.0.

    You could write your own undo/redo system by serialising the model after each command you create and reserialising on undo/redo, but this would involve a bit of work on your part.

     

    Filed under: ,
    • 81.156.199.203
  • 11-02-2007 5:03 AM In reply to

    Re: Undo question?

    I have heard the answer I feel very helpless, The lack of this feature, users certainly unacceptable.

    And my project very tight timetable, with great pressure, and if so it will fail.

     

    If I write my own undo/redo system by serialising the model after each command. How about the movement of elements?

    If you can provide first beta test version, or a more detailed approach may, I will be very grateful.
    • 211.72.233.9
  • 11-12-2007 5:44 PM In reply to

    Re: Undo question?

    My suggestion here is to serialise the entire model after every action using a stream. This is the only way to implement your own undo/redo system without access to the source code.

    This can be done by calling Diagram.Save/Load with a stream (you can used a compressed stream in .net 2.0)

     You can use the CurrentMouseElements property together with the mouse events to detect movement of items, the ElementInserted/ElementRemoved events and override the DoCommand method for other actions. Together with your custom code, this should provide coverage for all changes.

    Hope this helps.

    Filed under: ,
    • 81.132.167.65
Page 1 of 1 (6 items)