posted 16 years ago
I assume you have gotten the drawing of the rectangle working now. Here are some things to consider when implementing the other points:
You need to think of what constitutes "selecting the rectangle" - which events do you need handle, and under which conditions should you consider a rectangle to be "selected"?
You also need to indicate which rectangle is selected - usually that's done by drawing little boxes around the corners and in the middle of the sides.
If you have several rectangles, a click may be targeted at any of them - think about how to choose which of the rectangles should be selected.
If a rectangle is selected, what does the user need to do to delete it? What event(s) do you need to handle for this?
Same for resizing - that generally occurs if a user clicks and drags one of the little boxes around the corners or at the middle of the sides. The corner boxes might allow the user to resize two sides at the same time, while the boxes at the side only allow a single side to be moved.
[ May 27, 2008: Message edited by: Ulf Dittmer ]