B4J Library [class] DragDropFloatField - Very simple Drag Drop implementation for B4XFloatTextField

Depends on jDragAndDrop2: https://www.b4x.com/android/forum/threads/jdraganddrop2-drag-and-drop.76168/#content

java_MCFed1CSMd.gif



Usage:
Accept all types of files and folders:
Code: Copy
Dim dd As DragDropFloatField
dd.Initialize(txtDialog) 'txtDialog is a B4XFloatTextField
Limit to specific extensions:
Code: Copy
dd.Initialize(txtDialog, Array(".png", ".jpg"))
Handle the DragDropped event:
Code: Copy
dd.Initialize(txtDialog, Null, "dd")

Private Sub dd_DragDropped
 ...

Note that by default the B4XFloatTextField is set to be non-editable. This behavior can be disabled by setting MakeViewReadonly parameter to False in the initialize method.

There is also an Enabled class variable that can be set to False to disable feature.
 

Attachments

Back
Top