MrKim Well-Known Member Licensed User Longtime User May 1, 2022 #1 I am at a loss how to get the Node that is being dragged from the _DragDetected event. Sender doesn't appear to work in _DragDetected. I was getting it from the _MousePressed event because that is the only thing that seems to happen before _DragDetected. However I switched to a BBCodeView because I want the property and it doesn't have a _MousePressed event. The items are in a customlistview and I need to know which item I am dragging as soon as the _DragDetected event happens. The data there tells me which Form to bring to the foreground to drag TO. Any help/ideas appreciated. I tried the CLV click event, but it too doesn't happen until after _DragDetected. Last edited: Jun 28, 2022
I am at a loss how to get the Node that is being dragged from the _DragDetected event. Sender doesn't appear to work in _DragDetected. I was getting it from the _MousePressed event because that is the only thing that seems to happen before _DragDetected. However I switched to a BBCodeView because I want the property and it doesn't have a _MousePressed event. The items are in a customlistview and I need to know which item I am dragging as soon as the _DragDetected event happens. The data there tells me which Form to bring to the foreground to drag TO. Any help/ideas appreciated. I tried the CLV click event, but it too doesn't happen until after _DragDetected.
stevel05 Expert Licensed User Longtime User May 1, 2022 #2 Try B4X: Copy e.As(JavaObject).RunMethod("getSource",Null) The event passed to the _DragDetected sub is a MouseEvent. Upvote 0
Try B4X: Copy e.As(JavaObject).RunMethod("getSource",Null) The event passed to the _DragDetected sub is a MouseEvent.
MrKim Well-Known Member Licensed User Longtime User May 2, 2022 #3 stevel05 said: Try B4X: Copy e.As(JavaObject).RunMethod("getSource",Null) The event passed to the _DragDetected sub is a MouseEvent. Click to expand... Code: Copy Sub DandD1_DragDetected(e As MouseEvent) Try Dim P As Pane = e.As(JavaObject).RunMethod("getSource",Null) ActiveMap = P.Tag Worked perfectly, Thank you. I wonder why Sender doesn't work. Upvote 0
stevel05 said: Try B4X: Copy e.As(JavaObject).RunMethod("getSource",Null) The event passed to the _DragDetected sub is a MouseEvent. Click to expand... Code: Copy Sub DandD1_DragDetected(e As MouseEvent) Try Dim P As Pane = e.As(JavaObject).RunMethod("getSource",Null) ActiveMap = P.Tag Worked perfectly, Thank you. I wonder why Sender doesn't work.
stevel05 Expert Licensed User Longtime User May 2, 2022 #4 MrKim said: I wonder why Sender doesn't work. Click to expand... Because the library is not a java library it's written in B4x and the event first goes to the wrapped draganddrop class and is then passed on to the class in which it was defined. The sender will be the draganddrop class. Upvote 0
MrKim said: I wonder why Sender doesn't work. Click to expand... Because the library is not a java library it's written in B4x and the event first goes to the wrapped draganddrop class and is then passed on to the class in which it was defined. The sender will be the draganddrop class.