Olá Antonio,
Tem como usar a classe FOLDER dentro de uma WINDOW para que ela fique transparent igual ela fica da dialog ?
Veja a imagem abaixo usando o exemplo testfld3.prg
Obrigado,
Rossine.
// Dinamically building a folder ontop of a Dinamic DialogBox
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oDlg, oFld
DEFINE DIALOG oDlg TITLE "FiveWin Dynamic folders" ;
FROM 5, 5 TO 20, 50 COLOR "N/G"
@ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
OF oDlg SIZE 160, 90
@ 1, 1 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION Another( oFld ) // MsgInfo( "Hello world!" )
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//
function Another( oFld )
local oDlg
// DEFINE WINDOW oWnd TITLE "FiveWin Dynamic folders" ;
// FROM 5, 5 TO 20, 50 COLOR "N/G"
DEFINE DIALOG oDlg TITLE "FiveWin Dynamic folders" ;
FROM 5, 5 TO 20, 50 COLOR "N/BG"
// SetParent( oFld:hWnd, oWnd:hWnd )
/*
@ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
OF oWnd SIZE 260, 180
@ 1, 1 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION MsgInfo( "Hello world!" ) SIZE 80, 20
*/
ACTIVATE DIALOG oDlg ON INIT SetParent( oFld:hWnd, oDlg:hWnd )
return nil
//----------------------------------------------------------------------------//
1 24 "winxp\WindowsXP.Manifest"
// Dinamically building a folder ontop of a Dinamic DialogBox
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd, oFld
DEFINE window oWnd TITLE "Using folders with Twindows" ;
FROM 5, 5 TO 20, 50 color rgb(255,255,255), rgb(0,255,0)
@ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
OF oWnd SIZE 160, 90
@ 1, 1 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION another( oFld )
ACTIVATE window oWnd
return NIL
function another( ofld )
local oDlg
DEFINE dialog odlg TITLE "Using folders with TDialog" ;
FROM 5, 5 TO 20, 50 color rgb(255,255,255), rgb(0,255,0)
ACTIVATE DIALOG oDlg ON INIT SetParent( oFld:hWnd, oDlg:hWnd )
return nil
function Main()
local oWnd, oFld
DEFINE window oWnd TITLE "Using folders with Twindows" ;
FROM 5, 5 TO 20, 50 color rgb(255,255,255), rgb(0,255,0)
@ 0.5, 1 FOLDER oFld PROMPT "&xBase", "&And OOP", "&Power" ;
OF oWnd SIZE 160, 90
oFld:aDialogs[1]:bPainted := { || FillWnd ( oFld:aDialogs[1], ;
nRGB( 000, 255, 000 ) ) }
@ 1, 1 BUTTON "&Hello" OF oFld:aDialogs[ 1 ] ;
ACTION another( oFld )
ACTIVATE window oWnd
return NIL
function another( ofld )
local oDlg
DEFINE dialog odlg TITLE "Using folders with TDialog" ;
FROM 5, 5 TO 20, 50 color rgb(255,255,255), rgb(0,255,0)
ACTIVATE DIALOG oDlg ON INIT SetParent( oFld:hWnd, oDlg:hWnd )
return nil
Function FoldResize( oWnd, oFld )
Local oRect := oWnd:GetCliRect()
oFld:Move( 0, 0, oRect:nRight - oRect:nLeft, ;
oRect:nBottom - oRect:nTop , .T. )
Return Nil
Function FillWnd( oWnd, nColor, oBmp, nSaltos )
Local hWnd := oWnd:hWnd
Local aRect := GetClientRect( hWnd )
Local oBrush, n
Local nTop := aRect[ 1 ]
Local nBottom := aRect[ 3 ]
Local nSteps
Local nBlue, nRed, nGreen
Local lPuro := .F. // LoadIniPure() // Si es puro no hay degradado
// Color de degradado
DEFAULT nColor := 123123128 // LoadIni("MADRE","DegraDialog")
IF !Empty( oBmp )
IF UPPER(oWnd:ClassName()) == 'TDIALOG' // Si es un Dialogo
oWnd:GetDC()
PalBmpDraw( oWnd:hDC, 0, 0, oBmp:hBitmap )
oWnd:ReleaseDC()
ENDIF
WndCenter( oBmp:hWnd, oWnd:hWnd )
ENDIF
If lPuro == .T.
oWnd:SetColor( 0, nColor )
oWnd:Refresh()
Else
lPuro := .F.
Endif
If !lPuro // El color no es puro, entonces degradado
nBlue := nRGBBlue( nColor )
nRed := nRGBRed( nColor )
nGreen := nRGBGreen( nColor)
DEFAULT nSaltos := 3
nSteps := ( aRect[ 3 ] - aRect[ 1 ] ) / nSaltos
oWnd:GetDC()
aRect[ 3 ] = 0
For N = 1 to nSteps
aRect[ 3 ] += nSaltos
DEFINE BRUSH oBrush COLOR RGB( nRed, nGreen, nBlue )
FillRect( oWnd:hDC, aRect, oBrush:hBrush )
RELEASE BRUSH oBrush
aRect[ 1 ] += nSaltos
nBlue -= 1
nRed -= 1
nGreen -= 1
If nBlue < 0 ; nBlue += 1 ; Endif
If nRed < 0 ; nRed += 1 ; Endif
If nGreen < 0 ; nGreen += 1 ; Endif
Next N
oWnd:ReleaseDC()
Endif
Return Nil
DEFINE BRUSH oBrush FILE "CONTATO.BMP"
DEFINE DIALOG oDlg RESOURCE "BROWSE_CONTAS_A_PAGAR" ;
BRUSH oBrush TRANSPARENT
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 105 guests