different backgroundcolors for each column

Post Reply
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

different backgroundcolors for each column

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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 ) ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Marc Vanzegbroeck
Posts: 1102
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium
Contact:

Post by Marc Vanzegbroeck »

Thanks Antonio,

It"s working now!!!

Marc
Post Reply