Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic PasteFromClipboard pasting in wring order (Read 2354 times)
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 125
Location: England
Joined: Oct 23rd, 2006
PasteFromClipboard pasting in wring order
Feb 18th, 2021 at 2:23pm
Print Post  
With our DiagramView and Diagram setup we have discovered that you can select multiple boxes by drawing a rectangle over multiple boxes with the left mouse button. But when we use CopyToClipboard() followed by PasteFromClipboard() the boxes are pasted in the order they were created rather than their order on screen (also the order in which they were "dragged over").

How can we overcome this behaviour?
DavidL
  

DragAndSelect.jpg ( 28 KB | 94 Downloads )
DragAndSelect.jpg
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3153
Joined: Oct 19th, 2005
Re: PasteFromClipboard pasting in wring order
Reply #1 - Feb 18th, 2021 at 4:35pm
Print Post  
Creation order is also used as default Z order, so we like copy/paste better this way Smiley You could sort diagram.Selection.Items before calling CopyToClipboard if you need them copied in left-to-right or top-to-bottom order. E.g. the Sort comparer could just return item1.Bounds.X.CompareTo(item2.Bounds.X);

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 125
Location: England
Joined: Oct 23rd, 2006
Re: PasteFromClipboard pasting in wrong order
Reply #2 - Feb 18th, 2021 at 5:41pm
Print Post  
Ok, I'll have a look at this, but the clients can Ctrl+Click on boxes in any order, copy them to the clipboard and then paste them elsewhere in the order clicked on. I would like to let them continue doing this. I'll see if the events I get indicate a dragged rectangle type of selection. In which case I can do what you suggest.

DavidL
  
Back to top
 
IP Logged
 
David Long
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 125
Location: England
Joined: Oct 23rd, 2006
Re: PasteFromClipboard pasting in wrong order
Reply #3 - Feb 19th, 2021 at 12:58pm
Print Post  
Problem solved. Although I did have to re-sort the boxes after I had pasted them from the clipboard, but before I re-connected them to the target box. I can share some code if anyone is interested.

Thanks for your help.
DavidL
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint