Release 10.1A: OpenEdge Getting Started:
Progress OpenEdge Studio

> ## Drag and Drop module

> The Progress 4GL can read the names of files that an end user drops onto certain widgets. With this functionality, the end user can populate widgets, like selection lists, with a list of files. The Progress 4GL can also use the filenames to retrieve the files and open them in appropriate widgets. Using these techniques, you could save your users time by allowing them to load data into your program by dragging a filename from the Windows Explorer or Desktop onto a widget in your application.

> | To launch this module, choose the Drag and Drop button on the SportsPro main window. The Drag and Drop dialog box appears:

> Implementing this technique is simple. You set the `DROP–TARGET` attribute on the property sheet of a selection list or editor widget and code the trigger event. For images, the `DROP–TARGET` attribute is set on the frame that holds the image. When a file is dropped on an object with the `DROP-TARGET` attribute enabled, the `DROP–FILE–NOTIFY` event fires.

> Note: If you cannot click on an object, it is probably behind another object in the window’s layout. Use the Layout menu to move the top object back, or use the List Objects dialog box to access the bottom object.

> Table 2–5 describes the major objects used in the Drag and Drop module.

> Table 2–5: Components of the Drag and Drop module
> Object or filename | Object type | Function
> --- | --- | ---
> `wdragdrop.w` | SmartWindow | Serves as a container for the other objects in the module.
> fMain | SmartFrame | Acts as the drop-target for image files. It reads the filename and then displays the image.
> SELECT–1 | Selection-list | Acts as the drop-target for filenames. It reads the filenames and then adds them to the list of selections.
> EDITOR–1 | Editor | Acts as the drop-target for text files. It reads the filename and then opens the file in the editor.

> For more information on how drag and drop works, see the entries for the `DROP–TARGET` attribute, the `END–FILE–DROP`( ) method, the `GET–DROPPED–FILE`( ) method, the `DROP–FILE–NOTIFY` event, and the `NUM–DROPPED–FILES` attribute in the OpenEdge Development: Progress 4GL Reference .

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095