Ribbon Theme

Re: Ribbon Theme

Postby Silvio.Falconi » Sun Apr 28, 2019 4:19 pm

Antonio,
I tried to insert my theme but I have make a confusion..
I use l2016 for ribbonbar and then l2013 for tgroup simulating theme 2019




can you help me to set these colors ?
the color of bar where are the item of menu is gray but it is wrong
Last edited by Silvio.Falconi on Tue Apr 30, 2019 8:38 am, edited 1 time in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon Theme

Postby cnavarro » Sun Apr 28, 2019 4:26 pm

rhlawek

I have not tried it in an MDI environment, but it should work the same
Follow the following steps:
1) Fully define RibbonBar, including the call to the function that generates the new style.
2) When defining the Ribbonbar, make sure that there is enough space left in the upper part to place the buttonbar, for this, use the clause TOPMARGIN nTopMarg in the definition of the Ribbonbar.
3) Define the buttonbar but associated with the RIBBONBAR object
Code: Select all  Expand view  RUN

.../...
   oRBar:Default()

   SetRibbonBarTheme( oRBar, 6 )
   // End definition of RibbonBar

   DEFINE BUTTONBAR oBar SIZE 22, 22 2010 OF oRBar
 
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Ribbon Theme

Postby rhlawek » Sun Apr 28, 2019 4:56 pm

Thank you so much.

Making the button bar a child or the ribbon bar fixes most of the painting problems, and all of the clicking behavior problems. And setting the top margin to a larger value does push the top of the ribbon bar tabs down so that the tabs should be visible, but the groups and the buttons on the ribbon bar itself aren't following that down, they are still painting over the top of the tabs. I can change the size of the groups and the buttons, but I haven't figured out what to change to force them down below the tabs again.
User avatar
rhlawek
 
Posts: 194
Joined: Sun Jul 22, 2012 7:01 pm

Re: Ribbon Theme

Postby cnavarro » Sun Apr 28, 2019 5:08 pm

rhlawek wrote:Thank you so much.

Making the button bar a child or the ribbon bar fixes most of the painting problems, and all of the clicking behavior problems. And setting the top margin to a larger value does push the top of the ribbon bar tabs down so that the tabs should be visible, but the groups and the buttons on the ribbon bar itself aren't following that down, they are still painting over the top of the tabs. I can change the size of the groups and the buttons, but I haven't figured out what to change to force them down below the tabs again.


Please, set height of ribbonbar, look

.../...
local nTopMarg := 24
local nHeight := 128 + nTopMarg

DEFINE RIBBONBAR oRBar WINDOW oWnd ;
PROMPT "One and more", "Two and minus", "Three and more or minus" ;
HEIGHT nHeight TOPMARGIN nTopMarg
.../...
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Ribbon Theme

Postby rhlawek » Sun Apr 28, 2019 6:15 pm

Thanks again.

I'm going to edit the sample that was provided here to better illustrate the last painting problem.

No matter what I change I can't get the top of the ribbon bar, starting with the tabs but also the ribbon bar background itself, to start painting below the button bar, the ribbon bar seems to want to align to the top of the button bar. Which would be okay, but when I adjust the top margin it pushes down the ribbon bar, but not the groups or the buttons themselves. Things are much improved from when I set out to debug this earlier today, but there is still something I don't fully understand.
User avatar
rhlawek
 
Posts: 194
Joined: Sun Jul 22, 2012 7:01 pm

Re: Ribbon Theme

Postby cnavarro » Sun Apr 28, 2019 6:39 pm

Ok, I wait your sample
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6549
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Ribbon Theme

Postby Antonio Linares » Sun Apr 28, 2019 7:23 pm

In my posted example if you add this line, then you get a more modern look:

Code: Select all  Expand view  RUN
function BuildRibbon( oWnd )

   local oRb := TRibbonBar():New( oWnd ), oGroup, oBtn

   oRb:SetStyles( .F., .T. )  // New


Image
regards, saludos

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

Re: Ribbon Theme

Postby Antonio Linares » Sun Apr 28, 2019 7:30 pm

Robert,

Please set oWnd:oTop := nil (after creating the ribbon) and try it again.

Whatever control is placed at oWnd:oTop will try to align itself to the top.
regards, saludos

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

Re: Ribbon Theme

Postby rhlawek » Sun Apr 28, 2019 8:32 pm

I just tried that, it actually moves the problem back to where I started before making the suggested change to attach to oRb instead of oWnd. It paints incorrectly and nothing is clickable whether using oRb or oWnd.

Here is the sample code you provided, edited to show the situation. It adds MDI to the windows definition, it adds the button bar attaching to oRb, and it adds and explicitly assigns the values oRb:nTopMargin := 50 and oRb:nTop in SetRibbonBarTheme()

Code: Select all  Expand view  RUN

#include "FiveWin.ch"

#define RB_THEME_DARK         6
#define COLOR_GRAYTEXT       17

//----------------------------------------------------------------------------//

function Main()

   local oWnd

   DEFINE WINDOW oWnd MDI
   
   oWnd:SetSize( 1200, 800 )

   BuildRibbon( oWnd )

   ACTIVATE WINDOW oWnd CENTER // MAXIMIZED

return nil

//----------------------------------------------------------------------------//

function BuildRibbon( oWnd )

   local oRb := TRibbonBar():New( oWnd ), oGroup, oBtn, oBar
     
   DEFINE BUTTONBAR oBar SIZE 26, 26 _3D _2010 OF oRb // oWnd  

   DEFINE BUTTON OF oBar ;
          RESOURCE "..\bitmaps\32x32\open.bmp" ;
          FLAT TOOLTIP "Hello world." ;
          ACTION ( MsgInfo( "Hello world.") )

   oGroup = oRb:AddGroup( 185, "First", 1 )
   oBtn = oGroup:AddButton( 3, 3, oGroup:nHeight - 19, 90, "One", { || MsgInfo( "One" ) } )
   oBtn:LoadBitmaps( "..\bitmaps\32x32\new.bmp" )
   oBtn = oGroup:AddButton( 3, oBtn:nWidth + 3, oGroup:nHeight - 19, 90, "Two", { || MsgInfo( "Two" ) } )
   oBtn:LoadBitmaps( "..\bitmaps\32x32\open.bmp" )
   
   oGroup = oRb:AddGroup( 185, "Second", 1 )
   oBtn = oGroup:AddButton( 3, 3, oGroup:nHeight - 19, 90, "Three" )
   oBtn:LoadBitmaps( "..\bitmaps\32x32\setup.bmp" )
   oBtn = oGroup:AddButton( 3, oBtn:nWidth + 3, oGroup:nHeight - 19, 90, "Four" )
   oBtn:LoadBitmaps( "..\bitmaps\32x32\quit.bmp" )

   oRb:AddGroup( 185, "Third", 1 )

   SetRibbonBarTheme( oRb, RB_THEME_DARK )
   
return oRb  

//----------------------------------------------------------------------------//

function SetRibbonBarTheme( oRb, nTheme )

   local oDlg, oGroup, oBtn

   do case
      case nTheme == RB_THEME_DARK
         oRb:oFont:End()
         oRb:SetFont( TFont():New( "Segoe UI", 0, -14 ) )
         
         oRb:nTopMargin  := 50
         oRb:nTop        := 28
         oRb:nHeight     = 136
         oRb:nHeightFld  =  20
         oRb:hSeparation =   4
         oRb:nLeftMargin =  20
         oRb:nRoundBox   =   0

         oRb:nClrPaneRB    = RGB( 68,   68,  68 )
         oRb:nClrBoxOut    = RGB( 178, 178, 178 )
         oRb:nClrBoxIn     = RGB( 178, 178, 178 )
         oRb:nClrBoxSelOut = RGB( 178, 178, 178 )
         oRb:nClrBoxSelIn  = RGB( 178, 178, 178 )
         oRb:aGrad         = { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } }
         oRb:aGradFld      = { | nOpt | If( nOpt == oRb:nStart, { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } },;
                                                                { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } } ) }
         oRb:aGradHigh     = { { 1, RGB( 178, 178, 178 ), RGB( 178, 178, 178 ) } }  
         oRb:aGradOver     = { { 1, RGB( 0, 114, 198 ), RGB( 0, 114, 198 ) } }
         
         AFill( oRb:aClrTabTxt, { | oSelf, nPrompt | If( nPrompt == oSelf:nOption, RGB( 0, 0, 0 ), RGB( 255, 255, 255 ) ) } )
         
         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     -= 24
                  oGroup:nClrBoxIn    = RGB( 160, 160, 160 )
                  oGroup:aGradCaption = { { 1, RGB( 160, 160, 160 ), RGB( 160, 160, 160 ) } }
                  oGroup:bClrText     = { | lEnable | If( lEnable, RGB( 0, 0, 0 ), GetSysColor( COLOR_GRAYTEXT ) ) }
                  oGroup:nClrBoxIn    = RGB( 160, 160, 160 )
                  oGroup:nClrBoxOut   = RGB( 160, 160, 160 )
                 
                  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       -= 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( 160, 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 )
                     endif  
                  next
                  oGroup:Refresh()
                 
               endif
            next
         next  
         
   endcase
   
   // oRb:Refresh()
   oRb:Default()

return nil

//----------------------------------------------------------------------------//
 
User avatar
rhlawek
 
Posts: 194
Joined: Sun Jul 22, 2012 7:01 pm

Re: Ribbon Theme

Postby Antonio Linares » Tue Apr 30, 2019 8:04 am

Robert,

As you are using a MDI environment you have to change this line this way:

local oRb := TRibbonBar():New( oWnd:oWndClient )
regards, saludos

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

Re: Ribbon Theme

Postby Silvio.Falconi » Tue Apr 30, 2019 9:11 am

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon Theme

Postby MOISES » Tue Apr 30, 2019 4:55 pm

Cool, I love that Ribbon in blue!
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: Ribbon Theme

Postby TimStone » Tue Apr 30, 2019 6:34 pm

Antonio,

The latest theme from Microsoft ( Ribbon Bar ) is essentially black on grey. The buttons are black outline images ( no color ). The tabs have no color change, and the focused tab is simply the title in bold. The font's are smaller and there are no differences in color with the group labels. The font is smaller. This is the most modern version released recently with Office 365.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Ribbon Theme

Postby Antonio Linares » Wed May 01, 2019 3:48 am

Tim,

Could you provide a screenshot ? thanks
regards, saludos

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

Re: Ribbon Theme

Postby richard-service » Wed May 01, 2019 10:17 am

Hi Antonio,

Please look it. office 365

Image
Image
Image
Image
Best Regards,

Richard

Harbour 3.2.0dev (r2402101027) => Borland C++ v7.7 32bit
MySQL v8.0 /ADS v10
Harbour 3.2.0dev (r2011030937) => Borland C++ v7.4 64bit
User avatar
richard-service
 
Posts: 804
Joined: Tue Oct 16, 2007 8:57 am
Location: New Taipei City, Taiwan

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 43 guests