FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Defined Group-Colors for Ribbonbar FW 9.07
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Defined Group-Colors for Ribbonbar FW 9.07
Posted: Tue Aug 11, 2009 01:26 PM
Hello,

today I started testing the Ribbonbar-Class to work out, how to make any Background- and Color-Changes.
Scrolling throught the sample, I noticed a wrong Alphabutton-Display.



I started to change the Basic-Settings, to find out, what is possible.
I wanted to change the Basic-Gradient-Color < oRBar:aGrad >
but there was no change. Maybe it is not possible ?
Folder-Tabs and Outline works. Are there any Values from the List, I cannot change ?



oRBar:nClrBoxOut := 128 // Ribbonbar-Outline-Color
oRBar:nClrBoxIn := 0 // Ribbonbar-Inline-Color
oRBar:nClrBoxSelOut := 32768
oRBar:nClrBoxSelIn := 32768
oRBar:aGradFld := { { 1, 16777215, 8293112 } } // Folder-Gradient
oRBar:aGrad := { {0.12, 32768, 32768 }, { 0.70, 10674091, 32768 }, { 0.18, 32768, 16777215 }}
oRBar:aGradHigh := { { 1, 2279491, 10674091 } }
oRBar:aGradOver := { { 1, 13873022, 10674091 } }

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 09:16 AM
Uwe,

See how it looks here on Windows 7:

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 11:26 AM
Uwe,

Please try this:
Code (fw): Select all Collapse
function ChangeColors( oRb, aGrad )

   local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
                              oRb:nBottom - oRb:nTopMargin + 1, aGrad )
   local n                            

   DeleteObject( oRb:hBrushEx ) 
   oRb:hBrushEx = CreatePatternBrush( hBmp )
   DeleteObject( hBmp )
   
   oRb:Refresh()
   
   for n = 1 to Len( oRb:aDialogs )
      oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
      oRb:aDialogs[ n ]:Refresh()
   next   
   
return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 12:08 PM
Uwe,

This one is a better one:
Code (fw): Select all Collapse
function ChangeColors( oRb, aGrad )

  local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
                             oRb:nBottom - oRb:nTopMargin + 1, aGrad )
  local n, j, z, oControl

  oRb:aGrad := aGrad

  DeleteObject( oRb:hBrushEx ) 
  oRb:hBrushEx = CreatePatternBrush( hBmp )
  DeleteObject( hBmp )
  
  oRb:Refresh()
  
  for n = 1 to Len( oRb:aDialogs )
     DeleteObject( oRb:aDialogs[ n ]:hBack )
     oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
     if ! Empty( oRb:aDialogs[ n ]:aControls )
        for j = 1 to len( oRb:aDialogs[ n ]:aControls )
           oControl = oRb:aDialogs[ n ]:aControls[ j ]
           if oControl:ClassName() == "TRBGROUP"
              DeleteObject( oControl:hBrushUnsel )
              oControl:hBrushUnsel = oRb:hBrushEx
              DeleteObject( oControl:hBrushSel )
              oControl:hBrushSel = nil
           endif
        next
     endif

     oRb:aDialogs[ n ]:Refresh()
  next   
  
return nil

Edited 2 times
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 12:16 PM
... ACTION ChangeColors( oRBar, { { 0.12, 16777215, 10674091 }, { 0.70, 10674091, 32768 }, { 0.18, 32768, 16777215 } } )



regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 12:33 PM
Antonio,
Thank You very much.
I didn't see, You changed the Function in the meantime.

It works fine now.

ACTIVATE WINDOW oWnd ;
ON PAINT ChangeColors( oRBar, aGrad )



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 06:08 PM

Uwe,

Very good! :-)

We look forward to use a great tool from you for RibbonBar settings. Surely many of us will use it and appreciate it :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Group-Colos in Ribbonbar FW 9.07
Posted: Wed Aug 12, 2009 06:53 PM
Antonio,

A little change to Your Function using different Group-Colors and Fonts.
Maybe we still need a defined Font-Color for Background-Contrast.



Code (fw): Select all Collapse
// Basic-Settings
// -----------------
oRBar:nClrBoxOut := 128 // Ribbonbar-Outline-Color
oRBar:nClrBoxIn := 0 // Ribbonbar-Inline-Color
oRBar:nClrBoxSelOut := 32768
oRBar:nClrBoxSelIn := 32768
oRBar:aGradFld := { { 1, 16777215, 8293112 } } // Folder-Gradient
oRBar:aGradHigh := { { 1, 2279491, 10674091 } }
oRBar:aGradOver := { { 1, 13873022, 10674091 } }
oRBar:nHeightFld := 30 // Folder-Height

// Store all Settings in a Group-Array
// We use 5 Groups
// ----------------------------------------
PRIVATE aPara[5][4]

aPara[1][1] := { {0.12, 8388608, 16777215 }, { 0.12, 16777215, 8388608 } }
aPara[2][1] := { {0.12, 32768, 16777215 }, { 0.12, 16777215, 32768 } }
aPara[3][1] := { {0.12, 128, 16777215 }, { 0.12, 16777215, 128 } }
aPara[4][1] := { {0.12, 7715788, 16777215 }, { 0.12, 16777215, 7715788 } }
aPara[5][1] := { {0.12, 15987493, 16777215 }, { 0.12, 16777215, 15987493 } }

