alternate columns colors

alternate columns colors

Postby Silvio.Falconi » Mon Jan 09, 2023 12:26 pm

coloring alternate rows we can do

oBrw:bClrStd := { || { CLR_BLACK, If( oBrw:KeyNo % 2 == 0, nColor1, nColor2 ) } }

how can we color the columns alternately?


For a sample if I wish colorized only the 4th colomn I made
Code: Select all  Expand view  RUN


Function Alternate_Columns(nColor1,oBrw)
   local aPos  := { { 1, 4 }, { 2, 4 }, { 3, 4 }, { 4, 4 }, { 5, 4 }, { 6, 4 } }
   local oCol
   local nColor2:=CLR_WHITE

  for each oCol in oBrw:aCols
      oCol:bClrStd   := GenClrBlock( oCol, aPos,nColor1,nColor2 )
   next
   oBrw:refresh()
   return  nil

  static function GenClrBlock( oCol, aPos,nColor1,nColor2 )

   local oBrw  := oCol:oBrw
   local nCol  := oCol:nCreationOrder
   local xCol

   xCol  := nCol // your calculation

return { || If( AScan( aPos, { |a| a[ 1 ] == oBrw:nArrayAt .and. a[ 2 ] == xCol } ) > 0, ;
            { CLR_WHITE, nColor1 }, { CLR_BLACK, nColor2 } ) }
 


how can i not pass a specific column?
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: 7066
Joined: Thu Oct 18, 2012 7:17 pm

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests