Defined Group-Colors for Ribbonbar FW 9.07

Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Tue Aug 11, 2009 1: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.

Image

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 ?

Image

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 :lol:
Last edited by ukoenig on Wed Aug 12, 2009 8:08 pm, edited 2 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby Antonio Linares » Wed Aug 12, 2009 9:16 am

Uwe,

See how it looks here on Windows 7:

Image
regards, saludos

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

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby Antonio Linares » Wed Aug 12, 2009 11:26 am

Uwe,

Please try this:
Code: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby Antonio Linares » Wed Aug 12, 2009 12:08 pm

Uwe,

This one is a better one:
Code: Select all  Expand view

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby Antonio Linares » Wed Aug 12, 2009 12:16 pm

... ACTION ChangeColors( oRBar, { { 0.12, 16777215, 10674091 }, { 0.70, 10674091, 32768 }, { 0.18, 32768, 16777215 } } )

Image

Image
regards, saludos

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

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby ukoenig » 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 )

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby Antonio Linares » Wed Aug 12, 2009 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Group-Colos in Ribbonbar FW 9.07

Postby ukoenig » Wed Aug 12, 2009 6: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.

Image

Code: Select all  Expand view

// 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 :lol:
Last edited by ukoenig on Thu Aug 13, 2009 8:33 am, edited 13 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby James Bott » Wed Aug 12, 2009 7: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Wrong Alpha-Button-Painting in Ribbonbar FW 9.07 ?

Postby ukoenig » Wed Aug 12, 2009 7: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Thu Aug 13, 2009 9: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

Image

Can I change these Values ?

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Antonio Linares » Thu Aug 13, 2009 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby Daniel Garcia-Gil » Thu Aug 13, 2009 7: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
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » Thu Aug 13, 2009 7:58 pm

Daniel,

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

Image

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.

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Defined Group-Colors for Ribbonbar FW 9.07

Postby ukoenig » 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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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