yo modifique los métodos New, Paint y Painfld de la clase tribbonbar, cree un nuevo parámetro lWin10 para no tocar los originales en el archivo ribbon.ch
Code: Select all
CLASS TRibbonBar FROM TControl
...
...
DATA l2010, l2013, lWIN10
...
...
METHOD New( oWnd, aPrompts, bAction, nOption,;
nWidth, nHeight, nTopMargin, nClrPaneRB, nClrBoxOut, nClrBoxIn,;
nClrBoxSelOut, nClrBoxSelIn, aGrad, aGradFld, aGradHigh, aGradOver, l2010, nStart, l2013, lWin10 ) CONSTRUCTOR
...
...
//--------------------------------------------------------------------//
METHOD New( oWnd, aPrompts, bAction, nOption,;
nWidth, nHeight, nTopMargin, nClrPaneRB, nClrBoxOut, nClrBoxIn,;
nClrBoxSelOut, nClrBoxSelIn, aGrad, aGradFld, aGradHigh, aGradOver, l2010,;
nStart, l2013, lWin10 ) CLASS TRibbonBar
...
...
ELSEIF l2013
...
...
ELSEIF lWin10
nTopMargin := 25
nClrPaneRB := RGB( 0, 68, 118 ) // Panel de Fondo Trasero
nClrBoxOut := RGB( 0, 101, 184 )
nClrBoxIn := RGB( 0, 60, 108 )
nClrBoxSelOut := RGB( 0, 101, 184 )
nClrBoxSelIn := RGB( 0, 88, 148 )
aGrad := { { 1, RGB( 0, 60, 108 ), RGB( 0, 46, 83 ) } } // PANEL FRONTAL
aGradFld := {| nOpt | if( nOpt == ::nStart, { { 1, RGB( 0, 72, 161 ), RGB( 0, 146, 229 ) } },;
{ { 1, RGB( 0, 38, 83 ), RGB( 0, 60, 108 ) } } ) }
aGradHigh := { { 1, RGB( 0, 97, 145 ), RGB( 0, 111, 165 ) } }
aGradOver := { { 1, RGB( 0, 78, 138 ), RGB( 0, 64, 123 ) } }
...
...
if l2010
::nLeftMargin = 10
elseif lWin10
::nLeftMargin = 30
else
::nLeftMargin = 60
endif
::lWin10 = lWin10
...
...
for n = 1 to Len( ::aPrompts )
oDlg := TRPanel():New( ::nTopMargin+1, 3, ::nBottom-5, ::nRight - ::nRightMargin - 3 , Self )
oDlg:Hide()
oDlg:lTransparent := .T.
AAdd( ::aDialogs, oDlg )
AAdd( ::aLeft, 0 )
AAdd( ::aVisible, .T. )
AAdd( ::aEnable, .T. )
if ::l2013 .OR. ::lWin10
AAdd( ::aClrTabTxt, { || RGB( 211, 213, 217 ) } ) // 160x3
else
AAdd( ::aClrTabTxt, { || CLRTEXT } )
endif
next
::oWnd:oTop := Self
::Default()
return self
//--------------------------------------------------------------------//
METHOD Paint() CLASS TRibbonBar
...
...
if ::oBackStage == NIL .OR. ! ::oBackStage:lVisible
RoundBox( hDCMem, 1, nTop-1, aRect[ 4 ]+1, aRect[ 3 ] - 2,;
If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxOut )
RoundBox( hDCMem, 2, nTop , aRect[ 4 ], aRect[ 3 ] - 3, If( ::l2013 .or. ::lWin10, 0, 7 ),;
If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxIn )
endif
...
...
return 0
//----------------------------------------------------------------------------//
METHOD PaintFld( nPrompt, hDCMem, nType ) CLASS TRibbonBar
...
...
do case
case nType == 1
FillRect( hDCMem, { nRow - 2, nCol - 3, nRow + ::nHeightFld - 1, nCol + ::aSizes[ nPrompt ] + 3 }, hBrush2 )
GradientFill( hDCMem, nRow, nCol + 1, nRow + ::nHeightFld - 1, nCol + ::aSizes[ nPrompt ], aGradFld )
RoundBox( hDCMem, nCol - 1, nRow - 1, nCol+::aSizes[ nPrompt ] + 1, nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxOut )
RoundBox( hDCMem, nCol, nRow, nCol + ::aSizes[ nPrompt ], nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxIn )
case nType == 2
if ! ::l2010 .and. nPrompt != ::nStart
GradientFill( hDCMem, nRow, nCol - 3, nRow + ::nHeightFld - 2, nCol + ::aSizes[ nPrompt ] + 3, ::aGradHigh )
endif
GradientFill( hDCMem, nRow + 1, nCol, nRow + ::nHeightFld + 1, nCol + ::aSizes[ nPrompt ], aGradFld )
RoundBox( hDCMem, nCol - 1, nRow - 1, nCol+::aSizes[ nPrompt ] + 1, nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxSelOut )
RoundBox( hDCMem, nCol, nRow, nCol + ::aSizes[ nPrompt ], nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxSelIn )
case nType == 3
if ::aEnable[ nPrompt ]
if ::l2010 .or. nPrompt == ::nStart
GradientFill( hDCMem, nRow + 1, nCol, nRow + ::nHeightFld + 1,nCol + ::aSizes[ nPrompt ], aGradFld )
else
GradientFill( hDCMem, nRow + 1, nCol, nRow + ::nHeightFld + 1,nCol + ::aSizes[ nPrompt ], ::aGradOver )
endif
if nPrompt != ::nStart
RoundBox( hDCMem, nCol - 1, nRow - 1, nCol+::aSizes[ nPrompt ] + 1, nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxOut )
RoundBox( hDCMem, nCol, nRow, nCol + ::aSizes[ nPrompt ], nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxIn )
else
RoundBox( hDCMem, nCol - 1, nRow , nCol+::aSizes[ nPrompt ] + 1, nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxOut )
endif
else
FillRect( hDCMem, { nRow - 2, nCol - 2, nRow + ::nHeightFld - 1, nCol + ::aSizes[ nPrompt ] + 2 }, hBrush2 )
endif
case nType == 4 // unselect
if nPrompt == ::nStart
GradientFill( hDCMem, nRow + 1, nCol, nRow + ::nHeightFld + 1,nCol + ::aSizes[ nPrompt ], aGradFld )
RoundBox( hDCMem, nCol - 1, nRow , nCol+::aSizes[ nPrompt ] + 1, nRow + ::nHeightFld + 3, If( ::l2013 .or. ::lWin10, 0, 7 ), If( ::l2013 .or. ::lWin10, 0, 7 ), ::nClrBoxOut )
FillRect( hDCMem, { nRow + ::nHeightFld - 1, nCol - 1, nRow + ::nHeightFld + 3, nCol + ::aSizes[ nPrompt ] + 1 }, hBrush3 )
else
FillRect( hDCMem, { nRow - 2, nCol - 2, nRow + ::nHeightFld - 1, nCol + ::aSizes[ nPrompt ] + 2 }, hBrush2 )
FillRect( hDCMem, { nRow + ::nHeightFld - 1, nCol - 2, nRow + ::nHeightFld - 1, nCol + ::aSizes[ nPrompt ] + 2 }, hBrush4 )
endif
endcase
...
...
return 0
//----------------------------------------------------------------------------//
solo espero que te sirva.