nageswaragunupudi wrote:Can you make it more clear please? Does the dialog suddenly behave like a transparent dialog? Or the entire dialog becomes transparent showing the background behind the dialog like when using null brush?
nageswaragunupudi wrote:Can you post a sample code?
//--------- Backgrounds ------------------------
// c_path := CURDRIVE() + ":\" + GETCURDIR()
// Samples :
// ACTIVATE WINDOW oWnd MAXIMIZED ;
// ON INIT WND_BRUSH( oWnd, ; // Object to fill
// nWStyle, ; // 1=Color, 2=Gradient, 3=Brush, 4=Image, 5-7= Pred.-styles
// lWGrad, ; // .T. = vertical, .F. = horizontal
// nWColorF, ; // 1.Gradient- or plain Color with Style = 1
// nWColorB, ; // 2. Gradient-color
// nWGradPos, ; // Color-position 0 - 1
// cWBrush, ; // Brush
// cWImage ) // Image
// Embedded inside the Dialog, can be changed at Runtime
//
// DEFINE DIALOG oDlg SIZE 950, 600 OF oWnd PIXEL TRANSPARENT ;
// FONT oFont1 TITLE 'Title / xBrowse and Border'
//
// for Brush and Image only Filename, no Path
// WND_BRUSH( oDlg, nDStyle, lDGrad, nDColorF, nDColorB, nDPos, cDBrush, cDImage )
//
// ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
FUNCTION WND_BRUSH( cControl, nStyle, lDirect, nVColor, nBColor, nMove, cBrush, cImage )
LOCAL hDC, oBrush, oTmp
LOCAL aRect := GETCLIENTRECT( cControl )
LOCAL aGrad := { { nMove, nVColor, nBColor }, { nMove, nBColor, nVColor } }
IF nStyle = 1 // Color
DEFINE BRUSH oBrush COLOR nVColor
SET BRUSH OF cControl TO oBrush
RELEASE BRUSH oBrush
ENDIF
IF nStyle = 2 // Gradient
hDC = CreateCompatibleDC( cControl:GetDC() )
hBmp = CreateCompatibleBitMap( cControl:hDC, cControl:nWidth, cControl:nHeight )
hBmpOld = SelectObject( hDC, hBmp )
GradientFill( hDC, 0, 0, cControl:nHeight, cControl:nWidth, aGrad, lDirect )
DeleteObject( cControl:oBrush:hBrush )
oBrush := TBrush():New( ,,,, hBmp )
oBrush:Cargo := aGrad
SelectObject( hDC, hBmpOld )
cControl:ReleaseDC()
cControl:SetBrush( oBrush )
RELEASE BRUSH oBrush
ENDIF
IF nStyle = 3 // BMP-Brush
IF File( c_path + "\bitmaps\" + cBrush )
DEFINE BRUSH oBrush FILE c_path + "\Bitmaps\" + cBrush
SET BRUSH OF cControl TO oBrush
RELEASE BRUSH oBrush
ELSE
MsgAlert( "Cannot load : " + CRLF + ;
c_path + "\bitmaps\" + cDBrush, "Error" )
ENDIF
ENDIF
IF nStyle = 4 // Image
IF File( c_path + "\bitmaps\" + cImage )
DEFINE BRUSH oBrush FILE c_path + "\Bitmaps\" + cImage
SET BRUSH OF cControl TO oBrush
RELEASE BRUSH oBrush
ELSE
MsgAlert( "Cannot load : " + CRLF + ;
c_path + "\bitmaps\" + cDImage, "Error" )
ENDIF
ENDIF
IF nStyle = 5 // Style 1
DEFINE BRUSH oBrush STYLE BORLAND
SET BRUSH OF cControl TO oBrush
RELEASE BRUSH oBrush
ENDIF
IF nStyle = 6 // Style 2
DEFINE BRUSH oBrush STYLE BRICKS
SET BRUSH OF cControl TO oBrush
RELEASE BRUSH oBrush
ENDIF
IF nStyle = 7 // Style 3
DEFINE BRUSH oBrush STYLE TILED
SET BRUSH OF cControl TO oBrush
RELEASE BRUSH oBrush
ENDIF
RETURN NIL
ukoenig wrote:Enrico,
I'm using VISTA.
I changed my Background-function and it works on Windows and Dialogs without Problem.
Enrico Maria Giordano wrote:No, I'm using the present implementation as available in latest FWH release.
EMG
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Silvio.Falconi and 120 guests