XBrowse alternating row colors
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- wilsongamboa
- Posts: 439
- Joined: Wed Oct 19, 2005 6:41 pm
- Location: Quito - Ecuador
James Nice Sample
we compile with fwh 2.7 and xHarbour and works well
with only .dbf
with .dbf + Index
with .dbf + Index + Filter
Thanks
att
we compile with fwh 2.7 and xHarbour and works well
with only .dbf
with .dbf + Index
with .dbf + Index + Filter
Thanks
att
Wilson 'W' Gamboa A
Wilson.josenet@gmail.com
Wilson.josenet@gmail.com
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- richard-service
- Posts: 583
- Joined: Tue Oct 16, 2007 8:57 am
- Location: New Taipei City, Taiwan
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
I use modified txbrowse for my software.James Bott wrote:Richard and NageswaraRao,
I am at a loss as to why it isn't working for you. I'm thinking it must be differences in TXBrowse. NageswaraRao, didn't you say in another message thread that you are using a modified TXBrowse? Could you be linking in this instead of the standard FWH version?
I am using xHarbour, are you?
James
But when i test anything here for the forum discussions, I test with FWH 8.01 libraries only and do not use my extensions. Some time today i shall work again when i get some time and come out with the circumstances under which it breaks.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Mr James
1) Please start your application.
(a) Resize the window to increase the height to bring into visibility one more row. Now thre are odd number of rows. Make sure that the number of rows displayed is an odd number.
(b) Click on 2nd row. Then click on 4th tow. Then keep clicking on even rows till the last even row.
This is the result of the screen shot.
There are quite a few other circustances when the logic fails. But I hope one example is enough.
I still feel there is no substitute for the Browse calling the color codeblock with the visible row number as a parameter as we earlier discussed about tcbrowse class.
I have tested using exact copy of your code with unmodified libraries of FWH 8.01. The problem I reported arises occasionally under different circumstances. One I report here.James Bott wrote:Richard and NageswaraRao,
I am at a loss as to why it isn't working for you. I'm thinking it must be differences in TXBrowse. NageswaraRao, didn't you say in another message thread that you are using a modified TXBrowse? Could you be linking in this instead of the standard FWH version?
I am using xHarbour, are you?
James
1) Please start your application.
(a) Resize the window to increase the height to bring into visibility one more row. Now thre are odd number of rows. Make sure that the number of rows displayed is an odd number.
(b) Click on 2nd row. Then click on 4th tow. Then keep clicking on even rows till the last even row.
This is the result of the screen shot.
There are quite a few other circustances when the logic fails. But I hope one example is enough.
I still feel there is no substitute for the Browse calling the color codeblock with the visible row number as a parameter as we earlier discussed about tcbrowse class.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
NageswaraRao,
I see the problem you described. I will have to think about a solution.
>I still feel there is no substitute for the Browse calling the color codeblock with the visible row number as a parameter as we earlier discussed about tcbrowse class.
This does not seem so easy. In addition to the visible row number you would also need to know which color the first row was in order to figure out which color to make the current row. So you would need var to keep track of this and you would have to update it each time the first visible row was a new record. Then you would have to calculate the color of the current row based on the color of the first row and the row number of the current row.
James
I see the problem you described. I will have to think about a solution.
>I still feel there is no substitute for the Browse calling the color codeblock with the visible row number as a parameter as we earlier discussed about tcbrowse class.
This does not seem so easy. In addition to the visible row number you would also need to know which color the first row was in order to figure out which color to make the current row. So you would need var to keep track of this and you would have to update it each time the first visible row was a new record. Then you would have to calculate the color of the current row based on the color of the first row and the row number of the current row.
James
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Yes. All that is taken care of in my tcbrowse solution. You just check if it is even or odd. Please make the modifications i suggested to tcbrowse class it will work without problem.James Bott wrote:NageswaraRao,
This does not seem so easy. In addition to the visible row number you would also need to know which color the first row was in order to figure out which color to make the current row. So you would need var to keep track of this and you would have to update it each time the first visible row was a new record. Then you would have to calculate the color of the current row based on the color of the first row and the row number of the current row.
James
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
You can use this line with TXBrowse and it elminates the problem described by NageswaraRao.
oBrw:bClrStd:= {|| if( (cAlias)->(ordkeyno()) % 2 == 0 ,{ CLR_BLACK, COLOR_LIGHT },{ CLR_BLACK, COLOR_DARK }) }
However, I understand that ordkeyno() is very slow with ADS so you probably can't use it with ADS.
James
oBrw:bClrStd:= {|| if( (cAlias)->(ordkeyno()) % 2 == 0 ,{ CLR_BLACK, COLOR_LIGHT },{ CLR_BLACK, COLOR_DARK }) }
However, I understand that ordkeyno() is very slow with ADS so you probably can't use it with ADS.
James