• Welcome to PlanetSquires Forums.
 

Simple Graphics

Started by David Martin, April 04, 2004, 05:32:19 PM

Previous topic - Next topic

David Martin

How does one go about making simple grahics ( lines, boxes, circles ) on their forms?

Thanks,

David

TechSupport

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.

David Martin

An empty label is what I ended up using ... Frames are transparent.

Thanks,

David

David Martin

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.

TechSupport

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.

Ray King

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