Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic UndoManager (Read 4705 times)
kinijn
YaBB Newbies
*
Offline


There are no problems,
only challenges.

Posts: 5
Joined: Jan 3rd, 2007
UndoManager
Jun 14th, 2007 at 11:19am
Print Post  
Hello,

I'm still working in version 4.2.1 but I studied the FlowCharter that is included in the examples of this version. The problem is when I delete an item, the properties of this item are gone too, when I try Undo Property Change. Also when I change some item in properties the Undo Property Change doesn't work. Only when its simple description text it works, but dropdowns etc don't work. Is this solved in a later version ? Can I have a workaround ? I have at least 30 different boxes with their own property settings.

tnx
KaTy
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: UndoManager
Reply #1 - Jun 14th, 2007 at 11:52am
Print Post  
Hello,

I am not sure what are these dropdowns you mention. Property changes are not saved automatically for later undo/redo. You must explicitly create a ChangeItemCmd to enable that. For an example, check the "Programming ... \ Undo and Redo \ Undo or redo of property changes" topic in the help file.

Stoyan
  
Back to top
 
IP Logged
 
kinijn
YaBB Newbies
*
Offline


There are no problems,
only challenges.

Posts: 5
Joined: Jan 3rd, 2007
Re: UndoManager
Reply #2 - Jun 14th, 2007 at 12:11pm
Print Post  
Tnx for your reply.
I used the following code in the section On PropertyValueChanged((object s, System.Windows.Forms.PropertyValueChangedEventArgs e)

if(_flowChart.Selection.Boxes.Count == 0)




return;




Box b = _flowChart.Selection.Boxes[0];



if(b == null)




return;




// Create undo record



MindFusion.FlowChartX.Commands.ChangeItemCmd cmd =




new MindFusion.FlowChartX.Commands.ChangeItemCmd(b, "Property change");




b.Text = _selected.Text;



b.Font = _selected.Font;



b.FillColor = _selected.FillColor;




cmd.Execute();

If I try this with the example from MindFusion (FlowCharter) I have the same problem. In this example the Font isn't changed back.

KaTy.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: UndoManager
Reply #3 - Jun 14th, 2007 at 12:30pm
Print Post  
I think our developers implemented undo/redo for font changes in version 4.3. So that won't work with 4.2.1.

Stoyan
  
Back to top
 
IP Logged
 
kinijn
YaBB Newbies
*
Offline


There are no problems,
only challenges.

Posts: 5
Joined: Jan 3rd, 2007
Re: UndoManager
Reply #4 - Jun 14th, 2007 at 12:34pm
Print Post  
Tnx for your reply. I'll see what I can do with the Composite command.Maybe this will help me.

grtz,
KaTy
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: UndoManager
Reply #5 - Jun 14th, 2007 at 1:03pm
Print Post  
I guess you can create a ChangeItemCmdEx that contains a ChangeItemCmd member and delegates all calls to it. Implement the Execute, Undo and Redo methods by saving / restoring the item font and delegating the calls to the internal cmd object. If you are our registered customer, we can send you a fixed 4.2.1 version where undo of font changes works - just send us by email your order ID.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint