Draggable objects at runtime??

  • Thread starter Thread starter yesby
  • Start date Start date
Y

yesby

Hi

Is there a way to create a small rectangle object denoting a geographic location in Access 97 that at runtime the user can drag to the correct position on an underlying map created from a picture object. The rectangle object thus has a unique position (x,y) "locked in" for each record.

Thanks
 
yesby said:
Hi

Is there a way to create a small rectangle object denoting
a geographic location in Access 97 that at runtime the user
can drag to the correct position on an underlying map created
from a picture object. The rectangle object thus has a unique
position (x,y) "locked in" for each record.

Thanks
--

I have a solution but it uses a commercial ActiveX component
added to your Access form. Is this something you would consider
for your project ?

Our MetaDraw control can be placed on an Access form and can hold
a background picture ( for example an image of a map ) and then you
can add additional images or shapes ( such as a rectangle ) at
run-time.
You can optionally also allow the user to draw the rectangles with his
mouse.

Once inserted the rectangles ( or other shapes, text or images) can be
dragged around by the end-user or positioned by your code if you
prefer . You can even define a grid and force alignment to the grid
to assist user in positioning objects at grid points. You can of
course identify the new location either when the user completes
dragging, or at any time you can loop through all the shapes and
identify the location of each.

Each shape may also have additional hidden information - for instance
you might assign a key value from a record to each shape so you can
keep track of what each shape represents. The overall layout may
be zoomed, scrolled, printed, copied to clipboard, saved and reloaded
as an image in vector or raster format. ( if you save and reload in
vector format the associated data will still be preserved and user
will still be able to continue dragging the shapes )

If this is of interest to you, you can download MetaDraw for
evaluation from our web site at www.Bennet-Tec.com. Please also
refer to the notes on Access compatibility on the Compatibility page
of the web site.
A few tips to help you get started with demo
- To load background picture
Call LoadPicture method
with first parameter = file path / name
second parameter = 0
Then set BackPicture property = Picture property
Then call Clear method to remove image from foreground
- To add shape by code just call AddObject method
and give object type ( rectangle )
and coordinates ( left, top, right, bottom ).
- To allow user to draw rectangles with his mouse
just set EditMode property = 2
- To allow user to drag shapes with mouse set
EditMode = 11
- To identify where user has dropped the shape
just capture the Change event
check if ChangeType parameter is CHG_OBJECTMOVE
and read the ObjLeft, ObjTop, ObjRight and ObjBottom
properties
The coordinates will be in the range determined by
properties PicLeft, PicWidth, PicTop and PicHeight
- To print just set Current property = 5 ( pointing at whole
layout )
and then set ExportDC property = -1


Please post back if this meets your needs.

I hope this may be helpful to you.


* * * * Please include a copy of this message with your reply


Jeff Bennett
(e-mail address removed)


* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================
 
Back
Top