Ribbonbar with solid brush color

Ribbonbar with solid brush color

Postby James Bott » Wed Sep 19, 2018 10:08 pm

I am working on the Ribbonbar class. I am trying to make the ribbon color solid instead of gradient (Windows 10 uses solid colors). There is brush defined like this in the class:

::hBmpBrushEx = GradientBmp( Self, ::nRight - ::nRightMargin - 3, ::nBottom - ::nTopMargin + 1, ::aGrad )
::hBrushEx = CreatePatternBrush( ::hBmpBrushEx )

::aGrad is defined in the class like this:

::aGrad := { { 1, RGB( 255, 255, 255 ), RGB( 255, 255, 255 ) } }

One would think that this would be a solid color but no, it is a gradient. I have tried changing the RGB values and I see no change in the ribbonbar color or gradient. I have never had a reason to work with brushes before so I know next to nothing about them.

Maybe I don't even need to use a brush?

I can find no documentation on brushes except in C.

Any ideas?
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbonbar with solid brush color

Postby James Bott » Thu Sep 20, 2018 12:43 am

Well I accidently got it working. I don't know how yet, but no more gradients.
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbonbar with solid brush color

Postby Rick Lipkin » Thu Sep 20, 2018 2:43 pm

James

This is how I setup my ButtonBar gradient ( grey\white ) .. It might also work for the RibbonBar as well ?? .. If you want a solid color .. play with the rgb colors in :bClrGrad code block.

Rick Lipkin

Code: Select all  Expand view

DEFINE BUTTONBAR oBar OF oWind SIZE 80,58 2010    // 80,58   80,64
       oBar:SetColor(0)
                           
       oBar:bClrGrad = { || { { 0.10,15724527,7303023 }, ;
                       { 0.10,7303023,15724527 } } }

 


Image
User avatar
Rick Lipkin
 
Posts: 2663
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Ribbonbar with solid brush color

Postby James Bott » Thu Sep 20, 2018 4:49 pm

Thanks for the input Rick.

I am trying to configure the ribbonbar to look like current Microsoft apps such as Office. I finally found that the 2010 style Ribbonbar has a solid background but the wrong style groups. And the 2016 style has a gradient background with the right style groups. So, now I need to combine them into a new styles. There is quite a learning curve with this class as there is no documentation, and no comments in the code.

Image
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Ribbonbar with solid brush color

Postby James Bott » Thu Sep 20, 2018 5:00 pm

Here is MS Word for comparison.

Image
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

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

cron