ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg1:nHeight, .f. ), DisableX(oDlg, .T.), ;
SetImages( oDlg ) ) ;
ON PAINT ( DlgGrad( hDC, oDlg ), FolderGrad() )
RETURN ( NIL )
//--------------- Images on Folder-Pages ---------------//
FUNCTION SetImages( oDlg )
local oImageList
DEFINE IMAGELIST oImageList SIZE 16, 16
oImageList:AddMasked( TBitmap():Define( "head",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "foot",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "menue",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "zoom",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "image",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "project",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "index",, oDlg1 ), nRGB( 255, 0, 255 ) )
oImageList:AddMasked( TBitmap():Define( "gradient",, oDlg1 ), nRGB( 255, 0, 255 ) )
oFld:SetImageList( oImageList )
RETURN NIL
// ---------- Dialog - Gradient -------------------------------------
static func DlgGrad( hDC, oDlg )
local aGrad
aGrad := { { 0.50, 16054371, 8388608 },{ 0.50, 8388608, 16054371 } }
GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, .T. )
RETURN NIL
// --------- Folder - Gradient -------------------
FUNCTION FolderGrad()
local n, oDlg
for n = 1 to Len( oFld:aDialogs )
oDlg = oFld:aDialogs[ n ]
// Cyan and Red
oDlg:bPainted = { || GradientBrush( oDlg, oDlg:bPainted = { || GradientBrush( oDlg, ;
{ { 0.50, 16054371, 8388608 },{ 0.50, 8388608, 16054371 } }, .T.) }
next
RETURN NIL
// ------- Günther's Function ----------------------
FUNCTION GradientBrush( oDlg, aColors , lDir)
local hDC, hBmp, hBmpOld , nWidth , nHeight
DEFAULT lDir := .T.
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, aColors,lDir )
DeleteObject( oDlg:oBrush:hBrush )
oDlg:oBrush:hBitmap = hBmp
oDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC, hBmpOld )
oDlg:ReleaseDC()
endif
return nil
// --------------------- Disable EXIT - BUTTON -----------------
FUNCTION DisableX(oDlg, lDisable)
LOCAL hMenu := 0
LOCAL nCount := 0
IF lDisable
hMenu = GetSystemMenu(oDlg:hWnd, .F.)
nCount = GetMItemCount(hMenu)
IF oDlg:ClassName() = "TDIALOG"
RemoveMenu(hMenu, 1, nOR( 1024, 2) )
ELSE
RemoveMenu(hMenu, nCount - 1, nOR( 1024, 2) )
RemoveMenu(hMenu, nCount - 2, nOR( 1024, 2) )
ENDIF
DrawMenuBar( oDlg:hWnd )
ELSE
GetSystemMenu( oDlg:hWnd, .T. )
DrawMenuBar( oDlg:hWnd )
ENDIF
RETURN nil