Transparencia de controles

Post Reply
User avatar
Xevi
Posts: 168
Joined: Wed Nov 29, 2017 11:42 am
Location: Girona

Transparencia de controles

Post by Xevi »

Los controles pueden ser transparentes o opacos.
Así, segun en el ejemplo seguido, uno de los Edits se muestra transparente.
Pero, porqué el FolderEx no lo es???
Porqué hereda el Brush ???
Querria evitar ese mal efecto que provoca con un Brush, se repite autodimensionado al control ventana i Folder.

Y el Button, tampoco se puede poner transparent o debe de ser otra clase de Button???

Code: Select all

#include "FiveWin.ch"

FUNCTION Main()
   
   local oWnd, oBrush
   Local oEdit1, cVarEdit1 := "Edit1..."

   DEFINE BRUSH oBrush FILENAME "C:\FWH\BITMAPS\Sea.bmp" STRETCH

   DEFINE WINDOW oWnd FROM 1, 1 TO 800, 1450 PIXEL BRUSH oBrush
//   DEFINE DIALOG oWnd FROM 0, 0 TO 800, 1450 PIXEL BRUSH oBrush
//   oWnd:lTruePixel := .T. //Para DIALOG
   
   @ 325,25 EDIT oEdit1 VAR cVarEdit1 SIZE 300,22 LIMITTEXT BY 30 CHARS PIXEL OF oWnd
oEdit1:lTransparent := .T.

   ACTIVATE WINDOW oWnd ON INIT HazControls( oWnd )
//   ACTIVATE DIALOG oWnd ON INIT HazControls( oWnd )

Return Nil

//----------------------------------------------------------------------------//

Function HazControls( oWnd )

   local oFldr, oBtn
   Local oEdit2, cVarEdit2 := "Edit2..."
   Local oEdit3, cVarEdit3 := "Edit3..."

   oFldr := TFolderEx():New( 0, 0,600,250, oWnd,, .T., .F., {"Prime","Segu","Terce","Quart","Five","My Dialog"},,, 0,,,,, .F., 0,,, .F., "TOP",,, .F.,,, .T.,, .F.,, "oFldr" )
oFldr:lTransparent := .T.

   @ 25,25 BUTTON oBtn PROMPT "&FotoFons" OF oFldr:aDialogs[1] SIZE 100, 30 PIXEL
oBtn:lTransparent := .T.
   @ 75,25 EDIT oEdit2 VAR cVarEdit2 SIZE 300,22 LIMITTEXT BY 30 CHARS PIXEL OF oFldr:aDialogs[1]
oEdit2:lTransparent := .T.

   @ 275,25 EDIT oEdit3 VAR cVarEdit3 SIZE 300,22 LIMITTEXT BY 30 CHARS PIXEL OF oWnd
   
Return nil

 
Un Saludo,
Xevi.

Aprendiz de la vida!!!
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Transparencia de controles

Post by nageswaragunupudi »

Transparency is not implemented for BUTTON (TButton class) and BUTTONBMP (TButtonBmp class).
BTNBMP (TBtnBmp class) is painted transparently if :lTransparent is set to .T.
BTNBMP can also be painted translucently if required.

Implementation of transparency of Folder/Folderex and its dialogs over the main dialog's background is incomplete. We are reviewing this subject and it may take some time.
Till then Folder/FolderEx may be designed as independent container of dialogs with their own brushes.
Regards

G. N. Rao.
Hyderabad, India
Post Reply