Drag-Drop sample

This forum is for eXpress++ general support.
Message
Author
skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Drag-Drop sample

#1 Post by skiman »

Hi,

I wnat to use the drag-drop of the buttons. This isn't working as expected.

I added the following to the DRAGDROP.PRG sample.

Code: Select all

@ 0,0 dcpushbuttonxp caption "But 1" title "B1" size 15,2 ;
		DRAG {|oXbp| DC_GetProperty( oXbp, cGETLIST_TITLE ) } ;
		DROP {|oXbp,a| (wtf DC_GetProperty( oXbp, cGETLIST_TITLE ),a) }

@ 0,25 dcpushbuttonxp caption "But 2" title "B2" size 15,2 ;
		DRAG {|oXbp| DC_GetProperty( oXbp, cGETLIST_TITLE ) } ;
		DROP {|oXbp,a| (wtf DC_GetProperty( oXbp, cGETLIST_TITLE ),a) }
I expected that when I drag the Button 1 and drop it to button 2, I would get B1 , B2 in the WTF. It gives me B1 , B1. When I drag Button 2 to Button 1, I get B2, B2.

This isn't according to the documentation.

In attachment the modified dragdrop.prg for an easy test.
Attachments
DragDrop.zip
(2.32 KiB) Downloaded 755 times
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drag-Drop sample

#2 Post by skiman »

ok, it seems that a button can't be dropped on another button.

I can drop a line from the browse to the button, then I get the 'assign' sign/cursor. If you try to drop a button to another button, I get the 'forbidden' sign/cursor.

On a touch screen, I need to be able to 'swipe' a button to another button. How can I do this?
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drag-Drop sample

#3 Post by skiman »

Hi Roger,

Any idea how I could implement the drag/drop from one button to another?

It looks as it isn't working because of the focus remains on the button where the drag is started. The button where I want to drop, doesn't get focus.

In the source code there is the following:
METHOD DC_GetList:EventLoop

Here you can find : oXbp := SetAppFocus()

This gives the Button where the DRAG is started, because this still has focus.

I was looking for a way to change the focus when you start dragging on a button, but I don't succeed.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Drag-Drop sample

#4 Post by rdonnay »

Chris -

I have been overworked lately and decided I needed 3 days of in a cabin in the mountains.
I will be back Thursday night and will see what I can do for you when I get back.
I will not be bringing my computer with me.

Roger
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drag-Drop sample

#5 Post by skiman »

Enjoy your trip.
Best regards,

Chris.
www.aboservice.be

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drag-Drop sample

#6 Post by skiman »

Hi Roger,

Did you already had some time to check if you will find a solution to drag a button and drop him on another button?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Drag-Drop sample

#7 Post by rdonnay »

I just got back home.

I am trying to understand what you are trying to do.

Your issue is very confusing to me.

Are you saying that when you left click on a pushbutton you don't want it to activate, but instead you want it to drag?
The eXpress train is coming - and it has more cars.

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Drag-Drop sample

#8 Post by skiman »

Hi Roger,

The drag of the button is working, it is the drop to another button that isn't working.

In the first post I added the dragdrop sample where I added two buttons. If you test this sample you will see the following:
- Drag a button to another button isn't working.
- Drag a button to another object is working.
- Drag another object to a button is working.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Drag-Drop sample

#9 Post by rdonnay »

I am running your program and I can't get anything to work.

Dragging from a button does not do anything.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Drag-Drop sample

#10 Post by rdonnay »

Rather than try to figure out why your sample does not work, I decided instead to add 3 buttons on the DragDrop example that is in the \exp20\samples\dragdrop folder. The file is attached. It works just fine.
Attachments
dragdrop.zip
(2.31 KiB) Downloaded 747 times
The eXpress train is coming - and it has more cars.

Post Reply