Interface: dragAndDrop

iDrop - drag and drop

The Drag and Drop system is managed through a Core Function Published interface. It provides control over the DnD system, manages handler registration and exposes some useful utility methods for downloading URL’s, simulating drops, etc.

<void>globalEnableDragAndDrop <boolean>onOff

This method allows you to globally enable or disable the DnD interface.

<boolean>onOff: True to enable, false to disable.

<boolean>isEnabled()

This method returns true if the global DnD interface is enabled, otherwise false.

<boolean>enableDragAndDrop <HWND>window <boolean>onOff

This method allows you to enable DnD for a given window (and its children). If no custom DragAndDropHandler is supplied, a default one is used that will accept dropped scene files for opening and scripts for running. Returns true if successful and false otherwise.

<HWND>window : A handle to the window you wish to enable or disable DnD for.

<boolean>onOff: True to enable, False to disable.

<boolean>dropPackage <HWND>window <&point>mousePoint <&filename array>files

This method allows the simulation of a package of files into a window at a given point. A package of files, specified as a list of URL strings is the common form of DropType data from iDrop sources and files dragged from the Windows desktop. The entire package is downloaded, as needed, but only the first file in the list is actually dropped into 3ds Max. The other files in the package are presumed to be support files, such as texmaps or xref sources, for the main drop file. After the drop, the URL strings in the URLTab are converted to fully-specified path names to local file copies, if any had to be downloaded from the web. Returns true if the drop was successful, otherwise false.

<HWND>window : A handle to the window. If this is set to NULL, the default 3ds Max window is used.

<&point>mousePoint : The point at which to drop. mousePoint is In and Out parameter

<&filename array>files: A reference to the local copies of the URL strings. files is In and Out parameter

<boolean>downloadPackage <&filename array>files <string>directory <boolean>Showprogress

This method serves as a utility function that can be used to download a package of URLs to the specified directory. If the hwnd argument is supplied, any progress or other messages are centered over that window. Returns true if successful and false otherwise.

<&filename array>files : A reference to the local copies of the URL strings. files is In and Out parameter

<string>directory: The directory path string to download to.

<boolean>Showprogress: Displays the progress dialog.

<filename>getDownloadDirectory()

This method returns the fully-specified path to the directory in which package drops are downloaded.

<boolean>DownloadUrlToDisk <string>url <filename>fileName <integer>flags

This method allows you to download the file referenced by the URL to disk. Returns true if successful and false otherwise.

<string>url : The URL string of the file to download.

<string>fileName : The filename string of the URL to store on disk.

<integer>flags

<node>ImportContextNode()

Returns a pointer to the import context node.

See also

Zip-file Script Packages

iDrop - drag and drop