Changing Tab-text color on TRibbon?

Changing Tab-text color on TRibbon?

Postby byte-one » Tue May 15, 2012 8:15 am

Hello, as in the subject...
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Changing Tab-text color on TRibbon?

Postby Otto » Tue May 15, 2012 10:00 am

Hello Günther,
I think you have to change the class.

Gruß
Otto


Code: Select all  Expand view


 bPaintTxt  := <  | oSelf |
                    local hOldFont, nClrTxt, nOldClr, nMode
                    hOldFont  = SelectObject( hDCMem, oSelf:oFont:hFont  )
                    if ValType( oSelf:aClrTabTxt[ nPrompt ] ) == "N"
                       nClrTxt = oSelf:aClrTabTxt[ nPrompt ]
                    elseif ValType( oSelf:aClrTabTxt[ nPrompt ] ) == "B"
                       nClrTxt = Eval( oSelf:aClrTabTxt[ nPrompt ], oSelf )
                    else
                       nClrTxt = CLRTEXT
                    endif
                    if nPrompt == oSelf:nStart
                       nClrTxt = CLR_WHITE
                    endif
                   
                          //@Otto                     
                          if  nType = 3
                              nClrTxt = CLR_GREEN
                          endif
                          //@Otto
                     
                      nOldClr   = SetTextColor( hDCMem, if( oSelf:aEnable[ nPrompt ], nClrTxt, GetSysColor( COLOR_GRAYTEXT ) ) )
                   
                    nMode     = SetBkMode( hDCMem, TRANSPARENT )
                   
                   
                    DrawText( hDCMem, oSelf:aPrompts[ nPrompt ], { nRow+2, nCol, nRow + oSelf:nHeightFld+1, nCol + oSelf:aSizes[ nPrompt ] }, ;
                                       nOr( DT_SINGLELINE, DT_VCENTER, DT_CENTER, DT_NOPREFIX ) )
                    SetBkMode(hDCMem, nMode )

                    SetTextColor( hDCMem, nOldClr )
                    SelectObject( hDCMem, hOldFont  )
                    return nil
                    >
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Changing Tab-text color on TRibbon?

Postby ukoenig » Tue May 15, 2012 10:13 am

Hello Günther,

Image


oRibbon:aGradFld := {| nOpt | if( nOpt == oRibbon:nStart, { { 1, 16777215, 8293112 } },;
{ { 1, 8293112, 16777215 } } ) } // Tabcolor
oRibbon:nClrPaneRB := 14856016 // Background blue
oRibbon:aClrTabTxt[1] := 0 // a different Color for each prompt ( black )
oRibbon:aClrTabTxt[2] := 128 // ( red )
oRibbon:aClrTabTxt[3] := 65535 // ( yellow )
oRibbon:aClrTabTxt[4] := 4259584 // ( light green )
oRibbon:aClrTabTxt[5] := 8114941 // ( orange )


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: Changing Tab-text color on TRibbon?

Postby byte-one » Tue May 15, 2012 12:03 pm

Thanks all! Both variants are possible.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Changing Tab-text color on TRibbon?

Postby Otto » Tue May 15, 2012 12:29 pm

Hello Uwe,

how can you change hover text colour on ribbon if

if nPrompt == oSelf:nStart
nClrTxt = CLR_WHITE
endif
id inside the painting method.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: Changing Tab-text color on TRibbon?

Postby ukoenig » Tue May 15, 2012 4:36 pm

Hello Otto,

it was a bit more complicated :

Image

Code: Select all  Expand view

oRibbon:nClrPaneRB := 16641734 // Background-Color
oRibbon:nTop := 25
oRibbon:nHeight := 200
oRibbon:nGroupSeparation := 20
oRibbon:oFont := oFont // Tab-Fonts
oRibbon:nHeightFld := 30 // Folder-Tab--Height
oRibbon:nClrBoxSelIn := 32768
oRibbon:aGradFld  := {| nOpt | if( nOpt == oRibbon:nStart, { { 1, 16777215, 8293112 } },; // Tabcolor
                                                { { 1,  8293112, 16777215 } } ) }
oRibbon:aGradOver := { { 1, 13873022, 16777215 } } // Folder-Mouse-Focus
oRibbon:nClrPaneRB := 14856016    // Background blue
oRibbon:aClrTabTxt[1] := 16750487
oRibbon:aClrTabTxt[2] := 7303167
oRibbon:aClrTabTxt[3] := 65535
oRibbon:aClrTabTxt[4] := 4259584
oRibbon:aClrTabTxt[5] := 8114941

oRibbon:bMMoved := { |nRow, nCol | n := oRibbon:nOverPrompt( nRow, nCol ), ;
oRibbon:aClrTabTxt[1] := 16750487, ;
oRibbon:aClrTabTxt[2] := 7303167, ;
oRibbon:aClrTabTxt[3] := 65535, ;
oRibbon:aClrTabTxt[4] := 4259584, ;
oRibbon:aClrTabTxt[5] := 8114941, ;
IIF( n = 1, oRibbon:aClrTabTxt[1] := 0, NIL ), ;
IIF( n = 2, oRibbon:aClrTabTxt[2] := 0, NIL ), ;
IIF( n = 3, oRibbon:aClrTabTxt[3] := 0, NIL ), ;
IIF( n = 4, oRibbon:aClrTabTxt[4] := 0, NIL ), ;
IIF( n = 5, oRibbon:aClrTabTxt[5] := 0, NIL ), oRibbon:Refresh() }
 


Best Regards
Uwe :oops:
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


Return to FiveWin for Harbour/xHarbour

Who is online

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