The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

IWL::DND - a Perl interface to Javascript Drag & Drop

DESCRIPTION

The DND helper class is an abstract class, inherited by IWL::Widget, which provides configuration for Drag & Drop functionality.

SIGNALS

In JavaScript, the following signals are prefixed. Example: 'iwl:SIGNAL_NAME'

The following signals are emitted by the drag source

drag_begin

Fires when a draggable widget begins its movement. Receives the draggable object as a second parameter

drag_motion

Fires during the motion of a draggable widget. Receives the draggable object as a second parameter

drag_end

Fires when a draggable widget ends its movement. Receives the draggable object as a second parameter

The following signals are emitted by the drag destination

drag_hover

Fires when an acceptable draggable widget is hovering over a draggable destination. Receives the draggable widget and droppable widget as second and third parameter

drag_drop

Fires when an acceptable draggable widget is dropped over a draggable destination. Receives the draggable widget and droppable widget as second and third parameter

METHODS

setDragSource ([OPTIONS])

Registers an IWL::Widget as a drag source.

Parameters: OPTIONS - a hash reference of options:

outline

If true, an outline of the widget will be moved, instead of the widget itself

view

If a helper widget it given, it will be moved on drag, instead of the actual widget

revert

If true, the actual widget will be returned to its original position, when dropped

handle

An IWL::Widget or an ID of a widget, which is a descendant of the draggable widget. The widget will move, only if the handle is dragged

snap

A 2-element array of integers, specifying the amount, in pixels, for snapping

zindex

An integer, defining the CSS z-index of the widget during a drag.

constraint

If set to either horizontal or vertical, it will constraint the drag in only that direction

ghosting

If true, a copy of the object will be dragged, while the original object stays in place

unsetDragSource

Unsets the IWL::Widget as a drag source

setDragDest ([OPTIONS])

Registers the IWL::Widget as a drag destination (drop)

Parameters: OPTIONS - a hash reference of options:

accept

A CSS class, or an array of such classes, which belong to elements, that will be accepted by the destination

containment

If set to an IWL::Widget, or an ID, the destination will only accept the target, if the target is either the containment widget, or a child of that widget.

hoverclass

If specificed, the CSS class will be added to the destination, while an accepted target is on dragged on it

unsetDragDest

Unsets the IWL::Widget as a drag destination

setDragData (DATA)

Associates the given data to the draggable source.

Parameters: DATA - a string, or hash/array reference

LICENCE AND COPYRIGHT

Copyright (c) 2006-2008 Viktor Kojouharov. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perldoc perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 234:

You forgot a '=back' before '=head1'