TFOLDEX => Sample of transp. Radios and Checkbox ???

TFOLDEX => Sample of transp. Radios and Checkbox ???

Postby ukoenig » Thu Jan 27, 2011 11:51 pm

Hello,

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.

Image

Selected : Dialog = COLOR Folder = COLOR

Image

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 :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TFOLDEX => Sample of transp. Radios and Checkbox ???

Postby ukoenig » Sat Jan 29, 2011 3:06 pm

I finished the TFoldEx-Part.
Now it is possible, to Test any Settings of Class < TFOLDEX > at Runtime :
Still my Problem : transparent Radios and Checkboxes ( Result on Folder-page 1 )
I noticed : Tab-Height works at Runtime. Tab-Seperator doesn't work ( Dialog-Update needed )

Included :
1. Any Folder-Background / Dialog-Background-combination
2. Tab-Height
3. Tab BMP-Selection
4. Tab-Seperator
5. Tab-Font ( Style and Color )
( more Tests are possible if needed )

Image

Code: Select all  Expand view

// TAB-HEIGHT WORKS ON RUNTIME !!!
// --------------------------------------------
REDEFINE SELEX oSelex1 VAR nTabH OF oFld:aDialogs[2] ID 500 ;
ITEMS "20", "25", "30", "35" ;
GRADIENT OUTTRACK { { 0.5, 16770250, 16312263 }, ;
     { 0.5, 16312263, 16770250 } } ;
GRADIENT INTRACK { { 0.5, 8388608, 16312263 }, ;
     { 0.5, 16312263, 8388608 } } ;
THUMBSIZE 40, 30 ROUNDSIZE 5 ;
COLOR THUMB 14853684 ;
COLORTEXT 128, 32768 ;
TITLE "Tab-Heigh" TOP ;
FONT oFont5 ;
ACTION( IIF( oSelex1:nOption = 1, nTabH := 20, NIL ), ;
     IIF( oSelex1:nOption = 2, nTabH := 25, NIL ), ;
     IIF( oSelex1:nOption = 3, nTabH := 30, NIL ), ;
     IIF( oSelex1:nOption = 4, nTabH := 35, NIL ), ;
     oFld:nFolderHeight := nTabH, oFld:Refresh() ) ;
COLORTITLE 0
// At startup
IF nTabH = 20
     oSelex1:Setoption( 1 )
ENDIF
IF nTabH = 25
     oSelex1:Setoption( 2 )
ENDIF
IF nTabH = 30
     oSelex1:Setoption( 3 )
ENDIF
IF nTabH = 35
     oSelex1:Setoption( 4 )
ENDIF

// TAB-SEPERATOR DOESN'T WORK ON RUNTIME !!!
// ----------------------------------------------------------
REDEFINE SELEX oSelex2 VAR nTabS OF oFld:aDialogs[2] ID 510 ;
ITEMS "5", "10", "15"  ;
GRADIENT OUTTRACK { { 0.5, 16770250, 16312263 }, ;
     { 0.5, 16312263, 16770250 } } ;
GRADIENT INTRACK { { 0.5, 8388608, 16312263 }, ;
     { 0.5, 16312263, 8388608 } } ;
THUMBSIZE 40, 30 ROUNDSIZE 5 ;
COLOR THUMB 14853684 ;
COLORTEXT 128, 32768 ;
TITLE "Tab-Separator" TOP ;
FONT oFont5 ;
ACTION( IIF( oSelex2:nOption = 1, nTabS := 5, NIL ), ;
     IIF( oSelex2:nOption = 2, nTabS := 10, NIL ), ;
     IIF( oSelex2:nOption = 3, nTabS := 15, NIL ), ;
     oFld:nSeparator := nTabS, oFld:Refresh() ) ;
COLORTITLE 0
// At startup
IF nTabS = 5
     oSelex2:Setoption( 1 )
ENDIF
IF nTabS = 10
     oSelex2:Setoption( 2 )
ENDIF
IF nTabS = 15
     oSelex2:Setoption( 3 )
ENDIF
 


Best Regards
Uwe :?:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: TFOLDEX => Sample of transp. Radios and Checkbox ???

Postby ukoenig » Sat Jan 29, 2011 11:29 pm

The final Results of all TFOLDEX-tests ( 16 possible Combinations ) :

Infos about transparent painting of Say, Radios and Checkboxes You can find :
viewtopic.php?f=3&t=20766

On Dialog-Color :

Image

On Dialog-Gradient :

Image

On Dialog-Brush :

Image

On Dialog-Image :

Image

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests