Page 1 of 1

different backgroundcolors for each column

Posted: Sun Jul 27, 2008 2:19 pm
by Marc Vanzegbroeck
Hi,

Is it possible to have in each column an other backgroundcolor with the normal browse or should I use xBrowse?

Thanks,
Marc

Posted: Sun Jul 27, 2008 3:57 pm
by Antonio Linares
Marc,

You can have different background colors for each column with TWBrowse this way:

oBrowse:nClrPane := { | nCol | ColumnColor( nCol ) }

where function ColumnColor( nColumn ) should return the nRGB() color to use for each column

Posted: Sun Jul 27, 2008 7:32 pm
by Marc Vanzegbroeck
Antonio,

I use

Code: Select all

func ColumnColor(ncol)
local ret_val
   msginfo(ncol)
   if ncol= 1
      ret_val = arts->hkleur
   else
      ret_val = arts->kleur
   endif
return ret_val
The fields arts->hkleur and arts->kleur are holding the rgb color.
I inserted a msginfo() to see the value in ncol but it's always returing nil. How do I know the column number?

Thanks,
Marc

Posted: Sun Jul 27, 2008 7:48 pm
by Antonio Linares
Marc,

What FWH version are you using ?

Please check that you have this code in Class TWBrowse, function wBrwLine()

Code: Select all

SetBkColor( hDC, If( nColAct != nil, If( ValType( nClrBack ) == "B",;
                             Eval( nClrBack, n ), nClrBack ),;
                             If( ValType( nClrPane ) == "B", Eval( nClrPane, n ), nClrPane ) ) )

Posted: Sun Jul 27, 2008 8:06 pm
by Marc Vanzegbroeck
Antonio,

I use FWH7.10.

I have this line

Code: Select all

               SetBkColor( hDC, If( nColAct != nil, If( ValType( nClrBack ) == "B",;
                             Eval( nClrBack ), nClrBack ), nClrPane ) )
Regards,
Marc

Posted: Sun Jul 27, 2008 8:20 pm
by Antonio Linares
Marc,

Please modify it as I have described it

Anyhow, if you want that one and many other new features, then I suggest you to upgrade to current FWH 8.07

Posted: Mon Jul 28, 2008 7:00 am
by Marc Vanzegbroeck
Thanks Antonio,

It"s working now!!!

Marc