FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Changing Tab-text color on TRibbon?
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Changing Tab-text color on TRibbon?
Posted: Tue May 15, 2012 08:15 AM

Hello, as in the subject...

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Changing Tab-text color on TRibbon?
Posted: Tue May 15, 2012 10:00 AM
Hello Günther,
I think you have to change the class.

Gruß
Otto


Code (fw): Select all Collapse
 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
                    >
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing Tab-text color on TRibbon?
Posted: Tue May 15, 2012 10:13 AM
Hello Günther,




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 :-)
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: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Changing Tab-text color on TRibbon?
Posted: Tue May 15, 2012 12:03 PM

Thanks all! Both variants are possible.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Changing Tab-text color on TRibbon?
Posted: 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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing Tab-text color on TRibbon?
Posted: Tue May 15, 2012 04:36 PM
Hello Otto,

it was a bit more complicated :



Code (fw): Select all Collapse
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 :-)
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.

Continue the discussion