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:
00197718
Views:
20
David,

Yes, the objects are all within the same form.
RE form's method to manage objects that send a reference of themselves as parameters; it seems that's the only way to go at this point which is what I had in mind when I started working on this project. Later it occured to me that it must be a function in VFP that will let you detect objects at certain coordinates; and that's SYS(1270) which, if worked as I expected, would have simplified things by not having to manage and manipulate arrays of objects just to determine their overlap status.
The MakeSurePartOfMeIsVisible part I pretty much have it figured out. During Init() or Move(), the newly instatiated or moved object would notify both the overlapping and the overlapped object of its new status. Of course, each object of this type would have proprties for OverlappingObject, OverlappedObject and OverlapLevel which eventually determines each object offset form its original position. I chose this method because of speed, compared to a form's method that would rearrange all the objects.
It seems that I'm getting more and more into this type of geometrical algorithms, so I'll look for some documentation on this subject.

Thanks

>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.
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform