PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Simple Graphics  (Read 855 times)

David Martin

  • Guest
Simple Graphics
« on: April 04, 2004, 05:32:19 PM »

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

Thanks,

David
Logged

TechSupport

  • Guest
Simple Graphics
« Reply #1 on: April 04, 2004, 05:54: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.
Logged

David Martin

  • Guest
Simple Graphics
« Reply #2 on: April 04, 2004, 06:05:26 PM »

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

Thanks,

David
Logged

David Martin

  • Guest
Simple Graphics
« Reply #3 on: April 04, 2004, 06:12: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.
Logged

TechSupport

  • Guest
Simple Graphics
« Reply #4 on: April 04, 2004, 06:18: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.
Logged

Ray King

  • Guest
Drawing Lines
« Reply #5 on: April 05, 2004, 11:17: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
Logged