FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour different backgroundcolors for each column
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
different backgroundcolors for each column
Posted: Sun Jul 27, 2008 02:19 PM

Hi,

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

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
different backgroundcolors for each column
Posted: Sun Jul 27, 2008 03:57 PM

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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
different backgroundcolors for each column
Posted: Sun Jul 27, 2008 07:32 PM
Antonio,

I use
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
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
different backgroundcolors for each column
Posted: Sun Jul 27, 2008 07:48 PM
Marc,

What FWH version are you using ?

Please check that you have this code in Class TWBrowse, function wBrwLine()
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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
different backgroundcolors for each column
Posted: Sun Jul 27, 2008 08:06 PM
Antonio,

I use FWH7.10.

I have this line
               SetBkColor( hDC, If( nColAct != nil, If( ValType( nClrBack ) == "B",;
                             Eval( nClrBack ), nClrBack ), nClrPane ) )


Regards,
Marc
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
different backgroundcolors for each column
Posted: Sun Jul 27, 2008 08:20 PM

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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
different backgroundcolors for each column
Posted: Mon Jul 28, 2008 07:00 AM

Thanks Antonio,

It"s working now!!!

Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite

Continue the discussion