Ribbon Theme

Re: Ribbon Theme

Postby James Bott » Thu Oct 25, 2018 5:48 pm

Silvio,

Thanks for the feedback. I think you mean setTheme() rather than setStyle(). We already pass a style parameter. And there are some complications in adding a setStyle() method since the style is mostly setup in the New() method so you can't do something like:

oRBar:= TRibbonbar():New(…)
oRbar:setStyle(…)

At least you can't without revising the New() method a lot. Actually, there is already a setStyles() method which is called from the New() method and the ribbonbar is already partially painted when the code execution gets to the end of the New() method. I agree it would be nice to be able to call a setStyle() method but it will require lots of work. Anyhow I think you meant setTheme().

I agree that we also need an easier way to set the themes. We should not have to define all the different colors and many of them have to be in an array. This should be simple. However, I would like to start by just getting the style right, then release that version. We also need some comprehensive testing and feedback before moving on to the themes. IMHO


James
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: Ribbon Theme

Postby Silvio.Falconi » Thu Oct 25, 2018 6:50 pm

yes, I confirm SetThemes()
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon Theme

Postby cnavarro » Thu Oct 25, 2018 7:29 pm

Please try with and tell me

James Bott wrote:
oRBar:= TRibbonbar():New(…)
oRbar:setStyle(…)
oRBar:Default()

James
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: 6548
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Ribbon Theme

Postby James Bott » Fri Oct 26, 2018 2:54 pm

Cristobal,

It is actually oRBar:setStyles() with an "s" at the end. I think it should have been setStyle() since it only changes one style, but changing the name of the method now could break existing code in use now.

It may be useful for changing the theme, but I'm not sure it can handle everything right now. I think there are other parameters that it doesn't have that we may need to change a theme. I will be looking into that more.

James
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: Ribbon Theme

Postby Silvio.Falconi » Fri Dec 21, 2018 7:28 pm

But You resolve the problem for new style ?
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon Theme

Postby James Bott » Fri Dec 21, 2018 11:02 pm

Silvio,

Sorry, no I have been sidetracked on other projects. I do hope to get back to it soon.
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: Ribbon Theme

Postby vilian » Tue Feb 19, 2019 12:25 pm

fraxzi wrote:Hi James,

I got it!

Image



Your ribbonbar is pretty beautiful! could you share a small code to us test this ?
I tried to build it joining the parts of the code that you have shared, but I had no success.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Ribbon Theme

Postby James Bott » Wed Feb 20, 2019 12:41 am

Vilian,

Unfortunately, there is no code that I can provide yet.

There are several classes involved, and all need modifications since colors and other attributes are often hardcoded inside codeblocks so it is not even possible to modify these without changing the class code. I have probably spent 50+ hours on it and now I have forgotten a lot since I haven't worked on it since last October due to other pressing projects.

I will put it back on my ToDo list.
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: Ribbon Theme

Postby vilian » Wed Feb 20, 2019 12:49 am

Thank you james!
I will been waiting anxiously for you improvements !!
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Ribbon Theme

Postby James Bott » Wed Feb 20, 2019 1:43 am

Vilian,

Have you tried the code in Fraxzi's post here:

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=36145&start=30#p215907

I have not tried it yet, so I don't know if it will get you what you need--at least for now.

James
Last edited by James Bott on Wed Feb 20, 2019 3:27 pm, edited 1 time in total.
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: Ribbon Theme

Postby vilian » Wed Feb 20, 2019 11:19 am

Yes, I tried. But I think is something missing in his code, because i can't build a single prg to try.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Ribbon Theme

Postby Silvio.Falconi » Mon Apr 01, 2019 7:22 am

Any solution for ribbonbar 2019 blu style ?
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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: Ribbon Theme

Postby vilian » Thu Apr 04, 2019 12:43 pm

We really need progress with RibbonBar. The current appearance(2007) is looking like a "old" appearance :(
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 977
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Ribbon Theme

Postby Antonio Linares » Sat Apr 27, 2019 5:02 am

In order to test differents RibbonBar themes, here you have a generic function to modify the RibbonBar theme on runtime

rbtheme.prg
Code: Select all  Expand view
#include "FiveWin.ch"

#define RB_THEME_DARK         6
#define COLOR_GRAYTEXT       17

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

function Main()

   local oWnd

   DEFINE WINDOW oWnd
   
   oWnd:SetSize( 1200, 800 )

   BuildRibbon( oWnd )

   ACTIVATE WINDOW oWnd CENTER // MAXIMIZED

return nil

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

function BuildRibbon( oWnd )

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

   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: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:Default()

return nil

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


Image
regards, saludos

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

Re: Ribbon Theme

Postby rhlawek » Sun Apr 28, 2019 2:34 pm

Antonio,

In the last example given for setting up a ribbon bar, it compiles and runs correctly.

However, I typically use a small button bar above the ribbon bar, but when I add the following to the BuildRibbon function, immediately after the local declarations, the layout is no longer correct, apparently because the top of the ribbon bar location gets pushed down.

DEFINE BUTTONBAR oBar SIZE 22, 22 _3D _2010 OF oWnd

I've tested changing the various positioning values but have not figured out how to do a satisfactory layout. If you can guide me to what needs to be change it would be most helpful.

Also, I typically use a ribbon bar in an MDI window, when I make the window in this sample and MDI window, and add the button bar, the ribbon bar itself isn't clickable at all.

Any pointers on how to address this?
User avatar
rhlawek
 
Posts: 194
Joined: Sun Jul 22, 2012 7:01 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 38 guests