PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: David Martin on April 04, 2004, 06:02:19 PM

Title: Simple Graphics
Post by: David Martin on April 04, 2004, 06:02:19 PM
How does one go about making simple grahics ( lines, boxes, circles ) on their forms?

Thanks,

David
Title: Simple Graphics
Post by: TechSupport on April 04, 2004, 06:24:43 PM
Although I have not tried it, I assume that you can use the many Win32 API drawing functions in the the Form's WM_PAINT message. there is no builtin FireFly tool for lines, boxes and circles. Maybe the Frame control without a caption will suffice for a box.
Title: Simple Graphics
Post by: David Martin on April 04, 2004, 06:35:26 PM
An empty label is what I ended up using ... Frames are transparent.

Thanks,

David
Title: Simple Graphics
Post by: David Martin on April 04, 2004, 06:42:17 PM
There does seem to be a redraw or ordering issue tho ...

(1) Make an empty label and set its background to say blue.

(2) Create a command button and place it on the blue box.

(3) Click on the blue box/label and Send it to Back ... must use menu as the Right Click send to back does nothing.

(4) Now click on the blue box ... the command button disappears and does not come back.

If the command button is in front of the label then you should always see it ... even when the label is selected.
Title: Simple Graphics
Post by: TechSupport on April 04, 2004, 06:48:46 PM
Hi David,

Clicking on a control will always 'bring it to front'. In this case, selecting the label will bring it in front of the command button. I will take a look at my code to see if I can prevent this automatic bringing to front behaviour.

The right-click 'send to back' does not appear to be working. Thanks for catching that.
Title: Drawing Lines
Post by: Ray King on April 05, 2004, 11:47:35 AM
Hi Everyone,

You can use API calls to draw anything.

look at the following API's

MoveTo
LineTo
DrawEdge
DrawFrameControl

Fill a Rect faster then FillRect

SetBkColor( hWndDC, GetSysColor( %COLOR_BTNFACE ) )
ExtTextOut( hWndDC, 0, 0, %ETO_OPAQUE, rc, "", 0, 0 )

ExtTextOut fills the background for you just pass a null string.

Enjoy
Ray