Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoid overlapping objects or SYS(1270)
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00196959
Message ID:
00197398
Views:
21
Sorin,

It sounds like the objects are all within the same parent container like a Form? If so just have the object send a reference to itself to a method of the container of all the objects. That method can iterate through everything in it's Controls[] collection and adjust the position of the object accordingly. So the object Init() and Move() would:

this.parent.MakeSurePartOfMeIsVisible( this )

Get a textbook on graphics algorithms, you should be able to find a couple of ways to efficiently test for object overlap. Check also for clipping algorithms.

>Objtoclient() was the first thing I thought of, however for using Objtoclient() you must specify the object to find its position and I need a function that would evaluate the position and return the object at that position -like SYS(1270, nX, nY). The problem is that SYS(1270) needs nX and nY to be absolute screen coordinates.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform