Canvas Toolkit
← Class index

CDropEvent

Events · extends CEvent

Event containing data and actions for a drag-and-drop operation.

import { CDropEvent } from "canvas-toolkit-lib";

Declared members

constructor(pos: CPoint, mimeData: CMimeData, possibleActions: CDropAction, proposedAction: CDropAction, type?: CEventType);

Creates a drop event. @param pos Position relative to the receiving widget. @param mimeData Data carried by the drag operation. @param possibleActions Actions supported by the drag source. @param proposedAction Action proposed by the drag source. @param type Event type; defaults to CEventType.Drop.

pos(): CPoint;

Returns the widget-relative drop position.

mimeData(): CMimeData;

Returns the MIME data carried by the drag operation.

possibleActions(): CDropAction;

Returns the actions supported by the drag source.

proposedAction(): CDropAction;

Returns the action proposed by the drag source.

dropAction(): CDropAction;

Returns the currently selected drop action.

setDropAction(action: CDropAction): void;

Sets the drop action when it is supported by the drag source. @param action Drop action to select.

acceptProposedAction(): void;

Selects the proposed action and accepts the event.