Dialog Transparent

Re: Dialog Transparent

Postby nageswaragunupudi » Sat Mar 23, 2013 5:45 am

You can make either one colour in a Window/Dialog totally transparent by setting oWnd:nSeeThroClr := <nColor>. You can set this to any colour even at run time and even change during runtime. In the above case we set the background color of oDlg as RGB(1,1,1) and set it as transparent colour (nSeeThroClr ). To cancel, set this DATA to nil.

Alternatively, you can set oWnd:nOpacity := <nLevel> // 0 to 255
// 0 is fully transparent (no use at all) and 255 is fully opaque ( not at all transparent)

This make entire window / dialog transparent/translucent depending on the value of nOpacity.

You can set this value and change it at any time during runtime also. You can make fade-in fade-out effects too.

These two features are built in the Widow class (apply to all windows and dialogs) from FWH10.12.

These features internally use the same function that Antonio posted above : trans(oDlg).
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Dialog Transparent

Postby ukoenig » Fri Jul 26, 2019 12:58 pm

A mixed solution of oWnd:nSeeThroClr and oWnd:nOpacity :
For the transparent-display < oWnd:nSeeThroClr > is used.
this must be disabled again for color / opaque-display

Image

Code: Select all  Expand view  RUN

REDEFINE RADIO oRadio2 VAR nTrLevel ID 740, 741, 742, 743  OF oFld:aDialogs[ 2 ] UPDATE ;
ON CHANGE  TR_LEVEL( nTrLevel )            
AEval( oRadio2:aItems, { | oRad | oRad:lTransparent := .T., ;
     oRad:SetFont ( oFontsys ), ;
     oRad:nClrText := 0 } )

STATIC FUNCTION TR_LEVEL( nTrLevel )

IF nTrLevel = 1             // full color
    oWnd:nSeeThroClr := NIL // needed if 4 was selected before
    aVal[5] := 255              // save opaque selection to var
    oWnd:nOpacity := aVal[5]
ELSEIF nTrLevel = 2
    oWnd:nSeeThroClr := NIL // needed if 4 was selected before
    aVal[5] := 160              // Opacity
    oWnd:nOpacity := aVal[5]
ELSEIF nTrLevel = 3
    oWnd:nSeeThroClr := NIL // needed if 4 was selected before
    aVal[5] := 80               // Opacity
    oWnd:nOpacity := aVal[5]
ELSEIF nTrLevel = 4         // window color transparent
    aVal[5] := 0
    oWnd:nSeeThroClr := aVal[21] // color transparent
ENDIF

RETURN( NIL )
 


regards
Uwe :D
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Previous

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests