Drag 'n Drop support

DavidN

Member
Licensed User
Does basic4ppc support drag 'n drop? If so, then How?

For example, can I rearrange a bunch of objects on the screen by tapping an object with the stylus and dragging it to a new location? Preferably with some kind of "snap to grid/object" capability.

Thanks

David

:sign0104:
 

RandomCoder

Well-Known Member
Licensed User
Longtime User
David,

Why not just check it out, it's free for 30 days so you've nothing to lose!

There's plenty of help here in our little forum so welcome and feel free to ask lots more questions.

Regards,
RandomCoder
 

DavidN

Member
Licensed User
Been away for a bit... now back to this problem....

I understand that the basic4ppc IDE supports drag 'n drop for designing forms, but what I meant was how would I develop an application that used a drag 'n drop type interface. In other words, I want to develop an app where the user can click on a control/image/icon with the stylus and drag it over to a new location. Possibly getting it to snap to a grid or other "anchor".

Thanks
 
Last edited:

BjornF

Active Member
Licensed User
Longtime User
Dear DavidN,

I think you can just use the focus property to select e.g. the image (image.focus=true when clicked) and then use the x and y of "mouse up" to get the new location on the form. Put the new x,y as e.g. the image.top and image.left.

If you want it to snap to a gridline you can construct your own using the integer values of a division (e.g. y=5*int(y/5) gives a grid line every 5th pixel).

This method does not show the intermediate steps however, so the control will be seen to jump from the present spot to where you perform the mouse up. Does this matter?

all the best, Björn
 

Cableguy

Expert
Licensed User
Longtime User
Or you can put yor image control as a child of a panel, wich supports mouse events, you can set the panel width an height to the image width and height and set the panel top and left according to mouse moves...
 

Cableguy

Expert
Licensed User
Longtime User
This will not work as the image click event will be raised and not the panel mouse down / move / up events.

I satnd corrected...
But if the panel is a bit larger and the user only taps the panel, then it should work?
 

DavidN

Member
Licensed User
Thanks!

Thanks everyone. :)

Figured out forelayer operation in forms, and a few other things that should provide a variety of ways to do what I want. Basic4ppc seems to be a great product, and the forum support is super. Thanks Erel for a product that makes me want to code stuff up just for the fun of it.

BTW I spent a week in Israel at the end of April. Really liked the land and the people. My friend and I rented a car in Haifa and drove around northern Israel for 2 days, before she spent a week at a physics conference in Zfat while I went to Eilat and on to Jordan.
 
Top