Compile un ejemplo que encontré en el foro para el cambio de los colores de una ribbon, he logrado identificar algunos de objetos para el cambio del color, pero no logro cambiar el color negro de la parte superior de la barra ribbon, esta señalada en la imagen, así como tampoco las líneas que separan los paneles.
De antemano gracias.
- Code: Select all Expand view RUN
/*
Purpose : Fivewin Ribbonbar - MS Office 2019 style
Program :
Author : Frances Padilla (FAP)
Date : 05/07/2019 04:52:26 PM
Company :
Copyright:
Language : Fivewin/xHarbour
Updated : 05/06/2019 By James Bott, jbott@compuserve.com
Notes :
Source : viewtopic.php?f=3&t=36145&p=221601#p221601
: This is the dark theme
: Somehow he got rid of the underline under the ribbonbar.
*/
#include "FiveWin.ch"
#include "Ribbon.ch"
//#define _ClrRed RGB(255,37,37)
#define _nClrPaneRB RGB( 68, 68, 68 ) //COLOR DE LA BARRA INFERIOR VENTANA SUPERIOR RIBBON BORDES BARRA
#define _nClrBoxOutRB RGB( 0, 120, 212) //LINEA DEL BORDE ACTIVO DE LA BARRA
#define _nClrBoxInRB RGB( 0, 120, 212 ) //LINEA INTERNA DE LA BARRA
#define _nClrBoxSelOut RGB( 0, 120, 212 ) // BORDE DE LA PESTAÑA AL PASAR EL MOUSE POR ENCIMA CUANDO PESTAÑA ACTIVA
#define _nClrBoxSelIn := RGB( 0, 120, 212 )
#define _aGradRB { { 1, RGB( 0, 120, 212 ), RGB( 0, 120, 212 ) } } //COLORES DEGRADE INTERNA BARRA
#define _aGradFldRB {|nOpt| iif( nOpt == oRibbon:nStart, { { 1, RGB( 0, 120, 212 ), RGB( 0, 120, 212 ) } },;
{ { 1, RGB( 0, 120, 212 ), RGB( 0, 120, 212 ) } } ) } //COLOR EN DEGRADE DE LA PESTAÑA
#define _aGradHighRB { { 1, RGB(0, 120, 212 ), RGB( 0, 120, 212 ) } } //DE MOMENTO NO LO IDENTIFIQUE
#define _aGradOverRB { { 1, RGB( 0, 120, 212 ), RGB( 0, 120, 212 ) } } //DE MOMENTO NO LO IDENTIFIQUE
#define _nCtrlFrGround RGB( 255, 255, 255 ) //DE MOMENTO NO LO IDENTIFIQUE
#define _nCtrlBkGround RGB( 106, 106, 106 ) //FONDO DE LA VENTANA
#define _nClrBoxOut RGB( 0, 120, 212 ) //DE MOMENTO NO LO IDENTIFIQUE
#define _nClrBoxIn RGB( 0, 120, 212 ) //DE MOMENTO NO LO IDENTIFIQUE
#define _nClrTxt RGB( 220, 220, 220 ) //COLOR DEL TEXTO
#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, oGroup
local aDlgs, oDlg
DEFINE FONT oFont NAME getSysFont() SIZE 0,-12
DEFINE WINDOW oWnd title "Fivewin Ribbonbar - Office 2109 style"
aDlgs := { ' File ', ' Home ', ' Insert ', ' Design ', ' Layout ', ' References ', ' Mailings ', ' Review ', ' View ' }
oRibbon := TRibbonBar():New( oWnd, aDlgs,,,, 135, 40, _nClrPaneRB, _nClrBoxOutRB, _nClrBoxInRB,,;
_nClrBoxSelOut, _aGradRB, _aGradFldRB, _aGradHighRB, _aGradOverRB,,,.t.,,)
// _nClrBoxSelOut, _aGradRB, _aGradFldRB, _aGradHighRB, _aGradOverRB,,,,,.T.)
// Change the colors of the tabs
AFill( oRibbon:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, CLR_BLACK,;
If( oRibbon:nOverPrompt( ScreenToClient( oRibbon:hWnd, GetCursorPos() )[ 1 ], ScreenToClient( oRibbon:hWnd, GetCursorPos() )[ 2 ] ) == nPrompt, CLR_BLACK, _nClrTxt ) ) } )
WITH OBJECT oRibbon
:nHeightFld := 24
:hSeparation := 4
:SetFont( oFont )
:nLeftMargin = 10 // left margin of tabs
:nClrBoxSelOut = _nClrBoxSelOut // New ! Removes white outline of tab when cursor is over them.
:l2010 = .T. // New ! Turns off highlighting of groups when cursor is over them.
:CalcPos()
END
oGroup = oRibbon:AddGroup( 70, "Clipboard", 1 )
@ 5,5 ADD BUTTON oBtn PROMPT "MDI-button" BITMAP "" GROUP oGroup ROUND SIZE 63,65 ACTION Msginfo("mdi2 button1")
@ 5,70 ADD BUTTON oBtn1 PROMPT "MDI-button" BITMAP "" GROUP oGroup ROUND SIZE 63,65 ACTION Msginfo("mdi2 button2")
//oBtn:oFont:End()
//oBtn:SetFont( oRb:oFont )
//oBtn:nHeight -= 24
oBtn:bClrGradNormal = { | lPressed | If( lPressed, { { 1, RGB( 160, 160, 160 ), RGB( 160, 160, 160 ) } },;
{ { 1, RGB( 160, 160, 160 ), RGB( 160, 160, 160 ) } } ) }
oBtn:aClrGradUnder = { || { { 1, RGB( 255, 160, 160 ), RGB( 160, 160, 160 ) } } }
oBtn:aClrGradBack = { { 1, RGB( 160, 160, 160 ), RGB( 160, 160, 160 ) } }
oBtn:nClrBoxIn = RGB( 160, 160, 160 )
oBtn:nClrBoxOut = RGB( 160, 160, 160 )
oGroup = oRibbon:AddGroup( 260, "Font", 1 )
oGroup = oRibbon:AddGroup( 221, "Paragraph", 1 )
oGroup = oRibbon:addGroup( 320, "Styles", 1)
for each oDlg in oRibbon:aDialogs
oDlg:hBack = oRibbon:hBrushEx
oDlg:Refresh()
for each oGroup in oDlg:aControls
if oGroup:IsKindOf( "TRBGROUP" )
//oGroup:oFont:End()
//oGroup:SetFont( oRibbon:oFont )
// oGroup:nHeight = 100
oGroup:nClrBoxIn = CLR_LIGHTGRAY
oGroup:aGradCaption = { { 1, CLR_LIGHTGRAY, CLR_LIGHTGRAY } }
//oGroup:bClrText = { | lEnable | If( lEnable, CLR_LIGHTGRAY, CLR_DARKGRAY ) } //CLR_DARKGRAY ) }
oGroup:nClrTxt = RGB(0,0,0)
oGroup:nClrBoxIn = _nClrPaneRB //CLR_LIGHTGRAY
oGroup:nClrBoxOut = _nClrPaneRB //CLR_LIGHTGRAY
//oGroup:SetColor( _nClrTxt, _nClrPaneRB )
DeleteObject( oGroup:hBrushSel )
DeleteObject( oGroup:hBrushUnSel )
DeleteObject( oGroup:hBack )
oGroup:hBrushUnSel = oDlg:hBack
oGroup:hBack = oDlg:hBack
oGroup:refresh()
endif
next
next
oWnd:SetSize( 930, 400 )
oWnd:setColor(, _nCtrlBkGround)
SET MESSAGE TO " Page 1 of 1 0 words English (United Kingdom)" OF oWnd color _nClrTxt, _nClrPaneRB noinset noborder
ACTIVATE WINDOW oWnd CENTER
return nil