![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 ![]()
__________________
Dell X50v WM2003 Wintec 100WBT GPS Great device... Dell should not have cancelled it!!!
|
|
|||
|
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
__________________
Dell X50v WM2003 Wintec 100WBT GPS Great device... Dell should not have cancelled it!!!
Last edited by DavidN : 08-09-2007 at 07:35 PM. Reason: clarification |
|
|||
|
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 |
|
||||
|
This is will not work as the Image control only supports the Click event (without the x,y position).
You should draw the image on the form and redraw it at the new position using MouseDown / MouseUp events (you could also use MouseMove event). It will be easier to do it on the ForeLayer. |
|
||||
|
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...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
|
||||
|
Quote:
But if the panel is a bit larger and the user only taps the panel, then it should work?
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| UDP support | jesb4ppc | Questions & Help Needed | 3 | 08-22-2008 12:52 PM |
| Click and drag during runtime | J12345T | Questions & Help Needed | 1 | 06-24-2008 09:37 AM |
| Drag Left / Right buttons on form issue. | badkarma | Bug Reports | 2 | 04-11-2008 11:50 AM |
| Support for GPS Support for GPS Intermediate Driver ? | tnetweather | Questions & Help Needed | 1 | 03-07-2008 06:41 PM |
| drag sprites | cpc6128 | Questions & Help Needed | 2 | 03-05-2008 02:29 PM |