DaleA
Member
I am having a problem getting an image to drop onto an ImageView using the jDragAndDrop2 library. In the Designer, I added an ImageView, named ImgTarget, onto a Pane and made sure the ImageView is in front.. Below is the entire code I'm testing with.
Most of it was copied directly from the example supplied with the library.
The problem I'm seeing is that when I drag a .jpg image onto the ImageView it doesn't recognize that a drag gesture is being done and the log entry in ImgTarget_DragEntered doesn't get logged. The example program works fine so there must be something I'm doing wrong or something I missed. But what?
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private DragDrop2 As DragAndDrop
Private ImageIndex As Int
Private ImgTarget As ImageView
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
DragDrop2.Initialize(Me)
DragDrop2.MakeDragTarget(ImgTarget, "ImgTarget")
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
Sub ImgTarget_DragEntered(e As DragEvent)
Log("ImgTDragEntered")
End Sub
Most of it was copied directly from the example supplied with the library.
The problem I'm seeing is that when I drag a .jpg image onto the ImageView it doesn't recognize that a drag gesture is being done and the log entry in ImgTarget_DragEntered doesn't get logged. The example program works fine so there must be something I'm doing wrong or something I missed. But what?