Starting drag operation with a widget

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Starting drag operation with a widget

Post by trevordevore »

Hi,

Should it be possible to start a drag operation when clicking on a widget? I haven't been successful in the past and I wonder if anything has changed or if perhaps I was doing something wrong.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm

Re: Starting drag operation with a widget

Post by peter-b »

I think at the moment you have to start it from the widget's LiveCode Script rather than being able to start it directly from LCB.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: Starting drag operation with a widget

Post by trevordevore »

I'm trying to start it from LCS. That is what doesn't work.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm

Re: Starting drag operation with a widget

Post by peter-b »

trevordevore wrote:I'm trying to start it from LCS. That is what doesn't work.
Hmm, that's really weird -- I swear that's how dragging widgets out from the Tools palette works (dragging on an SVG Path widget initiates the drag operation).
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: Starting drag operation with a widget

Post by trevordevore »

Okay. I'll do some more tests and try again.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: Starting drag operation with a widget

Post by trevordevore »

I just tried this test:

1) Drag SVG icon widget onto new stack.
2) Add this script to the widget:

Code: Select all

on dragStart
   put the milliseconds
end dragStart
3) Click and drags on the widget. The milliseconds doesn't display in the message box.

The same script on a button control displays the milliseconds. I'm guessing the tools palette is using a different technique.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1235
Joined: Thu Apr 11, 2013 11:27 am

Re: Starting drag operation with a widget

Post by LCMark »

The tools palette uses its own drag-drop (modal) loop to do its thing. This sounds like a bug in the widget host - it should still allow drag-drop stuff to be managed from script, even if widget's can't yet do so themselves.
peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm

Re: Starting drag operation with a widget

Post by peter-b »

Probably best to file a bug report about this.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com
LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1235
Joined: Thu Apr 11, 2013 11:27 am

Re: Starting drag operation with a widget

Post by LCMark »

trevordevore
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1005
Joined: Sat Apr 08, 2006 3:06 pm
Contact:

Re: Starting drag operation with a widget

Post by trevordevore »

Thanks guys.
Trevor DeVore
ScreenSteps - https://www.screensteps.com

LiveCode Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode
LiveCode Builder Repos - https://github.com/search?q=user%3Atrevordevore+topic:livecode-builder
LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1235
Joined: Thu Apr 11, 2013 11:27 am

Re: Starting drag operation with a widget

Post by LCMark »

pthirkell
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 93
Joined: Tue Nov 17, 2009 6:47 pm

Re: Starting drag operation with a widget

Post by pthirkell »

This seems to relate also to bug http://quality.livecode.com/show_bug.cgi?id=16930 reported in mid Feb. Glad to see quick fix thanks. :D
Post Reply