Problem with Copy/Paste

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Problem with Copy/Paste

Post by RossG » Tue Jun 21, 2016 2:08 am

I've had problems with fields which I've copied and pasted.

Doing this with one field works as expected - pasting twice gives
two new fields on top of the original.

However when I select a number of fields (not grouped) the
result is unexpected.

I've reproduced this behavior with the attached stack.
I've included a copy in case you get the strange results
that I've had - pasting twice gave six or seven copies
of each field!

Select the six fields with the lasso.

Control C to copy.
Control V to paste.
Control V to paste.

Select the fields with lasso and move down.
First (or is it the second) copy moves down.
Select the fields with lasso again and move down.
The original fields move down - where is the second copy?

Check with the PB to see that there is a second copy.

Select one field and move down. Second copy moves.

Click on "Fill" button makes it easier to identify the originals.
Attachments
CopyPaste Test.zip
(3.09 KiB) Downloaded 223 times
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Problem with Copy/Paste

Post by jacque » Tue Jun 21, 2016 9:47 pm

I don't see the problem, I get the correct number of fields after pasting twice.

If you select by dragging, you'll be selecting all 18 fields, so they'll all move down at once and the ones underneath won't be visible. I'm not sure what you're seeing, but try shift-clicking to select only the topmost fields and they will move down independently.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Copy/Paste

Post by RossG » Tue Jun 21, 2016 11:08 pm

jacque wrote:I don't see the problem, I get the correct number of fields after pasting twice.

If you select by dragging, you'll be selecting all 18 fields, so they'll all move down at once and the ones underneath won't be visible. I'm not sure what you're seeing, but try shift-clicking to select only the topmost fields and they will move down independently.
If what you say is correct (and it's not so in my experience) then this doesn't work the same way as selecting
one field and copying twice. In that case the copies are on top of the original and can be moved
independently.

When I select by dragging only six fields move. The originals stay in place.
The second copy is nowhere to be seen but but appears in the PB.

It did occur to me that selecting by dragging might select both copies but
this isn't so.

Win XP, LC 7.1.2
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10050
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Problem with Copy/Paste

Post by FourthWorld » Wed Jun 22, 2016 12:08 am

RossG wrote:When I select by dragging only six fields move. The originals stay in place.
The second copy is nowhere to be seen but but appears in the PB.
Check the rect of the field that doesn't seem to be visible. When I do that recipe here I discovered that the lockLoc property of the fields is set to true, so all but the one under mouse control remain locked into position, with the copies directly on top of their originals.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Copy/Paste

Post by RossG » Wed Jun 22, 2016 2:30 am

The frustrating thing is that every time I try this I
get a different result.

Sometimes the copies appear (or some of them),
sometimes on top (apparently) and sometimes not.

Guess I'll just have to not copy in bulk.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10050
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Problem with Copy/Paste

Post by FourthWorld » Wed Jun 22, 2016 2:34 am

When in doubt, you may find turning off the objects' lockLoc property will at least allow greater visibility during the drag-copy.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply