FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Dialog Transparent
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Dialog Transparent
Posted: Sat Mar 23, 2013 05: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Dialog Transparent
Posted: 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



Code (fw): Select all Collapse
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 :-)
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.

Continue the discussion