I want to color the columns with a brush, I don't know the contents of each column, it can be alphanumeric, numeric, logical, data
and I want to color it if it doesn't contain any data
I made and I used Empty function
but not run ok
I tried also with a codeblock
any solution ?
I made a minimal test to try
and I want to color it if it doesn't contain any data
I made and I used Empty function
For n=1 to LEN(oBrw:aCols)
oCol := oBrw:aCols[ n ]
oCol:oBrush := {|| iif( Empty(oBrw:aArrayData[oBrw:KeyNo(),n] ), oBrush, nil ) }
Next nI tried also with a codeblock
for each oCol in oBrw:aCols
oCol:oBrush := GenClrBlock( oCol,oBrush )
next
static function GenClrBlock( oCol,oBrush )
local oBrw := oCol:oBrw
local nCol := oCol:nCreationOrder
local xCol
return { || iif( Empty(oBrw:aArrayData[oBrw:KeyNo(),nCol] ), ;
oBrush, nil ) }I made a minimal test to try
#include "fivewin.ch"
#include "xbrowse.ch"
function main()
local oDlg, oBrw
local aData := { { "One", "Two" }, { " ", "2" }, { "Five", "Six" } }
local oBrush
DEFINE BRUSH oBrush STYLE BDIAGONAL COLOR CLR_BLUE
DEFINE DIALOG oDlg SIZE 300,200 PIXEL TITLE "Test brush"
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE aData AUTOCOLS ;
CELL LINES NOBORDER
WITH OBJECT oBrw
For n=1 to LEN(oBrw:aCols)
oCol := oBrw:aCols[ n ]
oCol:oBrush := { ||iif( Empty(oBrw:aArrayData[oBrw:KeyNo(),n] ), oBrush, nil ) }
next
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
return nilSince from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 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
I use : FiveWin for Harbour March-April 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