FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBrowse alternating row colors
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
XBrowse alternating row colors
Posted: Thu Jan 24, 2008 10:43 AM

OrdKeyNo() always works.
If we are browsing arrays we should consider Array row number. Like that depending on what we browse we shoud write the code.

But we were looking for a common solution which works irrespective of the data source being browsed.

It is good if we can make our code for common tasks as generic and as reusable as possible. That improves the productivity of normal application development.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
XBrowse alternating row colors
Posted: Thu Jan 24, 2008 11:18 AM

NageswaraRao,

>But we were looking for a common solution which works irrespective of the data source being browsed.

Agreed. I haven't found a good common solution. I just posted the OrdKeyNo() as a temporary solution for DBFs.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
XBrowse alternating row colors
Posted: Tue Jan 29, 2008 04:56 PM

Hello James

I try your sample

oBrw:bClrStd:= {|| if( (cAlias)->(ordkeyno()) % 2 == 0 ,{ CLR_BLACK, COLOR_LIGHT },{ CLR_BLACK, COLOR_DARK }) }

works fine but if you keep press the key ARROW DOWN after the first page the color remain the same .

Regards Maurizio

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
XBrowse alternating row colors
Posted: Tue Jan 29, 2008 05:53 PM

Maurizio,

It works fine here with the down arrow. Are you using my example code or did you put this into your own program? I suggest trying my example program listed in a previous message.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
XBrowse alternating row colors
Posted: Tue Jan 29, 2008 06:05 PM

Mr James

The logic fails to work when the number of visible rows is an odd number. Continuous colors can be seen in many ways of navigation.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
XBrowse alternating row colors
Posted: Tue Jan 29, 2008 06:40 PM

NageswaraRao,

>The logic fails to work when the number of visible rows is an odd number. Continuous colors can be seen in many ways of navigation.

I think you are referring to my lClrFlag method, not the OrdKeyNo() method. The ordKeyNo() should not be affected by the number of rows visible in the browse. With ordKeyNo() and 13 visible rows, I do not see the problem.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
XBrowse alternating row colors
Posted: Tue Jan 29, 2008 06:41 PM

Yes

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion