threepenny-gui-0.9.3.0: GUI framework that uses the web browser as a display.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Graphics.UI.Threepenny.DragNDrop

Synopsis

Synopsis

API for handling drag and drop operations.

See the documentation below for details on the drag and drop model.

WARNING: Events in this module may not behave as expected. The model is currently implemented in terms of HTML 5 drag and drop, but unfortunately, the HTML 5 specification for drag and drop is horrible and browser implementations are buggy.

Documentation

draggable :: WriteAttr Element Bool Source #

Enable or disable whether the element can be dragged by the user.

An element with draggable set to True will receive drag, dragStart and dragEnd events.

droppable :: WriteAttr Element Bool Source #

Enable or disable whether the element accepts drops.

An element with droppable set to True will receive drop, dragOver, dragEnter and dragLeave events.

Child elements of a droppable element may also be droppable. When dragging something over an element, the closest ancestor element that is droppable will be the target and receive corresponding events.

dragData :: WriteAttr Element DragData Source #

Set the data that is transferred when dragging this element.

type DragData = String Source #

Data carried by a dragged element.

FIXME: Empty data is currently encoded by the empty String. Change this to 'Maybe String' instead.

drag :: Element -> Event DragData Source #

Occurs periodically while the element is being dragged around.

dragStart :: Element -> Event DragData Source #

Dragging the element starts.

dragEnd :: Element -> Event DragData Source #

Dragging the element ends.

WARNING: This event can occur both before and after a corresponding drop event.

drop :: Element -> Event DragData Source #

The drag and drop operation is being completed on this element.

dragEnter :: Element -> Event DragData Source #

The element is now the current target element for a drop.

WARNING: This element is buggy when moving the mouse over child elements.

dragLeave :: Element -> Event DragData Source #

The element is no longer the current target element for a drop.

WARNING: This event is also fired when the mouse is moved over a child element.

dragOver :: Element -> Event DragData Source #

Occurs periodically while the element is the current target element.