Dropping file on an LC standalone...

Craig Newman craig at starfirelighting.com
Fri Mar 22 12:09:34 EDT 2024


Klaus.

AHA. I did, but did not see past the fact that the “$” keyword took parameters.

Craig

> On Mar 22, 2024, at 8:56 AM, Klaus major-k via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi Craig,
> 
>> Am 22.03.2024 um 13:44 schrieb Craig Newman via use-livecode <use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>>:
>> 
>> What on earth is the “1$ special variable”?
> 
> well, 1$ sounds like a good bargain for a "special variable"! :-D
> 
> Actually it is -> $1
> Look up $ in the dictionary for further information.
> 
>> Craig
>> 
>>> On Mar 21, 2024, at 6:58 PM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>>> 
>>> Wow I just read that and it didn’t even make sense to me!
>>> 
>>> Basically with Windows, dragging a file onto a taskbar icon only adds the file to the icon’s Pinned items. Dragging a file onto an open window of an App will try and open the file in that app. If the app’s window(s) are hidden, dragging and hovering over the app’s shortcut will cause the app to show it’s window(s) whereupon you can drop the file onto the open window.
>>> 
>>> Bob S
>>> 
>>> 
>>> On Mar 21, 2024, at 3:46 PM, Bob Sneidar via use-livecode <use-livecode at lists.runrev.com> wrote:
>>> 
>>> Does it have to be the icon? If I drag a file onto an app in the Windows Tack Bar it does nothing, even if the file belongs to the app I am dragging the file onto. If however I HOVER on the icon and the app is running, it will bring the app to the front and show the frontmost window if it is hidden.
>>> 
>>> If I drag the file onto the open Window, the app will open it. Case in point, drag an Excel spreadsheet onto the Excel icon in the task bar. All it will do is add a shortcut to the Excel icon for that file. But launch Excel, open a blank spreadsheet, then drag an excel file onto the icon, hover, then drop onto the blank Excel Spreadsheet. In THIS case it will open the spreadsheet in a new window.
>>> 
>>> Because of this you may be able to use a Drag / Drop handler in your card script. The caveat is that the card itself will not accept a drag/drop action, but if you drag anything on top of an actual object, THEN the card will get the message.
>>> 
>>> So to handle this, add an opaque rectangle the size of the card behind everything else (if the opacity is set to 99 it will appear transparent for all intents and purposes). The rectangle (or any other object on the card that doesn’t have a dragDrop handler) will get the message and it will fall through to the card where you can handle it.
>>> 
>>> This in my card script:
>>> 
>>> on dragEnter
>>> set the dragAction to "link" -- for files
>>> pass dragEnter
>>> end dragEnter
>>> 
>>> on dragDrop
>>> put the dragData into tDragData
>>> set the dragData to empty
>>> -- do something with tDragData
>>> end dragDrop
> 
> Best
> 
> Klaus
> 
> --
> Klaus Major
> https://www.major-k.de <https://www.major-k.de/>
> https://www.major-k.de/bass
> klaus at major-k.de <mailto:klaus at major-k.de>
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com <mailto:use-livecode at lists.runrev.com>
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list