S
Simon L
I'm creating a GUI which is a bitmap with active areas, so when I paint
the dialog I calculate the rectangles containing objects.
When I get a click event, I want to know which (if any) rectangle
encompasses the click (so I know which object is clicked).
In the past I've created a vector of rectangles and gone though them
one by one testing for PointInRect or whatever but I reckon this is a
bit clunky, and I'm up to 100 or so objects on a screen.
So RECT is my reference to an object
POINT is what I need to test to get an object.
Any thoughts on what sort of collection could do this neatly for me?
Thanks.
the dialog I calculate the rectangles containing objects.
When I get a click event, I want to know which (if any) rectangle
encompasses the click (so I know which object is clicked).
In the past I've created a vector of rectangles and gone though them
one by one testing for PointInRect or whatever but I reckon this is a
bit clunky, and I'm up to 100 or so objects on a screen.
So RECT is my reference to an object
POINT is what I need to test to get an object.
Any thoughts on what sort of collection could do this neatly for me?
Thanks.