How to draw a resizable rectangle

How to draw a resizable rectangle

Postby Rafael Clemente » Tue Feb 07, 2006 1:17 pm

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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby James Bott » Tue Feb 07, 2006 6:09 pm

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Rafael Clemente » Tue Feb 07, 2006 7:42 pm

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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby Rafael Clemente » Wed Feb 08, 2006 3:21 pm

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
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Postby James Bott » Wed Feb 08, 2006 4:47 pm

Glad to hear you got it working.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Paco Garcia » Thu Feb 09, 2006 8:51 pm

User avatar
Paco Garcia
 
Posts: 172
Joined: Fri Oct 07, 2005 12:00 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 69 guests