BiDragEvent

This event is used in drag and drop sesssions

This class extends BiMouseEvent and therefore all methods and fields available for BiMouseEvent are also available for BiDragEvent .

Constructor

new BiDragEvent ( sType,oMouseEvent )

Parameters

NameTypeOptionalDefaultDescripton
sTypeStringThe type of the event
oMouseEventBiMouseEventThe mouse event object used to initiate this event

Properties

NameTypegetsetDescripton
actionStringcheckedReturns the action that the session is currently using
dragIconBiComponentcheckedcheckedThe component to use as the icon next to the pointer
dropDataTypesString[]checkedReturns the types that the data is avaible for
managerBiDragAndDropManagercheckedThis returns the drag and drop manager used in the drag and drop session
realTargetBiComponentcheckedThis is the component that mouse is currently over. This is useful in case You want to show a drop marker relative to the component below the pointer and that component is not a valid drop target
relatedTargetBiComponentcheckedReturns the related component in the drag'n drop session

For dragover this returns the component that was left (if a valid drop target)
For dragout this returns the component that was entered (if a valid drop target)
For dragdrop this returns the source of the drag'n drop
For dragend this returns the destination (drop target)

Methods

NameDescription
addActionAdds an action supported by the drag and drop session
addDataThis adds some data to be used in the drag and drop session
clearActionsRemoves the supported actions for the current drag and drop session
clearDataClears the data associated with the drag and drop session
getDataReturns the data for the given type
removeActionRemoves an action which is no longer supported by the drag and drop session
startDragCall this in a dragstart event to start the actual drag and drop session.

Events

None.

Static Methods

None.

Static Fields

None.

Remarks

Unlike BiMouseEvent the target (and relatedTarget) is not always the direct component under the mouse pointer but the first valid drop target (or the source of the drag'n drop). Valid drop targets are decided based on the drop data types and the data in the drag'n drop session.

Method Details

addAction

Adds an action supported by the drag and drop session

Syntax

object.addAction ( sAction )

Parameters

NameTypeOptionalDefaultDescripton
sActionStringThe name of the action to add

Return Type

void

addData

This adds some data to be used in the drag and drop session

Syntax

object.addData ( sType,oData )

Parameters

NameTypeOptionalDefaultDescripton
sTypeStringA string identifying the data
oDataObjectThe data to be used

Return Type

void

clearActions

Removes the supported actions for the current drag and drop session

Syntax

object.clearActions ( )

Parameters

No arguments.

Return Type

void

clearData

Clears the data associated with the drag and drop session

Syntax

object.clearData ( )

Parameters

No arguments.

Return Type

void

getData

Returns the data for the given type

Syntax

object.getData ( sType )

Parameters

NameTypeOptionalDefaultDescripton
sTypeStringThe string identifying the data

Return Type

Object

removeAction

Removes an action which is no longer supported by the drag and drop session

Syntax

object.removeAction ( sAction )

Parameters

NameTypeOptionalDefaultDescripton
sActionStringThe name of the action to remove

Return Type

void

startDrag

Call this in a dragstart event to start the actual drag and drop session.

Syntax

object.startDrag ( )

Parameters

No arguments.

Return Type

void