Tcbrowse 2 colour one for each line
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Skipper
James,
A reminder ... with ADS, using tSBrowse ( and I would assume others ), nRecs is returned as an unknown type of data element when there are no records to browse. Thus, using the ordKeyNo() ( or ADSKeyNo() ) method described by Antonio will work without a problem.
Of course, I am using data objects ... love them ... wouldn't be without them.
Tim
A reminder ... with ADS, using tSBrowse ( and I would assume others ), nRecs is returned as an unknown type of data element when there are no records to browse. Thus, using the ordKeyNo() ( or ADSKeyNo() ) method described by Antonio will work without a problem.
Of course, I am using data objects ... love them ... wouldn't be without them.
Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Tim,
>A reminder ... with ADS, using tSBrowse ( and I would assume others ), nRecs is returned as an unknown type of data element when there are no records to browse.
I'm sure we could write a routine to trap unknown data types.
>Thus, using the ordKeyNo() ( or ADSKeyNo() ) method described by Antonio will work without a problem.
AHF says that using ordKeyNo() makes it very slow, thus I was showing another way without using ordKeyNo(). He did not state which RDD he was using.
James
>A reminder ... with ADS, using tSBrowse ( and I would assume others ), nRecs is returned as an unknown type of data element when there are no records to browse.
I'm sure we could write a routine to trap unknown data types.
>Thus, using the ordKeyNo() ( or ADSKeyNo() ) method described by Antonio will work without a problem.
AHF says that using ordKeyNo() makes it very slow, thus I was showing another way without using ordKeyNo(). He did not state which RDD he was using.
James
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
ADSKeyNo()
With this function I have no speed issue. In fact, your modifications of tSBrowse make it FLY with the mousewheel ...
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
I'm using RMDBCDX wich works ok except in what concernes networking with the use of ordkeyno or ordkeycount.
It seems that this RDD has no caching as Clipper did thus the applications using these functions extensively within a network will see a speed degradation to a point were you can't work anymore.
I'm in the process of using ADS but I have some problems with the convertion process, so for now I must use other alternative RDD.
I'm trying James skipblock but it seems it will not work. My former nClrPane block it works only skipping down the table I 'm figuring out why. Since it is a Tcbrowse object and the nClrPane is evaluated painting each column the block can only be evaluate once for each line otherwise you'll get a chess browse.
Antonio
It seems that this RDD has no caching as Clipper did thus the applications using these functions extensively within a network will see a speed degradation to a point were you can't work anymore.
I'm in the process of using ADS but I have some problems with the convertion process, so for now I must use other alternative RDD.
I'm trying James skipblock but it seems it will not work. My former nClrPane block it works only skipping down the table I 'm figuring out why. Since it is a Tcbrowse object and the nClrPane is evaluated painting each column the block can only be evaluate once for each line otherwise you'll get a chess browse.
Antonio
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
TCBrowse natively tries to provides a way to paint different colors on the basis of visual row numbers. If obrw:nClrPane is a code block, the paint method evaluates obrw:nclrpane, with visual row number and column number as two parameters. If the the following code is adopted
the browse paints alternative rows with different colors. It works well if the naviagation is by PgDn, PgUp, Vertical ScrollBar, but fails when the page is scrolled with down or up keys or mouse wheel.
May be some modifications to the paint method can make it work in all cases. If this can be made to work, we can achieve the effect, without depending on the underlying data source ( array or dbf or whatever be the RDD)
I personally feel that with some effort browse classes can give the facility to paint different colors because the browse object only knows the visiual row number it is painting.
Code: Select all
oBrw:nClrPane := { |nRow| iif( nRow % 2 == 0, rgb(255,255,235), rgb(192,208,179)) }
May be some modifications to the paint method can make it work in all cases. If this can be made to work, we can achieve the effect, without depending on the underlying data source ( array or dbf or whatever be the RDD)
I personally feel that with some effort browse classes can give the facility to paint different colors because the browse object only knows the visiual row number it is painting.
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:
I made a few modifications in the TCBrowse Class. With these modifiations the above code works fine in all cases:
Modififcations are : ( I am giving line numbers in the latest source code of TCBrowse.Prg provided with FWH 8,01 ). With a view to not to change the line numbers I inserted new code in the present blank lines.
After making the above changes in the tcbrowe class, the following code in the application program works fine:
Now we are not bothered whatever is the data source, rdd or array
Modififcations are : ( I am giving line numbers in the latest source code of TCBrowse.Prg provided with FWH 8,01 ). With a view to not to change the line numbers I inserted new code in the present blank lines.
Code: Select all
Line 44: Instead of blank line :
DATA nRowScrol AS NUMERIC INIT 0
//
In method paint()
Line 253: In the present blank line:
::nRowScrol := 0
//
In method drawline, at line number 415
Instead of old code:
nClrBack := Eval( nClrBack, If( xRow == nil, nRowPos, xRow ) , nJ )
Substitute the new code:
nClrBack := Eval( nClrBack, If( xRow == nil, nRowPos, xRow ) + ::nRowScrol , nJ )
//
Method GoDown(): Substitute Old Line 1086
Instead of :
::lRepaint := .f.
Substitute :
::lRePaint := .f. ; ::nRowScrol := iif( ::nRowScrol == 0, 1, 0 )
//
Method GoUp() : Substitute old line 1128
Instead of :
::lRepaint := .f.
Substitute :
::lRePaint := .f. ; ::nRowScrol := iif( ::nRowScrol == 0, 1, 0 )
Code: Select all
oBrw:nClrPane := { |nRow| iif( nRow % 2 == 0, rgb(255,255,235), rgb(192,208,179)) }
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India