Solved
child cwnd detect other chlid cwnd --- magnetic cwnd?
Posted on 2002-05-06
I want to have 2 cbutton that if they are placed close to each other (say 30 pixels or so) they will attract eachother and stick together.
I have my own little hack of drag n' drop, and I can make the one cbutton link up with the second, if I know that it is close enough.
But, that is the problem I don't know what is the best way to tell if a cbutton is close to another cbutton.
I'd like the behavior to be in the MagButton class, not in my CDialog class.
the only solution I know how to work is by putting all my cbuttons that I will be using in a list, and then cycling through that list, looking at the RECTS to see where they are.
I don't like it because that code would have to go in the CDialog class.
I want code that could go in the MagButton class, ...
how can I tell from a child cwnd where other child cwnds are, and where they are.
that is my question
more details available if needed.
Thanks,
Bob