Hi Franco,
I am not sure that I correctly understand you need.
If
mlnr's suggestion is helpful then I wonder if your CodeBlock might use a different Function for each column.
My example, below, purposly calls the
same function,
GetColumnBackColor(), for each of the 4 columns.
Perhps you could adapt the following with, instead,
column-specific functions:
Code: Select all
//// In Main.PRG
PUBLIC gnRowNbr := 0 // See: function GetColumnBackColor()
PUBLIC gaRowColor := {} // See: function GetColumnBackColor()
// There are only 3 Columns in this example
PUBLIC gaBrowseStateDynamicBackColor := { {|x, CellRowIndex | GetColumnBackColor( This.CellRowIndex ) } ;
, {|x, CellRowIndex | GetColumnBackColor( This.CellRowIndex ) } ;
, {|x, CellRowIndex | GetColumnBackColor( This.CellRowIndex ) } ;
, {|x, CellRowIndex | GetColumnBackColor( This.CellRowIndex ) } }
//////////////////////////////
* - - - - - - - - - - - - -
FUNCTION GetColumnBackColor( param_CellRowIndex )
// Called from DynamicBackColor CodeBlock
LOCAL lcReturnVal := {}
DO CASE
CASE ( gnRowNbr == param_CellRowIndex )
// Short circut - Row color already calculated!
lcReturnVal := gaRowColor
CASE ( gcStateMergeFldType == "C" ) /* {"TEXTBOX"} */
/* Magic number 1 (below) is the column number for By_State->MergeState: */
lcReturnVal := iif( ( ( GetProperty( "Main", "BrowseStates", "CellEx", param_CellRowIndex, gnColTest ) == "Y" ) ) ;
, iif( GetProperty( "Main", "BrowseStates", "CellEx", param_CellRowIndex, 1 ) != "Y" ;
, {255,255,255}, {190,255,170} ), {255,150,150} )
CASE ( gcStateMergeFldType == "L" ) /* {"CHECKBOX"} */
lcReturnVal := iif( ( ( GetProperty( "Main", "BrowseStates", "CellEx", param_CellRowIndex, gnColTest ) == "Y" ) ) ;
, iif( empty( GetProperty( "Main", "BrowseStates", "CellEx", param_CellRowIndex, 1 ) ) ;
, {255,255,255}, {190,255,170} ), {255,150,150} )
END CASE
gnRowNbr++
gaRowColor := lcReturnVal
RETURN lcReturnVal
// End function GetColumnBackColor
In my example above each of the 4 columns uses the
same DynamicBackColor.
Your CodeBlock might call appropriate "Column color" functions for each of your columns' needs.
I hope that this might be helpful.
Kind Regards,
Red2