Ribbon tab color MICROSOFT OFFICE 2016

User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Ribbon tab color MICROSOFT OFFICE 2016

Post by Silvio.Falconi »

Wich is the variable to change the color of the tab of a riboonbar ?

I wish make the rribbonbar as MICROSOFT OFFICE 2016


Image


thanks
Last edited by Silvio.Falconi on Sat May 06, 2017 10:03 am, edited 1 time in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Antonio Linares »

Silvio,

Code: Select all

   DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 133 TOPMARGIN 25 2015

   oRBar:aClrTabTxt = { { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) },;
                        { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) },;
                        { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) } }
   oRBar:nClrPaneRB = CLR_GREEN
   oRBar:aGradFld = { || { { 1, CLR_WHITE, CLR_WHITE } } }
   oRBar:aGradOver = { || { { 1, CLR_GREEN, CLR_GREEN } } }
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Enrico Maria Giordano »

Please check this working sample:

Code: Select all

#include "Fivewin.ch"
#include "Ribbon.ch"


FUNCTION MAIN()

    LOCAL oWnd, oRBar, oRGrp

    DEFINE WINDOW oWnd

    DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 133 TOPMARGIN 25 2015

    oRBar:aClrTabTxt = { { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) },;
                       { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) },;
                       { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) } }

    oRBar:nClrPaneRB = CLR_GREEN
    oRBar:aGradFld = { || { { 1, CLR_WHITE, CLR_WHITE } } }
    oRBar:aGradOver = { || { { 1, CLR_GREEN, CLR_GREEN } } }

    ADD GROUP oRGrp RIBBONBAR oRBar;
              TO OPTION 1

    @ 2, 2 ADD BUTTON GROUP oRGrp;
           SIZE oRGrp:nWidth - 5, oRGrp:nHeight - 18

    ACTIVATE WINDOW oWnd

    RETURN NIL
How to get rid of the pale cyan color in the label bar under the ribbon group? How to get rid of the orange/yellow color when the mouse is over the ribbon button?

EMG
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Silvio.Falconi »

the sample of Antonio is good but on Microsoft 2016 the space from tab is more height from the tab ( also the width of the tab is more) and at bottom thereis not the green line
I tried to change the size of part where there are the tabs of the ribbon but I not Found where I must change it
then we must not colorize the line on the bottom

see the green ribbon of this snap

Image
Last edited by Silvio.Falconi on Sat May 06, 2017 10:22 am, edited 1 time in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Silvio.Falconi »

Color Button
the back color of the button seem have a gray color as you can see on this picture
Image


then the menu of the button (with menu) have a green color as you can see in this picture

Image

I think the same color of the topbar



Change the style
then on Office 2016 there is a menu popup where is possible change the style of ribbonbar

Image
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Antonio Linares »

Enrico,

> How to get rid of the pale cyan color in the label bar under the ribbon group ?

oRGrp:aGradCaption = { { 1, CLR_WHITE, CLR_WHITE } }

> How to get rid of the orange/yellow color when the mouse is over the ribbon button ?

oBtn1:bClrGradNormal = { | lPressed | If( lPressed,;
{ { 1, RGB( 197, 197, 197 ), RGB( 197, 197, 197 ) } },;
{ { 1, CLR_WHITE, CLR_WHITE } } ) }

ribbon2016.prg

Code: Select all

#include "Fivewin.ch"
#include "Ribbon.ch"

FUNCTION MAIN()

    LOCAL oWnd, oRBar, oRGrp, oBtn1

    DEFINE WINDOW oWnd

    DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 133 TOPMARGIN 25 2015

    oRBar:aClrTabTxt = { { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) },;
                       { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) },;
                       { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, CLR_GREEN, CLR_WHITE ) } }

    oRBar:nClrPaneRB = CLR_GREEN
    oRBar:aGradFld = { || { { 1, CLR_WHITE, CLR_WHITE } } }
    oRBar:aGradOver = { || { { 1, CLR_GREEN, CLR_GREEN } } }

    ADD GROUP oRGrp RIBBONBAR oRBar;
              TO OPTION 1

    oRGrp:aGradCaption = { { 1, CLR_WHITE, CLR_WHITE } }

    @ 2, 2 ADD BUTTON oBtn1 GROUP oRGrp ;
       SIZE oRGrp:nWidth / 2, oRGrp:nHeight - 18

    oBtn1:bClrGradNormal = { | lPressed | If( lPressed,;
                             { { 1, RGB( 197, 197, 197 ), RGB( 197, 197, 197 ) } },;
                             { { 1, CLR_WHITE, CLR_WHITE } } ) }    

    ACTIVATE WINDOW oWnd

    RETURN NIL
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Enrico Maria Giordano »

Antonio,

thank you, it works. Are the pale cyan and orange/yellow colors part of the official 2015 theme? If no, why not remove it in the class? It's annoying to do it for each group and button.

EMG
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Antonio Linares »

Silvio,

> the back color of the button seem have a gray color as you can see on this picture

Already implemented in my previous example:

oBtn1:bClrGradNormal = { | lPressed | If( lPressed,;
{ { 1, RGB( 197, 197, 197 ), RGB( 197, 197, 197 ) } },;
{ { 1, CLR_WHITE, CLR_WHITE } } ) }
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Antonio Linares »

Enrico Maria Giordano wrote:Antonio,

thank you, it works. Are the pale cyan and orange/yellow colors part of the official 2015 theme? If no, why not remove it in the class? It's annoying to do it for each group and button.

EMG
lets first fine tune the 2016 ribbon theme colors and shapes, then we do the right fixes in the classes
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Antonio Linares »

and we also fix and properly implement the 2015 style
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Silvio.Falconi »

Thanks Antonio

two last question

Image


If you look at the figure ( to where number 1) the ribbon2016 between the ribbon tabs and the window border there must be more space

on that space ribbonbar 2016 have small buttons

Then the line below (where I put the number 2) there is not
I checked in all styles (blue, green, orange, purple, etc.) the line is white not green or can be there is a hgray line ...perhaps...
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Silvio.Falconi »

first problem correct with

DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 163 TOPMARGIN 45 2015
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by Silvio.Falconi »

Please try this style

Code: Select all

#include "Fivewin.ch"
#include "Ribbon.ch"

#define COLOR_MENUHILIGHT            29  //051,153,255
#define COLOR_MENUBAR                30  //240,240,240


FUNCTION MAIN()

    LOCAL oWnd, oRBar, oRGrp, oBtn1

    DEFINE WINDOW oWnd

    DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "One", "Two", "Three" HEIGHT 163 TOPMARGIN 45 2015

    oRBar:aClrTabTxt = { { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, GetSysColor( COLOR_MENUHILIGHT ) , CLR_WHITE ) },;
                         { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, GetSysColor( COLOR_MENUHILIGHT ) , CLR_WHITE ) },;
                         { | oSelf, nPrompt | If( nPrompt == oRBar:nOption, GetSysColor( COLOR_MENUHILIGHT ) , CLR_WHITE ) } }

    oRBar:nClrPaneRB = GetSysColor( COLOR_MENUHILIGHT )
    oRBar:aGradFld = { || { { 1, CLR_WHITE, CLR_WHITE } } }
    oRBar:aGradOver = { || { { 1, GetSysColor( COLOR_MENUHILIGHT ) , GetSysColor( COLOR_MENUHILIGHT )  } } }




    ADD GROUP oRGrp RIBBONBAR oRBar;
              TO OPTION 1

    oRGrp:aGradCaption = { { 1, CLR_WHITE, CLR_WHITE } }

    @ 2, 2 ADD BUTTON oBtn1 GROUP oRGrp ;
       SIZE oRGrp:nWidth / 2, oRGrp:nHeight - 18   ;
        action msginfo()

    oBtn1:bClrGradNormal = { | lPressed | If( lPressed,;
                             { { 1, RGB( 197, 197, 197 ), RGB( 197, 197, 197 ) } },;
                             { { 1, CLR_WHITE, CLR_WHITE } } ) }


    ACTIVATE WINDOW oWnd

    RETURN NIL
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
D.Fernandez
Posts: 392
Joined: Wed Jul 31, 2013 1:14 pm
Location: Maldonado - Uruguay
Contact:

Re: Ribbon tab color MICROSOFT OFFICE 2016

Post by D.Fernandez »

Hoal, alguien puede informarme que hago mal. Me da error, soloc opiando el ejemplo.

Code: Select all

Application
===========
   Path and name: C:\Fuentes\TodoCuentas\zonacuentas.Exe (32 bits)
   Size: 5,637,632 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 17.04
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 21 secs 
   Error occurred at: 06/05/2017, 21:06:46
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 3
     [   2] = N   5

Stack Calls
===========
   Called from: .\source\classes\TRIBBON.PRG => (b)TRIBBONBAR_PAINTFLD( 837 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:PAINTFLD( 859 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:PAINT( 675 )
   Called from: .\source\classes\TRIBBON.PRG => (b)TRIBBONBAR( 158 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:DISPLAY( 0 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1697 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:HANDLEEVENT( 1159 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3325 )
   Called from:  => UPDATEWINDOW( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1013 )
   Called from: zonacuentas.PRG => MAIN( 434 )
 

Gracias, saludos.
Dario Fernandez
FWH, Harbour, BCC, MySql & MariaDB, tData, Dbf/Cdx
VSCode.
Maldonado - Uruguay
Post Reply