My first Tests with included Folder :
I added a Dialog with Folder TFOLDEX to test different Backgrounds
and transparency of SAY, RADIO and CHECKBOX.
I can switch between normal Dialog and Dialog with included Folder.
The Dialog with Folder is using the Background, defined for Dialog
and extra new Backgrounds, defined for the Folder.
Now it is possible, to create combinations between Window, Dialog and Folder.
I have some problems with Radio's and Checkboxes inside Folderpages.
SAY works fine as well the Tab-area without any problems.
Is there any working sample for it ( on different Backgrounds ) ?
Radios and Checkboxes working fine, using Manuel Mercados TSRADIO.
Selected : Dialog = COLOR Folder = COLOR
- Code: Select all Expand view
// oWndFld is defined STATIC in Main-function !!!!
FUNCTION TEST_FOLDER(nPos)
LOCAL hDC, hDC1, oTmp, oBtn10, oBtn11, nRadio3 := 1, lCheck3 := .T.
LOCAL oSay3, oRadio3, oCheck3, oBrush5, oTitle1, cTitle := "", cTitle1 := ""
LOCAL oFld, aPrompts := { " Tab& 1", " Tab &2", " Tab &3" }
lFldActive := .T.
// Selected Dialog-Background
// --------------------------------
IF nOption2 = 1
cTitle1 := "COLOR"
ENDIF
IF nOption2 = 2
cTitle1 := "GRADIENT"
ENDIF
IF nOption2 = 3
cTitle1 := "BRUSH"
ENDIF
IF nOption2 = 4
cTitle1 := "IMAGE"
ENDIF
// Selected Folder-Background
// ----------------------------------
IF nPos = 1
cTitle := "Selected Dialog = " + cTitle1 + " / Folder = COLORS"
ENDIF
IF nPos = 2
cTitle := "Selected Dialog = " + cTitle1 + " / Folder = GRADIENT"
ENDIF
IF nPos = 3
cTitle := "Selected Dialog = " + cTitle1 + " / Folder = BRUSH"
ENDIF
IF nPos = 4
cTitle := "Selected Dialog = " + cTitle1 + " / Folder = IMAGE"
ENDIF
// Selected Dialog-Background
// --------------------------------
IF nOption2 = 1 // Color
DEFINE BRUSH oBrush5 COLOR nColor2a
DEFINE DIALOG oWndFld RESOURCE "Painter5" OF oWndMain PIXEL TRANSPARENT ;
TITLE "Dialog-Test ( COLORS)" BRUSH oBrush5
oBrush5:End()
ENDIF
IF nOption2 = 2 // Gradient
DEFINE DIALOG oWndFld RESOURCE "Painter5" OF oWndMain PIXEL TRANSPARENT ;
TITLE "Dialog-Test (GRADIENT)"
ENDIF
IF nOption2 = 3 // brush
DEFINE BRUSH oBrush5 FILENAME cBrush2
DEFINE DIALOG oWndFld RESOURCE "Painter5" OF oWndMain PIXEL TRANSPARENT ;
TITLE "Dialog-Test (BRUSH)" BRUSH oBrush5
oBrush5:End()
ENDIF
IF nOption2 = 4 // adjusted Image
DEFINE IMAGE oTmp FILENAME cImage2
DEFINE DIALOG oWndFld RESOURCE "Painter5" OF oWndMain PIXEL TRANSPARENT ;
TITLE "Dialog-Test ( IMAGE)"
oBrush5 := TBrush():new( ,,,, ResizeBmp( oTmp:hBitmap, 400, 300, .T. ) )
oWndDlg:SetBrush( oBrush5 )
oTmp:End()
oBrush5:End()
ENDIF
REDEFINE FOLDEREX oFld ID 110 PROMPT "Tab &1", "Tab &2", "Tab &3" ;
BITMAPS c_Path + "\bitmaps\16edit.bmp", c_Path + "\bitmaps\16edit.bmp", c_Path + "\bitmaps\16edit.bmp" ;
DIALOGS "Sub1", "Sub2", "Sub3" ;
ROUND 5
oFld:lTransparent := .T.
oFld:nFolderHeight := 25
oFld:nSeparator := 5
oFld:bClrText := {| o, n | nTColor }
oFld:oFont := oFont1
REDEFINE SAY oSay3 ID 110 PROMPT cTEXTFONT1 OF oFld:aDialogs[1] FONT oTextFont PIXEL
oSay3:SetColor( nTColor, )
oSay3:lTransparent := .T.
REDEFINE RADIO oRadio3 VAR nRadio3 OF oFld:aDialogs[1] ID 120, 121 ;
ON CHANGE MsgBeep() ;
COLOR nTColor
oRadio3:SetFont( oTextFont )
AEval( oRadio3:aItems, { | oRad | oRad:lTransparent := .T. } )
REDEFINE CHECKBOX oCheck3 VAR lCheck3 ID 130 OF oFld:aDialogs[1] ;
ON CHANGE oCheck3:SetText( "New Text" )
oCheck3:lTransparent := .T.
oCheck3:SetFont( oTextFont )
oCheck3:SetColor( nTColor )
ACTIVATE DIALOG oWndFld NOWAIT ;
ON INIT ( oWndFld:Move( 50, 580, NIL, NIL, .T. ), ;
IIF( nOption2 = 2, GRADBRU(), NIL ) ) ;
ON PAINT F_BACKGRD( nPos, oFld, hDC, ;
nMOVE3, nCOLOR3a, nCOLOR3b, lDIRECT3, ;
cBRUSH3, cIMAGE3 )
RETURN NIL
// -------- Folder - Background ---------------
// used FOLDER-Vars
// ----------------------
// nMove3 := 0.50
// nColor3a := 14853684
// nColor3b := 16312263
// aColors3 := { { nMove3, nColor3a, nColor3b }, { nMove3, nColor3b, nColor3a } }
// lDirect3 := .T.
// nPos3a := 10 // Browser-Pos. 1. Color
// nPos3b := 10 // Browser-Pos. 2. Color
// cBrush3 := "Marble.bmp"
// cImage3 := "Back1.jpg"
FUNCTION F_BACKGRD( nStyle, oFld, hDC, nMove, nColor1, nColor2, lDirect, cBrush, cImage )
LOCAL n, oDlg, oBrush2
LOCAL oTmp, aColors := { { nMOVE, nCOLOR1, nCOLOR2 }, { nMOVE, nCOLOR2, nCOLOR1 } }
FOR n := 1 to Len( oFld:aDialogs )
oDlg := oFld:aDialogs[ n ]
IF nStyle = 1 // Color
DEFINE BRUSH oBrush2 COLOR nCOLOR1
SET BRUSH OF oDlg TO oBrush2
RELEASE BRUSH oBrush2
ENDIF
IF nStyle = 2 // Gradient
oDlg:bPainted := { | hDC | GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aColors, lDirect ) }
ENDIF
IF nStyle = 3 // Brush
oDlg:bPainted := { | hDC | F_TILED( hDC, oDlg, oDlg:nHeight, oDlg:nWidth, cBrush ) }
ENDIF
IF nStyle = 4 // Image
oDlg:bPainted := { | hDC | F_FULL( hDC, oDlg, oDlg:nHeight, oDlg:nWidth, cImage ) }
ENDIF
IF nStyle = 5 // Style
DEFINE BRUSH oBrush2 STYLE BORLAND // BORLAND BRICKS TILED
SET BRUSH OF oDlg TO oBrush2
RELEASE BRUSH oBrush2
ENDIF
NEXT
RETURN( NIL )
// -------- Folder Tiled Image BRUSH --------------------------------
FUNCTION F_TILED( hDC, oDlg, nHeight, nWidth, cBrush )
LOCAL oImage
DEFINE IMAGE oImage FILENAME c_Path + "\bitmaps\" + cBrush
oBrush := TBrush():new( ,,,, PalBmpDraw( hDC, 0, 0, oImage:hBitmap, , nWidth, nHeight, , .T. ) )
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
RETURN( NIL )
// ---------- Folder FULL Image --------------
FUNCTION F_FULL( hDC, oDlg, nHeight, nWidth, cImage )
LOCAL oImage
DEFINE IMAGE oImage FILENAME c_Path + "\bitmaps\" + cImage
aRect := GETCLIENTRECT( oDlg:hWnd )
oBrush := TBrush():new( ,,,, PalBmpDraw( hDC, 0, 0, oImage:hBitmap, , nWidth, nHeight, , .T. ) )
oDlg:SetBrush( oBrush )
RELEASE BRUSH oBrush
RETURN( NIL )
Best Regards
Uwe