xBrowse and bClrStd
Posted: Mon Sep 07, 2020 10:33 am
Good morning RAO
I have an array of colors and would like to apply it to the columns
this example works
if I change with array ,it doesn't work
Maurizio
I have an array of colors and would like to apply it to the columns
this example works
Code: Select all
#include "fivewin.ch"
#include "xbrowse.ch"
function main()
local oDlg, oBrw
local aData := { { "One", "Two" ,"_111"}, { "Three", "Four","_222" }, { "Five", "Six","_333" } }
DEFINE DIALOG oDlg SIZE 300,200 PIXEL TITLE FWVERSION
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE aData AUTOCOLS ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:bClrStd := { || { CLR_BLACK, CLR_WHITE } }
:aCols[ 1 ]:bClrStd := { || { CLR_BLACK, CLR_HGREEN } }
:aCols[ 2 ]:bClrStd := { || { CLR_BLACK, CLR_RED} }
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
return nil
Code: Select all
function main()
local oDlg, oBrw
local aData := { { "One", "Two" ,"_111"}, { "Three", "Four","_222" }, { "Five", "Six","_333" } }
lOCAL aColor := {CLR_HGREEN , CLR_RED}
DEFINE DIALOG oDlg SIZE 300,200 PIXEL TITLE FWVERSION
@ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
DATASOURCE aData AUTOCOLS ;
CELL LINES NOBORDER
WITH OBJECT oBrw
:bClrStd := { || { CLR_BLACK, CLR_WHITE } }
FOR n := 1 to 2
:aCols[ n ]:bClrStd := { || { CLR_BLACK,:aCols[n] } }
NEXT
:CreateFromCode()
END
ACTIVATE DIALOG oDlg CENTERED
return nil