#include "FiveWin.ch"
#include "Ribbon.ch"
#define _nClrPaneRB RGB( 68, 68, 68 )
#define _nClrBoxOutRB RGB( 178, 178, 178 )
#define _nClrBoxInRB RGB( 178, 178, 178 )
#define _nClrBoxSelOut RGB( 178, 178, 178 )
#define _aGradRB { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } }
#define _aGradFldRB {|nOpt| iif( nOpt == oRibbon:nStart, { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } },;
{ { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } } ) }
#define _aGradHighRB { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } }
#define _aGradOverRB { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } }
#define _nCtrlFrGround RGB( 255, 255, 255 )
#define _nCtrlBkGround RGB( 106, 106, 106 )
#define _nClrBoxOut RGB( 160, 160, 160 )
#define _nClrBoxIn RGB( 160, 160, 160 )
#define _nClrTxt RGB( 0, 0, 0 )
#define _bClrGradNormal {|lPressed| iif( lPressed, { { 1, _nClrBoxOut, _nClrBoxOut } },;
{ { 1, _nClrBoxOut, _nClrBoxOut } } ) }
#define _aClrGradUnder {|| { { 1, _nClrBoxOut, _nClrBoxOut } } }
#define _aClrGradBack { { 1, _nClrBoxOut, _nClrBoxOut } }
function Main()
local oFont
local n, oWnd, oRibbon
local aDlgs
DEFINE FONT oFont NAME 'Verdana' SIZE 0, -12
DEFINE WINDOW oWnd
aDlgs := { 'About', 'PettyCash', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine' }
oRibbon := TRibbonBar():New( oWnd, aDlgs,,,, 120, 40, _nClrPaneRB, _nClrBoxOutRB, _nClrBoxInRB,,;
_nClrBoxSelOut, _aGradRB, _aGradFldRB, _aGradHighRB, _aGradOverRB,,,,,.T.)
WITH OBJECT oRibbon
:nHeightFld := 26
:hSeparation := 4
:SetFont( oFont )
FOR n := 1 TO Len( :aPrompts )
:aClrTabTxt[ n ] := { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, RGB( 0, 0, 0 ), RGB( 255, 255, 255 ) ) }
NEXT
:CalcPos()
END
oWnd:SetSize( 1200, 800 )
ACTIVATE WINDOW oWnd CENTER
return nil
#include "FiveWin.ch"
#include "ribbon.ch"
#define RB_THEME_DARK 6
#define RB_THEME_BLUE 7
#define RB_THEME_RED 8
#define RB_THEME_GREEN 9
#define RB_THEME_ORANGE 10
#define RB_THEME_PURPLE 11
#define CLR_MSBLUE RGB( 43, 87, 154 )
#define CLR_MSLIGHTGRAY RGB( 243, 243, 243 )
#define CLR_MSGRAY RGB( 198, 198, 198 )
#define CLR_DARKGRAY RGB( 54, 54, 54 )
#define CLR_MSRED RGB( 164, 55, 58 )
#define CLR_MSORANGE RGB( 184, 72, 43 )
#define CLR_MSPURPLE RGB( 128, 57, 123 )
#define CLR_MSBLUE1 RGB( 1, 115, 199 )
#define CLR_MSBLUE2 RGB( 57, 85, 163 )
#define CLR_MSBLUE3 RGB( 42, 87, 154 )
#define CLR_MSGREEN1 RGB( 49, 117, 47 )
#define CLR_MSGREEN2 RGB( 7, 117, 104 )
#define CLR_MSGREEN3 RGB( 34, 116, 71 )
#define COLOR_GRAYTEXT 17
//----------------------------------------------------------------------------//
function Main()
local oWnd
DEFINE WINDOW oWnd
oWnd:SetSize( 1200, 800 )
BuildRibbon( oWnd )
ACTIVATE WINDOW oWnd CENTER // MAXIMIZED
return nil
//----------------------------------------------------------------------------//
function BuildRibbon( oWnd )
local oRb := TRibbonBar():New( oWnd ), oGroup, oBtn, oMenu
MENU oMenu POPUP
MENUITEM "Dark" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_DARK ), oRb:Refresh() )
MENUITEM "Blue" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_BLUE ) , oRb:Refresh() )
MENUITEM "Green" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_GREEN ), oRb:Refresh() )
MENUITEM "Red" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_RED ), oRb:Refresh() )
MENUITEM "Orange" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_ORANGE ), oRb:Refresh() )
MENUITEM "Purple" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_PURPLE ) , oRb:Refresh() )
ENDMENU
oRb:SetStyles( .F., .T. )
oGroup = oRb:AddGroup( 185, "First", 1 )
oBtn = oGroup:AddButton( 3, 3, oGroup:nHeight - 19, 90, "One", { || MsgInfo( "One" ) } )
oBtn:LoadBitmaps( "..\bitmaps\32x32\cascade.bmp" )
oBtn = oGroup:AddButton( 3, oBtn:nWidth + 3, oGroup:nHeight - 19, 90, "Two", { || MsgInfo( "Two" ) } )
oBtn:LoadBitmaps( "..\bitmaps\32x32\tiled.bmp" )
oGroup = oRb:AddGroup( 185, "Second", 1 )
oBtn = oGroup:AddButton( 3, 3, oGroup:nHeight - 19, 90, "Three" )
oBtn:LoadBitmaps( "..\bitmaps\32x32\world.bmp" )
oBtn = oGroup:AddButton( 3, oBtn:nWidth + 3, oGroup:nHeight - 19, 90, "Four" )
oBtn:LoadBitmaps( "..\bitmaps\32x32\task.bmp" )
oGroup = oRb:AddGroup( 75, "Styles", 1 )
@ 3,5 ADD BUTTON oBtn ;
PROMPT "Change" BITMAP "..\bitmaps\stylechange32.BMP";
GROUP oGroup MENU oMenu ;
SPLITPOPUP SIZE 65,75 TOP
SetRibbonBarTheme( oRb, RB_THEME_BLUE ) // as default
return oRb
//----------------------------------------------------------------------------//
function SetRibbonBarTheme( oRb, nTheme )
local oDlg, oGroup, oBtn
oRb:nHeight = 130
oRb:nHeightFld = 20
oRb:hSeparation = 4
oRb:nLeftMargin = 20
oRb:nRoundBox = 0
do case
case nTheme == RB_THEME_DARK
oRb:nClrPaneRB = CLR_BLACK
oRb:nClrBoxOut = CLR_DARKGRAY
oRb:nClrBoxIn = CLR_DARKGRAY
oRb:nClrBoxSelOut = CLR_DARKGRAY
oRb:nClrBoxSelIn = CLR_DARKGRAY
oRb:aGrad = { { 1, CLR_DARKGRAY, CLR_DARKGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_DARKGRAY, CLR_DARKGRAY } },;
{ { 1, CLR_DARKGRAY, CLR_DARKGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_WHITE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_WHITE, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:nClrBoxOut = CLR_LIGHTGRAY
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = nil
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_WHITE }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_GRAY, CLR_GRAY } },;
{ { 1, CLR_GRAY, CLR_GRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oBtn:nClrBoxIn = CLR_LIGHTGRAY
oBtn:nClrBoxOut = CLR_LIGHTGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_BLUE
oRb:nClrPaneRB = CLR_MSBLUE
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSBLUE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSBLUE // CLR_LIGHTGRAY
oGroup:nClrBoxOut = CLR_MSBLUE // CLR_LIGHTGRAY
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_RED
oRb:nClrPaneRB = CLR_MSRED
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSRED, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSRED
oGroup:nClrBoxOut = CLR_MSRED
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_GREEN
oRb:nClrPaneRB = CLR_MSGREEN1
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSGREEN2, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_MSGREEN2
oGroup:aGradCaption = { { 1, CLR_MSGREEN3, CLR_MSGREEN3 } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_MSLIGHTGRAY ) }
oGroup:nClrBoxIn = CLR_MSGREEN3
oGroup:nClrBoxOut = CLR_MSGREEN3
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGREEN1, CLR_MSGREEN1 } },;
{ { 1, CLR_MSGREEN2, CLR_MSGREEN2 } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGREEN3, CLR_MSGREEN3 } } }
oBtn:aClrGradBack = { { 1, CLR_MSGREEN1, CLR_MSGREEN1 } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_ORANGE
oRb:nClrPaneRB = CLR_MSORANGE
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSBLUE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSORANGE // CLR_LIGHTGRAY
oGroup:nClrBoxOut = CLR_MSORANGE // CLR_LIGHTGRAY
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_PURPLE
oRb:nClrPaneRB = CLR_MSPURPLE
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSBLUE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSPURPLE
oGroup:nClrBoxOut = CLR_MSPURPLE
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
endcase
oRb:Default()
return nil
//----------------------------------------------------------------------------//
#include "FiveWin.ch"
#include "ribbon.ch"
#define RB_THEME_2007 1
#define RB_THEME_2010 2
#define RB_THEME_2013 3
#define RB_THEME_2015 4
#define RB_THEME_2016 5
#define RB_THEME_DARK 6
#define RB_THEME_BLUE 7
#define RB_THEME_RED 8
#define RB_THEME_GREEN 9
#define RB_THEME_ORANGE 10
#define RB_THEME_PURPLE 11
#define CLR_MSBLUE RGB( 43, 87, 154 )
#define CLR_MSLIGHTGRAY RGB( 243, 243, 243 )
#define CLR_MSGRAY RGB( 198, 198, 198 )
#define CLR_DARKGRAY RGB( 54, 54, 54 )
#define CLR_MSRED RGB( 164, 55, 58 )
#define CLR_MSORANGE RGB( 184, 72, 43 )
#define CLR_MSPURPLE RGB( 128, 57, 123 )
#define CLR_MSBLUE1 RGB( 1, 115, 199 )
#define CLR_MSBLUE2 RGB( 57, 85, 163 )
#define CLR_MSBLUE3 RGB( 42, 87, 154 )
#define CLR_MSGREEN1 RGB( 49, 117, 47 )
#define CLR_MSGREEN2 RGB( 7, 117, 104 )
#define CLR_MSGREEN3 RGB( 34, 116, 71 )
#define COLOR_GRAYTEXT 17
#define CLRTEXT RGB( 21, 66, 139 )
#define CLRTEXTBACK RGB( 113, 106, 183 )
#define BLUE3 RGB( 191, 219, 255 )
#define BLUE0 RGB( 218, 229, 243 )
#define BLUE2 RGB( 194, 217, 240 )
#define BLUE1 RGB( 199, 216, 237 )
#define BLUEBOX0 RGB( 141, 178, 227 )
#define BLUEBOX1 RGB( 197, 210, 223 )
#define BLUEBOX2 RGB( 237, 242, 248 )
#define CLRLIGHT RGB( 216, 230, 246 )
#define CLRDARK RGB( 191, 213, 238 )
#define YELBOX0 RGB( 249, 204, 96 )
#define YELBOX1 RGB( 255, 255, 189 )
#define QUICKGRAD { { 0.3, nRGB( 218, 228, 243 ), nRGB( 218, 228, 243 ) },;
{ 0.65, nRGB( 199, 216, 237 ), nRGB( 217, 228, 242 ) },;
{ 0.05, nRGB( 141, 178, 227 ), nRGB( 172, 201, 231 ) } }
#define COLOR_MENUHILIGHT 29
#define COLOR_MENUBAR 30
//----------------------------------------------------------------------------//
function Main()
local oWnd
DEFINE WINDOW oWnd
oWnd:SetSize( 1200, 800 )
BuildRibbon( oWnd )
ACTIVATE WINDOW oWnd CENTER // MAXIMIZED
return nil
//----------------------------------------------------------------------------//
function BuildRibbon( oWnd )
local oRb := TRibbonBar():New( oWnd ), oGroup, oBtn, oMenu
MENU oMenu POPUP
MENUITEM "2007" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_2007 ), oRb:Refresh() )
MENUITEM "Dark" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_DARK ), oRb:Refresh() )
MENUITEM "Blue" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_BLUE ) , oRb:Refresh() )
MENUITEM "Green" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_GREEN ), oRb:Refresh() )
MENUITEM "Red" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_RED ), oRb:Refresh() )
MENUITEM "Orange" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_ORANGE ), oRb:Refresh() )
MENUITEM "Purple" ;
ACTION ( SetRibbonBarTheme( oRb, RB_THEME_PURPLE ) , oRb:Refresh() )
ENDMENU
oRb:SetStyles( .F., .T. )
oGroup = oRb:AddGroup( 185, "First", 1 )
oBtn = oGroup:AddButton( 3, 3, oGroup:nHeight - 19, 90, "One", { || MsgInfo( "One" ) } )
oBtn:LoadBitmaps( "c:\work\fwh\bitmaps\32x32\cascade.bmp" )
oBtn = oGroup:AddButton( 3, oBtn:nWidth + 3, oGroup:nHeight - 19, 90, "Two", { || MsgInfo( "Two" ) } )
oBtn:LoadBitmaps( "c:\work\fwh\bitmaps\32x32\tiled.bmp" )
oGroup = oRb:AddGroup( 185, "Second", 1 )
oBtn = oGroup:AddButton( 3, 3, oGroup:nHeight - 19, 90, "Three" )
oBtn:LoadBitmaps( "c:\work\fwh\bitmaps\32x32\world.bmp" )
oBtn = oGroup:AddButton( 3, oBtn:nWidth + 3, oGroup:nHeight - 19, 90, "Four" )
oBtn:LoadBitmaps( "c:\work\fwh\bitmaps\32x32\task.bmp" )
oGroup = oRb:AddGroup( 75, "Styles", 1 )
@ 3,5 ADD BUTTON oBtn ;
PROMPT "Change" BITMAP "c:\work\fwh\bitmaps\stylechange32.BMP";
GROUP oGroup MENU oMenu ;
SPLITPOPUP SIZE 65,75 TOP
SetRibbonBarTheme( oRb, RB_THEME_BLUE ) // as default
return oRb
//----------------------------------------------------------------------------//
function SetRibbonBarTheme( oRb, nTheme )
local oDlg, oGroup, oBtn
oRb:nHeight = 130
oRb:nHeightFld = 20
oRb:hSeparation = 4
oRb:nLeftMargin = 20
oRb:nRoundBox = 0
do case
case nTheme == RB_THEME_2007
oRb:nTopMargin := if( hb_IsNil( oRb:nTopMargin ), 25, oRb:nTopMargin )
oRb:nClrPaneRB = BLUE3
oRb:nClrBoxOut = BLUEBOX0
oRb:nClrBoxIn = BLUEBOX2
oRb:nClrBoxSelOut = YELBOX0
oRb:nClrBoxSelIn = YELBOX1
oRb:aGrad = { {0.12, BLUE0, BLUE0 }, { 0.70, BLUE1, BLUE0 }, { 0.18, BLUE0, CLR_WHITE }}
oRb:aGradFld = {| nOpt | if( nOpt == oRb:nStart, { { 1, RGB( 30, 72, 161 ), RGB( 76, 146, 229 ) } },;
{ { 1, CLR_WHITE, BLUE0 } } ) }
oRb:aGradHigh = { { 1, BLUE3, RGB( 202,172,136 ) } }
oRb:aGradOver = { { 1, RGB( 197,221,251), RGB( 226,209,162)} }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_WHITE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = BLUEBOX2
oGroup:aGradCaption = { {1, BLUE2, BLUE2 } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_WHITE, CLRTEXTBACK ) }
oGroup:nClrBoxIn = BLUEBOX2
oGroup:nClrBoxOut = BLUEBOX0
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = nil
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nRound := if( oBtn:lRound, 6, 0 )
oBtn:nHeight := 80
oBtn:bClrText := { || CLR_WHITE }
oBtn:bClrGradNormal := { | lPressed | If( lPressed, { { 1, BLUEBOX1, BLUEBOX1 } },;
{ { 1, BLUEBOX0, BLUEBOX1 } } ) }
oBtn:aClrGradUnder := {|| { { 1 , nRGB( 248, 186, 107 ), nRGB( 255, 253, 222 ) } } }
oBtn:aClrGradBack := { { 1 , nRGB( 255, 253, 222 ), nRGB( 255, 253, 222 ) } }
oBtn:aClrGradOver := {|| { { 1 , nRGB( 255, 215, 84 ), nRGB( 255, 253, 222 ) } } }
oBtn:bClrGradSubOver:= { | lPressed | if ( lPressed,;
{ ;
{ 2/3, nRGB( 248, 187, 107 ), nRGB( 253, 171, 98 ) } , ;
{ 1/3, nRGB( 253, 154, 63 ), nRGB( 255, 164, 64 ) };
},;
{;
{ 2/3, nRGB( 255, 253, 222 ), nRGB( 255, 231, 147 ) } , ;
{ 1/3, nRGB( 255, 215, 86 ), nRGB( 255, 231, 153 ) };
} ) }
oBtn:bClrGradSelect := {| lSelected | if( lSelected ,;
{ ;
{2/5, nRGB( 253,212,168 ), nRGB( 251,178,99 ) },;
{3/5, nRGB( 250,157,52 ), nRGB( 252,234,163 ) };
},;
{ ;
{2/5, nRGB( 245,177,110 ), nRGB( 243,165,89 ) },;
{3/5, nRGB( 216,136,52 ), nRGB( 249,202,98 ) } ;
} ) }
oBtn:bClrGradSelectPress := {| lPressed | if( lPressed ,;
{ ;
{ 2/5, nRGB( 248, 187, 107 ), nRGB( 253, 171, 98 ) } , ;
{ 3/5, nRGB( 253, 154, 63 ), nRGB( 255, 164, 64 ) };
},;
{ ;
{2/5, nRGB( 245,177,110 ), nRGB( 243,165,89 ) },;
{3/5, nRGB( 216,136,52 ), nRGB( 249,202,98 ) } ;
} ) }
oBtn:aClrGradBtnGr := {|| ;
{ ;
{ 1/3, nRGB( 200, 219, 238 ), nRGB( 201, 221, 246 ) } , ;
{ 2/3, nRGB( 192, 212, 237 ), nRGB( 208, 225, 247 ) };
} }
oBtn:aGradiant = { { 0.3, BLUE0, BLUE0 }, { 0.7, BLUE1, BLUE0 } }
oBtn:nClrBoxIn = BLUEBOX1
oBtn:nClrBoxOut = BLUEBOX0
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_DARK
oRb:nClrPaneRB = CLR_BLACK
oRb:nClrBoxOut = CLR_DARKGRAY
oRb:nClrBoxIn = CLR_DARKGRAY
oRb:nClrBoxSelOut = CLR_DARKGRAY
oRb:nClrBoxSelIn = CLR_DARKGRAY
oRb:aGrad = { { 1, CLR_DARKGRAY, CLR_DARKGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_DARKGRAY, CLR_DARKGRAY } },;
{ { 1, CLR_DARKGRAY, CLR_DARKGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_WHITE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_WHITE, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:nClrBoxOut = CLR_LIGHTGRAY
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = nil
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_WHITE }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_GRAY, CLR_GRAY } },;
{ { 1, CLR_GRAY, CLR_GRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oBtn:nClrBoxIn = CLR_LIGHTGRAY
oBtn:nClrBoxOut = CLR_LIGHTGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_BLUE
oRb:nClrPaneRB = CLR_MSBLUE
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSBLUE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSBLUE // CLR_LIGHTGRAY
oGroup:nClrBoxOut = CLR_MSBLUE // CLR_LIGHTGRAY
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_RED
oRb:nClrPaneRB = CLR_MSRED
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSRED, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSRED
oGroup:nClrBoxOut = CLR_MSRED
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_GREEN
oRb:nClrPaneRB = CLR_MSGREEN1
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSGREEN2, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_MSGREEN2
oGroup:aGradCaption = { { 1, CLR_MSGREEN3, CLR_MSGREEN3 } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_MSLIGHTGRAY ) }
oGroup:nClrBoxIn = CLR_MSGREEN3
oGroup:nClrBoxOut = CLR_MSGREEN3
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGREEN1, CLR_MSGREEN1 } },;
{ { 1, CLR_MSGREEN2, CLR_MSGREEN2 } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGREEN3, CLR_MSGREEN3 } } }
oBtn:aClrGradBack = { { 1, CLR_MSGREEN1, CLR_MSGREEN1 } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_ORANGE
oRb:nClrPaneRB = CLR_MSORANGE
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSBLUE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSORANGE // CLR_LIGHTGRAY
oGroup:nClrBoxOut = CLR_MSORANGE // CLR_LIGHTGRAY
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
case nTheme == RB_THEME_PURPLE
oRb:nClrPaneRB = CLR_MSPURPLE
oRb:nClrBoxOut = CLR_MSLIGHTGRAY
oRb:nClrBoxIn = CLR_MSLIGHTGRAY
oRb:nClrBoxSelOut = CLR_MSLIGHTGRAY
oRb:nClrBoxSelIn = CLR_MSLIGHTGRAY
oRb:aGrad = { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } }
oRb:aGradFld = { | nOpt | If( nOpt == oRb:nStart, { { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } },;
{ { 1, CLR_MSLIGHTGRAY, CLR_MSLIGHTGRAY } } ) }
oRb:aGradHigh = { { 1, CLR_BLACK, CLR_BLACK } }
oRb:aGradOver = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_MSBLUE, CLR_WHITE ) } )
DeleteObject( oRb:hBmpBrushEx )
DeleteObject( oRb:hBrushEx )
oRb:hBmpBrushEx = GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3, oRb:nBottom - oRb:nTopMargin + 1, oRb:aGrad )
oRb:hBrushEx = CreatePatternBrush( oRb:hBmpBrushEx )
for each oDlg in oRb:aDialogs
oDlg:hBack = oRb:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
oGroup:oFont:End()
oGroup:SetFont( oRb:oFont )
oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
oGroup:bClrText = { | lEnable | If( lEnable, CLR_BLACK, CLR_DARKGRAY ) }
oGroup:nClrBoxIn = CLR_MSPURPLE
oGroup:nClrBoxOut = CLR_MSPURPLE
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
for each oBtn in oGroup:aControls
if oBtn:IsKindOf( "TRBTN" )
oBtn:oFont:End()
oBtn:SetFont( oRb:oFont )
oBtn:nHeight = 80
oBtn:bClrText = { || CLR_BLACK }
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, CLR_MSGRAY, CLR_MSGRAY } },;
{ { 1, CLR_MSGRAY, CLR_MSGRAY } } ) }
oBtn:aClrGradUnder = { || { { 1, CLR_MSGRAY, CLR_MSGRAY } } }
oBtn:aClrGradBack = { { 1, CLR_MSGRAY, CLR_MSGRAY } }
oBtn:nClrBoxIn = CLR_MSGRAY
oBtn:nClrBoxOut = CLR_MSGRAY
oBtn:Refresh()
endif
next
oGroup:Refresh()
endif
next
next
endcase
oRb:Default()
return nil
//----------------------------------------------------------------------------/
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_WHITE, CLR_HRED ) } )
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_WHITE,;
If( oRb:nOverPrompt( ScreenToClient( oRb:hWnd, GetCursorPos() )[ 1 ], ScreenToClient( oRb:hWnd, GetCursorPos() )[ 2 ] ) == nPrompt, CLR_HRED, CLR_WHITE ) ) } )
AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_WHITE,;
If( oRb:nOverPrompt( ScreenToClient( oRb:hWnd, GetCursorPos() )[ 1 ], ScreenToClient( oRb:hWnd, GetCursorPos() )[ 2 ] ) == nPrompt, CLR_HRED, CLR_WHITE ) ) } )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 60 guests