function ChangeColors( oRb, aGrad )
local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
oRb:nBottom - oRb:nTopMargin + 1, aGrad )
local n
DeleteObject( oRb:hBrushEx )
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
oRb:Refresh()
for n = 1 to Len( oRb:aDialogs )
oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
oRb:aDialogs[ n ]:Refresh()
next
return nil
function ChangeColors( oRb, aGrad )
local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
oRb:nBottom - oRb:nTopMargin + 1, aGrad )
local n, j, z, oControl
oRb:aGrad := aGrad
DeleteObject( oRb:hBrushEx )
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
oRb:Refresh()
for n = 1 to Len( oRb:aDialogs )
DeleteObject( oRb:aDialogs[ n ]:hBack )
oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
if ! Empty( oRb:aDialogs[ n ]:aControls )
for j = 1 to len( oRb:aDialogs[ n ]:aControls )
oControl = oRb:aDialogs[ n ]:aControls[ j ]
if oControl:ClassName() == "TRBGROUP"
DeleteObject( oControl:hBrushUnsel )
oControl:hBrushUnsel = oRb:hBrushEx
DeleteObject( oControl:hBrushSel )
oControl:hBrushSel = nil
endif
next
endif
oRb:aDialogs[ n ]:Refresh()
next
return nil
// Basic-Settings
// -----------------
oRBar:nClrBoxOut := 128 // Ribbonbar-Outline-Color
oRBar:nClrBoxIn := 0 // Ribbonbar-Inline-Color
oRBar:nClrBoxSelOut := 32768
oRBar:nClrBoxSelIn := 32768
oRBar:aGradFld := { { 1, 16777215, 8293112 } } // Folder-Gradient
oRBar:aGradHigh := { { 1, 2279491, 10674091 } }
oRBar:aGradOver := { { 1, 13873022, 10674091 } }
oRBar:nHeightFld := 30 // Folder-Height
// Store all Settings in a Group-Array
// We use 5 Groups
// ----------------------------------------
PRIVATE aPara[5][4]
aPara[1][1] := { {0.12, 8388608, 16777215 }, { 0.12, 16777215, 8388608 } }
aPara[2][1] := { {0.12, 32768, 16777215 }, { 0.12, 16777215, 32768 } }
aPara[3][1] := { {0.12, 128, 16777215 }, { 0.12, 16777215, 128 } }
aPara[4][1] := { {0.12, 7715788, 16777215 }, { 0.12, 16777215, 7715788 } }
aPara[5][1] := { {0.12, 15987493, 16777215 }, { 0.12, 16777215, 15987493 } }
oFont1 := TFont():New("Arial", ,-15,.F.,.T. , , , ,.T. )
oFont2 := TFont():New("Arial", ,-12,.F.,.T. , , , ,.F. )
aPara[1][2] := oFont1
aPara[2][2] := oFont1
aPara[3][2] := oFont2
aPara[4][2] := oFont2
aPara[5][2] := oFont1
aPara[1][3] := 0
aPara[2][3] := 128
aPara[3][3] := 32768
aPara[4][3] := 0
aPara[5][3] := 32768
SET MESSAGE OF oWnd TO "Testing FWH own Class RibbonBar" ;
CENTERED CLOCK KEYBOARD 2007
ACTIVATE WINDOW oWnd ;
ON PAINT ChangeColors( oRBar )
oRBar:End()
oFont1:End()
oFont2:End()
RETURN NIL
// ----------------------------
FUNCTION ChangeColors( oRb )
local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
oRb:nBottom - oRb:nTopMargin + 1, aPara[1][1])
local n, j, z, oControl, cPos, oFont
oRb:aGrad := aPara[1][1]
DeleteObject( oRb:hBrushEx )
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
oRb:Refresh()
FOR n = 1 to Len( oRb:aDialogs )
DeleteObject( oRb:aDialogs[ n ]:hBack )
oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
IF ! Empty( oRb:aDialogs[ n ]:aControls )
FOR j = 1 to len( oRb:aDialogs[ n ]:aControls )
cPOS := Alltrim(Str(j))
oControl = oRb:aDialogs[ n ]:aControls[ j ]
IF oControl:ClassName() == "TRBGROUP"
DeleteObject( oControl:hBrushUnsel )
hBmp&cPos := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
oRb:nBottom - oRb:nTopMargin + 1, aPara[j][1] )
oRb:hBrushEx = CreatePatternBrush( hBmp&cPos )
DeleteObject( hBmp&cPos )
oControl:hBrushUnsel = oRb:hBrushEx
oControl:oFont := aPara[j][2]
oControl:nClrTxt := aPara[j][3]
DeleteObject( oControl:hBrushSel )
oControl:hBrushSel = nil
ENDIF
NEXT
ENDIF
oRb:aDialogs[ n ]:Refresh()
NEXT
oFont:End()
RETURN NIL
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 51 guests