Disabling drag and drop

This is a forum focused on providing support for rTree

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Locked
r_houdek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Wed Feb 23, 2011 1:35 am

Disabling drag and drop

Post by r_houdek » Tue Mar 29, 2011 6:00 am

I'm wondering if there's a way to disable drag and drop for a tree. I find myself sometimes inadvertently dragging nodes and getting some unusual results (new nodes appear representing the C:\ directory when it's not a "filesystem" type tree).

I'm hopeful there's a single property that can be set to disable it versus intercepting the events and ignoring them.

Any help would be greatly appreciated.

Thanks,

Ritch

wilstrand
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 114
Joined: Mon Jan 03, 2011 3:02 pm
Contact:

Re: Disabling drag and drop

Post by wilstrand » Tue Mar 29, 2011 11:11 am

Hi Ritch

As far as possible working with rTree mimics the way you work with other controls in LiveCode. Consequently to disable drag and drop you can trap the dragNodeStart message sent to an rTree control when the user initiates the drag, preventing the drag and drop from being executed.

Place a dragNodeStart handler in the script of the control that does not contain a pass control structure:

Code: Select all

on dragNodeStart -- in script of a rTree control or one of its owners
    -- do nothing, but trap the message to disable drag & drop.
 end dragNodeStart
All the best,

Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects

r_houdek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 12
Joined: Wed Feb 23, 2011 1:35 am

Re: Disabling drag and drop

Post by r_houdek » Wed Mar 30, 2011 1:42 am

Thanks so much. This works great!

Ritch

Locked

Return to “rTree”