1. François Rossignol
  2. PowerBuilder
  3. Tuesday, 21 May 2019 11:52 AM UTC

Hi

 

I have a user object containing a datawindow which is a source for a drag and drop

The drop is supposed to occur in either another datawindow in the same object or in a datawindow in another window.

When the drag begin I show/hide some object in my userobject.

When the drop occurs I reverse the visible states.

So far so good.

 

But users being users they might drop on the mdi_1 object of the mdi window and I can't figure out a way to detect that. And I need to detect that to reverse the visible states.

 

Any ideas ?

 

Regards

Olan Knight Accepted Answer Pending Moderation
  1. Wednesday, 22 May 2019 14:23 PM UTC
  2. PowerBuilder
  3. # 1

In the DragDrop event, write a line to identify the target object, or both the source & target, to the MicroHelp, assuming you have MicroHelp enabled.

 

Olan

 

Comment
  1. François Rossignol
  2. Wednesday, 22 May 2019 14:33 PM UTC
Unless I missed something the dragDrop event is triggered only on the target.

And I can't figure out how to code events on the mdi_1 object inside my MDI window.

That's why I need to either be able to code something on my MDI (mdi_1) to detect the DragDrop OR I need to tell my source that the drag and drop has been dropped somewhere.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 May 2019 14:09 PM UTC
  2. PowerBuilder
  3. # 2

Hi François;

  Are you using "Auto" drag or are you using the manual (ie: program control) drag approach?

Regards ... Chris

Comment
  1. François Rossignol
  2. Friday, 24 May 2019 09:08 AM UTC
My Drag(Begin!) returns 1
  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 24 May 2019 15:14 PM UTC
A "1" = "Drag was cancelled". I wonder if this RC would be the norm on a drop of MDI_1?

(Just a thought)
  1. Helpful
  1. François Rossignol
  2. Wednesday, 29 May 2019 07:21 AM UTC
code I added to the drag function of my ancestor datawindow

---

int li_ret, li_fp

string ls_mode = ""

choose case m

case Begin!

ls_mode = "Begin!"

case End!

ls_mode = "End!"

case Cancel!

ls_mode = "Cancel!"

end choose



li_ret = super::drag(m)



li_fp = fileOpen("d:\drag.log",LineMode!,Write!,Shared!,Append!)

fileWrite(li_fp,this.dataobject + ":" + ls_mode + ":" + string(li_ret))

fileClose(li_fp)



return(li_ret)

---

Here is the different results I have in my log file

d_ng_bd_liste_factures_a_payer_dossier:Begin!:1

d_ng_bd_liste_factures_a_payer_dossier:Begin!:1

d_ng_bd_liste_factures_a_payer_dossier:Begin!:1



The return code 1=Canceled is for OLE Controls (according to PB17R3 documentation)

for other objects 1=SUCCESS



It's no big deal but I know I'll take some flack from users the day one of them drops the drag on mdi_1 :/
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.