nca_dragdrop


Ancestor

nonvisualobject

Library

D:\PB2\Components\DragDrop\dragdrop.pbl

Author

Ken Howe

Description

This object is designed to enabled controls to have lists of files dragged from an explorer or file manager program and dropped on the control. Depending on the control type the filenames are added to the control.

This object is designed to handle multiple controls at the same time. You can register multiple controls on the same window with the service.

In the open event of your window call BeginDragDrop passing in the control you want to be Drag Drop enabled.

On your controls define a user event 'dropfiles' which is mapped to the pbm_dropfiles event. In the 'dropfiles' event call the Populate method to have your control automatically populated.

The Filter function allows you to filter certain file types such as pbr, dll, txt, exe files.

Model

nca_dragdrop
Private:
WindowObject iwo_Objects[]
Boolean ib_DragEnabled[]
Long il_Count
String is_Filter
Integer ii_FilterLen
begindragdrop (windowobject awo_windowobject)
enddragdrop (windowobject awo_object)
filterfiletype (string as_filetype)
getdragdrop (unsignedlong aul_hdrop, ref string as_filenames[])
populate (unsignedlong aul_hdrop, datawindow adw_dw, string as_column)
populate (unsignedlong aul_hdrop, listbox alb_listbox)
populate (unsignedlong aul_hdrop, singlelineedit asle_sle)

Functions


begindragdrop

Description Register a control to be drag drop enabled.

Return integer

Access public

Arguments
Argument DataType Description
awo_windowobject windowobject Object to Be Registered


enddragdrop

Description Unregister a control from DragDrop.

Return (none)

Access public

Arguments
Argument DataType Description
awo_object windowobject Control to be unregistered


filterfiletype

Description Filter all droped files by a given file type such as pbl or exe.

Return integer

Access public

Arguments
Argument DataType Description
as_filetype string Filter File Type


getdragdrop

Description Get a list of all the files that where dragged and dropped on the given controls.

Return integer

Access public

Arguments
Argument DataType Description
aul_hdrop unsignedlong Handle of the Dropped Object
ref as_filenames[] string Array To receive the Filenames


populate

Description Populate a Datawindow with the dropped filenames.

Return integer

Access public

Arguments
Argument DataType Description
aul_hdrop unsignedlong handle of dropped control
adw_dw datawindow datawindow to populate
as_column string column to populate in the datawindow


populate

Description Populate a Listbox with the dropped filenames.

Return integer

Access public

Arguments
Argument DataType Description
aul_hdrop unsignedlong handle of dropped control
alb_listbox listbox ListBox to populate


populate

Description Populate a SingleLineEdit with the first dropped filename.

Return integer

Access public

Arguments (unsignedlong aul_hdrop, singlelineedit asle_sle)

Arguments
Argument DataType Description
aul_hdrop unsignedlong handle of dropped control
asle_sle2 singlelineedit SingleLineEdit to populate


Control List

nca_dragdrop

Ancestor

nonvisualobject autoinstantiate

Events

NameArgumentsReturn ValueDescription
constructor (none) (none) No processing
destructor (none) (none) Clean up any outstanding valid registered controls.

Structure List

(none)

Local External

// WIN 32 API Calls Required for drag and drop
subroutine DragAcceptFiles( long l_hWnd, boolean b_Accept ) library 'shell32'
subroutine DragFinish( long l_hWnd ) library 'shell32'
function int DragQueryFile( long l_hDrop, int i_File, ref string s_FileName, int i_cb ) library 'shell32'



Generated by PB2HTML. ( Unregistered Version )