I did more Tests on Dialog-Gradient and Folder.
Using the Brush-function for the transparent Say, It doesn't work on Folders.
The Gradient from the Dialog is used.
Result : Gradtest2.exe
More Tests with just a normal Gradient for Dialog and Folders, the Alpha-Channel
of the Buttons is not used.
Result : GradTest1.exe
Result : GradTest3.exe
( using the Brush-Function like for the Dialog, the Buttons are transparent.
but now, the Dialog uses the Folder-Color as well )
I included the comlete Working-directory inside the Download.
There are 3 Exe-files, to show the different results.
Download :
http://www.pflegeplus.com/fw_download/Gradtest.zip
For different Tests, You only need to change the ACTIVATE DIALOG - Part inside the PRG.
Everything You need, is included in the ZIP-file ( Make-File, Buttons, Resource ).
The Dialog-Function I think, it is no Solution for Folders.
Dialog and Folder doesn't work together.
Maybe there is a mistake, I have done somewhere inside the Tests.
// ----- DIALOG-GRADIENT for transparent SAY ----------
// ----- Doesn't work with Folder-Gradient
// ------------------------------------------------------
ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT ( DLG_ALPHA( hDC, oBMP1 ) ) ;
ON INIT ( DLG_GRAD2( oDlg, .T. ), ;
DLG_BAR( oDlg ), ;
FLD_GRAD( oFld, .F. ), ;
FLD_BAR( oFld ) )
// ----- using Normal Gradient-Function ------
// --------------------------------------------------
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( DLG_BAR( oDlg ), ;
FLD_BAR( oFld ) ) ;
ON PAINT ( DLG_GRAD1( oDlg, hDC, .T.), ;
FLD_GRAD( oFld, .F., oBMP1, oBMP2 ), ;
DLG_ALPHA( hDC, oBMP1 ) )
// ------------- normal DIALOG-GRADIENT -------------------------
FUNCTION DLG_GRAD1( oDlg, hDC, lDir)
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aDLG, lDir )
RETURN NIL
// ------------- DIALOG-GRADIENT for transparent SAY -------
FUNCTION DLG_GRAD2( oDlg, lDir)
local hDC, hBmp, hBmpOld, nWidth, nHeight, oBrush
IF Empty( oDlg:oBrush:hBitmap )
nHeight := if(lDir,oDlg:nHeight,1)
nWidth := if(lDir,1,oDlg:nWidth)
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, nWidth, nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, nHeight, nWidth, aDLG,lDir )
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
ENDIF
RETURN NIL
Slowly I'm helpless. Is there any Solution to solve the Problem ?
Best Regards
Uwe
