...
...
ACTIVATE DIALOG oDlg1 CENTER ;
ON INIT F_BACKGRD( oFld1, .T. )
RETURN NIL
// -------- FOLDER - Backgrounds ( n are the different folderpages ) ---------------
FUNCTION F_BACKGRD( oFld, lTransp )
LOCAL n, oDlg, hDC, oBrush, oImage, nRow := 0, nCol := 0
oFld:lTransparent := lTransp
FOR n := 1 to Len( oFld:aDialogs )
oDlg := oFld:aDialogs[ n ]
hDC = CreateCompatibleDC( oDlg:GetDC() )
IF n = 1
IF !FILE( c_path1 + "Marble.bmp" )
MsgAlert( "File : " + c_path1 + "Marble.bmp" + CRLF + ;
"does not exist to create" + CRLF + ;
"Brush-Background !", "ATTENTION" )
ELSE
DEFINE BRUSH oBrush FILENAME c_path1 + "Marble.bmp"
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
ReleaseDC(hDC)
ENDIF
ENDIF
IF n = 2
DEFINE BRUSH oBrush COLOR 16107689
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
ReleaseDC(hDC)
ENDIF
IF n = 3 // GRADIENT
aGrad := { { 0.9, 16107689, 16777215 }, { 0.9, 16777215, 16107689 } }
hDC = CreateCompatibleDC( oDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nRight * 2.1, ( oDlg:nBottom * 2.1 ) - 40 )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, ( oDlg:nBottom * 2.1 ) - 40, oDlg:nRight * 2.1, aGrad, .T. ) // .T: = Vertical
DeleteObject( oDlg:oBrush:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
ReleaseDC(hDC)
ENDIF
IF n = 4 // Image ADJUSTED
DEFINE IMAGE oImage FILE c_path1 + "Backgrd.jpg"
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, oDlg:nWidth, oDlg:nHeight, .T. ) )
oImage:End()
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
ReleaseDC(hDC)
ENDIF
IF n = 5 // Image ADJUSTED
DEFINE IMAGE oImage FILE c_path1 + "Backgrd.jpg"
oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, oDlg:nWidth, oDlg:nHeight, .T. ) )
oImage:End()
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
ReleaseDC(hDC)
ENDIF
AEval( oDlg:aControls, { |o| IF( o:ClassName == "TSAY", ( o:SetColor( nTxtColor, 13885951 ), o:Refresh() ), NIL ) } )
NEXT
RETURN( NIL )