Bug in radio button transparence

Bug in radio button transparence

Postby Enrico Maria Giordano » Tue Jan 06, 2009 11:08 pm

In the following sample the SAY is transparent while the RADIO isn't:

Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL nVar

    LOCAL hBmp := READBITMAP( 0, "c:\fwh\bitmaps\fivewin.bmp" )

    DEFINE DIALOG oDlg;
           TRANSPARENT

    @ 1, 5 SAY "This is a test"

    @ 2, 5 RADIO nVar;
           PROMPT "Test1", "Test2"

    ACTIVATE DIALOG oDlg;
             ON PAINT PALBMPDRAW( hDC, 0, 0, hBmp );
             CENTER

    DELETEOBJECT( hBmp )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in radio button transparence

Postby Antonio Linares » Wed Jan 07, 2009 12:34 am

Enrico,

Transparency has to be used with brushes. It is a Windows API limitation, not a bug.

This is the right way to do it:
Code: Select all  Expand view
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrush

    LOCAL nVar

    DEFINE BRUSH oBrush FILENAME "c:\fwh\bitmaps\fivewin.bmp"

    DEFINE DIALOG oDlg;
           TRANSPARENT BRUSH oBrush

    @ 1, 5 SAY "This is a test"

    @ 2, 5 RADIO nVar;
           PROMPT "Test1", "Test2"

    ACTIVATE DIALOG oDlg

    oBrush:End()

    RETURN NIL

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain



Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 46 guests