Page 1 of 1

How to draw a resizable rectangle

Posted: Tue Feb 07, 2006 1:17 pm
by Rafael Clemente
Anybody could give me an idea about how to draw a resizable rectangle on a Dialog?. I mean, the kind of rectangle used to select a region of a Bitmap, that expands and contacts as you move the mouse. I have tried several aproaches with Rectange(), RectDot() and LineTo() but I am sure it must be a simpler way.
Thanks
Rafael

Posted: Tue Feb 07, 2006 6:09 pm
by James Bott
Rafael,

You might look at the incomplete IDE samples that come with FW. I can't remember if there was such an thing for dialog design, but it is worth a look.

James

Posted: Tue Feb 07, 2006 7:42 pm
by Rafael Clemente
James:
Thank you. I had erased long ago my FW folder. I have re-installed it and found the program you suggested. I'm going to take a long look at it.
Thks
Rafael

Posted: Wed Feb 08, 2006 3:21 pm
by Rafael Clemente
James:

Thank you for your suggestion. Problem solved. The trick -in case it can be of use to anybody esle- is to use bMMoved() and bLClicked() together with DrawFocusRect() and call this last function twice: The first to erase the previous rectangle, the second to draw it in a sligtly different place.

Best regards,
Rafael

Posted: Wed Feb 08, 2006 4:47 pm
by James Bott
Glad to hear you got it working.

Posted: Thu Feb 09, 2006 8:51 pm
by Paco Garcia