oFont1 := TFont():New("Arial", ,-15,.F.,.T. , , , ,.T. )
oFont2 := TFont():New("Arial", ,-12,.F.,.T. , , , ,.F. )

aPara[1][2] := oFont1
aPara[2][2] := oFont1
aPara[3][2] := oFont2
aPara[4][2] := oFont2
aPara[5][2] := oFont1

aPara[1][3] := 0
aPara[2][3] := 128
aPara[3][3] := 32768
aPara[4][3] := 0
aPara[5][3] := 32768

SET MESSAGE OF oWnd TO "Testing FWH own Class RibbonBar" ;
CENTERED CLOCK KEYBOARD 2007
   
ACTIVATE WINDOW oWnd ;
ON PAINT ChangeColors( oRBar )
   
oRBar:End()
oFont1:End()
oFont2:End()
   
RETURN NIL

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

FUNCTION ChangeColors( oRb )

local hBmp := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
    oRb:nBottom - oRb:nTopMargin + 1, aPara[1][1])
local n, j, z, oControl, cPos, oFont

oRb:aGrad := aPara[1][1]

DeleteObject( oRb:hBrushEx ) 
oRb:hBrushEx = CreatePatternBrush( hBmp )
DeleteObject( hBmp )
  
oRb:Refresh()
  
FOR n = 1 to Len( oRb:aDialogs )
   DeleteObject( oRb:aDialogs[ n ]:hBack )
   oRb:aDialogs[ n ]:hBack = oRb:hBrushEx
   IF ! Empty( oRb:aDialogs[ n ]:aControls )
      FOR j = 1 to len( oRb:aDialogs[ n ]:aControls )
         cPOS := Alltrim(Str(j))
         oControl = oRb:aDialogs[ n ]:aControls[ j ]
         IF oControl:ClassName() == "TRBGROUP"
            DeleteObject( oControl:hBrushUnsel )
            hBmp&cPos := GradientBmp( oRb, oRb:nRight - oRb:nRightMargin - 3,;
            oRb:nBottom - oRb:nTopMargin + 1, aPara[j][1] )
            oRb:hBrushEx = CreatePatternBrush( hBmp&cPos )
            DeleteObject( hBmp&cPos )
            oControl:hBrushUnsel = oRb:hBrushEx
            oControl:oFont := aPara[j][2] 
            oControl:nClrTxt := aPara[j][3]
            DeleteObject( oControl:hBrushSel )
            oControl:hBrushSel = nil
         ENDIF
      NEXT
  ENDIF
  oRb:aDialogs[ n ]:Refresh()
NEXT

oFont:End()

RETURN NIL


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 07:36 PM

Uwe,

Looks great!

I notice that with the last two groups the right and bottom of the background is not transparent. Is this a bug? I wonder why it only affects two groups?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?
Posted: Wed Aug 12, 2009 07:44 PM

James,

it is fixed already.
I didn't define all Group-Colors inside the FOR NEXT :roll:

Best Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Defined Group-Colors for Ribbonbar FW 9.07
Posted: Thu Aug 13, 2009 09:11 AM
Antonio,

I finished testing the Ribbonbar.
Now I can change any Value I like and it works perfect.

2 Values I couldn't find out, how to change :
1. Tab-Text-Color ( seems to be a System-Color )
2. Bottom-Space to adjust to the Font-Size



Can I change these Values ?

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Defined Group-Colors for Ribbonbar FW 9.07
Posted: Thu Aug 13, 2009 02:17 PM

Uwe,

Great work, looks very nice! :-)

We are going to check how to easily change those values, thanks

Are you already working on a new designer ? :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Defined Group-Colors for Ribbonbar FW 9.07
Posted: Thu Aug 13, 2009 07:09 PM

Hello Uwe...

> 1. Tab-Text-Color ( seems to be a System-Color )
Actually is not possible change Tab-Text-Color, but is not complicated apply this change...

>2. Bottom-Space to adjust to the Font-Size
yo can try use cText + CRLF + " ", bottom Space adjust automatic when detect more lines, what is the best way? new data with Bottom-Space height ?? or Bottom-Space auto-adjust with Font Height???

Best regards

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Defined Group-Colors for Ribbonbar FW 9.07
Posted: Thu Aug 13, 2009 07:58 PM
Daniel,

Thank You very much.
The CRLF solved the Problem. For my Test I used a very big Font.



With the Tab-Text-Color I don't know where the Color comes from.
If the Color is always dark, maybe the User has to choose a light Tab_gradient
if the Color cannot be defined ?
But it makes it impossible, to use a dark Background.



Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Defined Group-Colors for Ribbonbar FW 9.07
Posted: Fri Aug 14, 2009 11:40 PM

Hello Daniel,

is it possible to disable the Folder-Tabs as a Option ( just a Bar with Groups ) ?

Best Regards
Uwe :lol:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.