Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram Pasting Nodes (Read 3902 times)
BidMaestro
Junior Member
**
Offline


to learn is to live

Posts: 74
Location: Australia
Joined: Apr 20th, 2008
Diagram Pasting Nodes
Apr 11th, 2010 at 5:56am
Print Post  
Stoyan

I am not sure if this is a bug or my lack of understanding. In the application that I am building I have code that prevents a user from adding more that 2500 nodes to the Diagram area.
I test the node.count at the diagram.nodecreated and diagramview.dragdrop code. Adding more nodes to a diagram that already has 2,500 is stopped.

However, if I copy a group of nodes already on the diagramview area and paste them on the diagramview area it does not trigger the nodecreated. I used the diagram.nodepasted and added code to issue a message however I could not cancel/prevent the paste action. Is there a way to clear the clipboard?

Doug
« Last Edit: Apr 11th, 2010 at 7:06am by BidMaestro »  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram Pasting Nodes
Reply #1 - Apr 11th, 2010 at 8:46am
Print Post  
You could paste to a temporary diagram to see how many items are there in the clipboard, and do not call Paste on the main diagram if that would bring the count to more than 2500.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
BidMaestro
Junior Member
**
Offline


to learn is to live

Posts: 74
Location: Australia
Joined: Apr 20th, 2008
Re: Diagram Pasting Nodes
Reply #2 - Apr 11th, 2010 at 8:58am
Print Post  
Stoyan
That sounds like a good work around; I will try that later. I will explore testing the count at the copy stage also.

At some stage in the future you may want to think about a clear clipboard command or cancel coyp or paste.

Have a great week.

Doug
  
Back to top
WWW  
IP Logged
 
BidMaestro
Junior Member
**
Offline


to learn is to live

Posts: 74
Location: Australia
Joined: Apr 20th, 2008
Re: Diagram Pasting Nodes
Reply #3 - Apr 11th, 2010 at 10:23am
Print Post  
Stoyan

I have a simple solution.

At the time of copying the nodes I record the count of selected nodes.
NodeSelectionCount = Diagram1.Selection.Nodes.Count

At the time of pasting I check the number of nodes on the diagram plus the count of nodes on the clipboard and if the total exceeds 2500, I do not perform the paste.

                   If Diagram1.Nodes.Count + NodeSelectionCount > 2500 Then
                       ' Issue message
                   Else
                       dvMain.PasteFromClipboard(Xcoords, Ycoords, True)
                       NodeSelectionCount = 0
                   End If

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