Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic I Cut group node,but I can't paste it! (Read 3217 times)
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
I Cut group node,but I can't paste it!
Jul 10th, 2017 at 4:46am
Print Post  
I Cut group node,but I can't paste it! After I paste it, it becomes an empty groupnode! In my GroupNode's DiagramItem Clone(bool clipboard) method,I create a new groupNode,but the new groupNode.SubordinateGroup is null.How can I assign the cut groupnode.SubordinateGroup to my new groupNode?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: I Cut group node,but I can't paste it!
Reply #1 - Jul 10th, 2017 at 5:57am
Print Post  
Calling CutToClipboard (bool copy, bool groups) overload with true as second argument?
  
Back to top
 
IP Logged
 
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
Re: I Cut group node,but I can't paste it!
Reply #2 - Jul 10th, 2017 at 6:47am
Print Post  
Slavcho wrote on Jul 10th, 2017 at 5:57am:
Calling CutToClipboard (bool copy, bool groups) overload with true as second argument?

Yes!When I click the cut button, call diagram.CutToClipboard (true, true);
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: I Cut group node,but I can't paste it!
Reply #3 - Jul 10th, 2017 at 6:55am
Print Post  
If using custom node types, have you implemented copy constructors and serialization methods for all of them?
  
Back to top
 
IP Logged
 
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
Re: I Cut group node,but I can't paste it!
Reply #4 - Jul 10th, 2017 at 8:22am
Print Post  
Slavcho wrote on Jul 10th, 2017 at 6:55am:
If using custom node types, have you implemented copy constructors and serialization methods for all of them?

Just overloading Clone, SaveToXml, LoadFromXml method?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: I Cut group node,but I can't paste it!
Reply #5 - Jul 10th, 2017 at 9:58am
Print Post  
Clone override should work too, and don't forget to call RegisterItemClass so the control knows what types to instantiate when reading from XML. The custom nodes should have either no-arguments or (Diagram) constructor, or otherwise the load method wouldn't be able to instantiate them.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
Re: I Cut group node,but I can't paste it!
Reply #6 - Jul 10th, 2017 at 10:33am
Print Post  
Slavcho wrote on Jul 10th, 2017 at 9:58am:
Clone override should work too, and don't forget to call RegisterItemClass so the control knows what types to instantiate when reading from XML. The custom nodes should have either no-arguments or (Diagram) constructor, or otherwise the load method wouldn't be able to instantiate them.

Regards,
Slavcho

Thank you for your reply! But how do I disable the diagram's ctrl + x and ctrl + c shortcuts?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: I Cut group node,but I can't paste it!
Reply #7 - Jul 10th, 2017 at 11:57am
Print Post  
See http://mindfusion.eu/Forum/YaBB.pl?num=1341317161/3#3 for how to replace the command binding. So we've added the overload to cut with groups mentioned in that thread at some point, but the standard command binding still calls it without groups.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint