Page 1 of 3

Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Fri May 05, 2017 9:23 am
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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Fri May 05, 2017 12:45 pm
by Antonio Linares
Silvio,

Code: Select all  Expand view
  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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 8:59 am
by Enrico Maria Giordano
Please check this working sample:

Code: Select all  Expand view
#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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 9:59 am
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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 10:13 am
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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 10:47 am
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  Expand view
#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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 10:54 am
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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 11:00 am
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 } } ) }

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 11:03 am
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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 11:05 am
by Antonio Linares
and we also fix and properly implement the 2015 style

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 11:14 am
by Enrico Maria Giordano
Antonio,

great, thank you! :-)

EMG

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 5:15 pm
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...

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 5:37 pm
by Silvio.Falconi
first problem correct with

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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sat May 06, 2017 5:43 pm
by Silvio.Falconi
Please try this style
Code: Select all  Expand view
#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

Re: Ribbon tab color MICROSOFT OFFICE 2016

PostPosted: Sun May 07, 2017 12:09 am
by D.Fernandez
Hoal, alguien puede informarme que hago mal. Me da error, soloc opiando el ejemplo.
Code: Select all  Expand view
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.