Making a tool palette

Scott Rossi scott at tactilemedia.com
Tue Nov 30 01:01:02 EST 2010


Hi Marty:

You might want to take a look at a drag-and-drop implementation I built some
time ago for dragging any kind of control to a target stack.

In your message box:
go url "http://www.tactilemedia.com/site_files/downloads/TMdragndrop.rev"

When the stack launches, start dragging any object, and the drop window will
magically appear.  Note that if you release an object outside the drop
stack, it will snap back to the source stack.

Qualification: I've never come to grips with LC's built-in drag and drop
commands, I've always relied on a variation of this scripted solution which
is based on code originally written by the late Eric Chatonet.  I wanted
something more robust when it came to rendering the dragged objects, so I
modified his routine to handle dragged objects as translucent stacks based
on the originally clicked objects: images, groups, buttons, sliders, etc.
Everything is created/controlled by script, so it can be modified if
necessary.  Just saying, if you're looking to use LC's default drag and drop
commands, you should look elsewhere.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design


Recently, Marty Knapp wrote:

> Thanks Chipp and Jan,
> 
> I don't want to edit or replace the LC tool palette, just create
> something similar for a project where I'm trying to imitate Visio where
> you drag symbols off a palette onto your worksheet. I would have half a
> dozen different buttons that the user could drag onto a stack window
> where the button would be created (perhaps from a template button).
> 
> Has anyone done something similar that I could look at?
> 
> Thanks again,
> Marty Knapp
>> Marty,
>> 
>> I might suggest you try and create a blank palette and then examine
>> the scripts of rev's tool palette before jumping into the deep end.
>> Modifying the IDE requires a deep understanding of how LCŒs IDE works,
>> and isn't recommended for those not well-versed in it's ways.
>> 
>> On Monday, November 29, 2010, Marty Knapp<martyknapp at comcast.net>  wrote:
>>> I want to make a tool palette very similar to the LC tool palette, that I
>>> can drag a button off of and have it create on a stack. So I copied
>>> revtools.rev to the desktop and changed its name there and tried to open it,
>>> but of course LC wants to know what to do with the existing tool palette. I
>>> did try closing that before opening my copy but got the same message. I want
>>> to take a peek at the scripting to learn how to make my own - what should I
>>> do, or does someone have another idea for me?
>>> 
>>> Thank you for any responses,
>>> Marty Knapp
>>> 
> 
> _______________________________________________
> use-livecode mailing list
> 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