Drag and drop to stack

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
Cyberqat
Posts: 24
Joined: Thu Jun 10, 2010 5:38 pm

Drag and drop to stack

Post by Cyberqat » Tue Mar 17, 2015 4:30 am

I'm trying to write an IDE tool that I can drag and drop onto a stack.
The drag is working but putting a dropEnter in the stack's script doesnt seem to allow a drop.

code below:

Image being dragged:

Code: Select all

on dragStart
   set the dragData["text"] to empty
   set the dragImage to the id of me
   set the allowableDragActions to "copy"
   set the dragAction to "copy"
   pass dragStart
end dragStart
Stack I am trying to drop on

Code: Select all

on dragEnter
    set the dragAction to "copy"
    pass dragEnter
end dragEnter

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Drag and drop to stack

Post by Simon » Tue Mar 17, 2015 7:52 am

Are these 2 different stacks?
Not a substack of a main stack?

There may have to be a "on mouseEnter" on the second stack.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Drag and drop to stack

Post by bn » Tue Mar 17, 2015 9:49 am

If you are planning on something akin the revPalette for tools then I "stole" some code from from stack "revTools" card 1 "on mouseDown"

http://livecodeshare.runrev.com/stack/757/GridDrawer

it is from stack

The behavior part is my addition.

Kind regards

Bernd

Cyberqat
Posts: 24
Joined: Thu Jun 10, 2010 5:38 pm

Re: Drag and drop to stack

Post by Cyberqat » Tue Mar 17, 2015 6:00 pm

Yes this is inter-stack.

Thanks for the code example, I'l look it over!

Cyberqat
Posts: 24
Joined: Thu Jun 10, 2010 5:38 pm

Re: Drag and drop to stack

Post by Cyberqat » Sun Mar 22, 2015 10:42 pm

Wow thats some complex code.

I wish they had made this a bit simpler. It seeme like there aught to be an easier standard solution for making components...

Cyberqat
Posts: 24
Joined: Thu Jun 10, 2010 5:38 pm

Re: Drag and drop to stack

Post by Cyberqat » Tue Mar 24, 2015 12:47 am

I found this, its a much simpler and easier to work with example.

https://app.box.com/shared/o8zaqami56aaqpbg76g8

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: Drag and drop to stack

Post by bn » Tue Mar 24, 2015 7:00 am

Hi Cybersquat,

that is Peter Haworth's example stack that I did not know. It is a lot easier than what Livecode uses in the IDE.

your link is the same stack as the one in Livcodeshare:

http://livecodeshare.runrev.com/stack/614/DragExample

Thanks for posting this.

Kind regards
Bernd

Simon Knight
Posts: 919
Joined: Wed Nov 04, 2009 11:41 am

Re: Drag and drop to stack

Post by Simon Knight » Fri Jun 19, 2020 12:52 pm

Hi,

I have used Peter's stack as the basis of an update. It may be found attached to this post https://forums.livecode.com/viewtopic.p ... 52#p193252
best wishes
Skids

Post Reply