Hello TonHu
I downloaded the allready compiled libraries and the source from xharbour.org on the 21.7.05. I originally linked the compiled libraries, but to test I also used the source tbrowse.prg-File.
I am not sure if xharbour.tbrowse has an error, it just behaves not the same as my old Clipper V5.2c.
The first problem is I am using tbrowse with arrays and tbColumn:ColorBlock to highlite (grey background) fields that the user can edit.
At the end of the browse I normally have an empty row (editable fields that means an array-element filled with spaces) to insert new records.
I use this code with Clipper 5.2c:
Code:
browse:colorSpec := "W/N,BG/N,BG/W,B/W,RB+/N"
col[LEN(col)]:colorBlock := {|wert| IIF(wert == "", {2,2},{4,3})}
XHarbour.tBrowse draws a grey background on every row below the last entry in my array to tbrowse:nBottom.
Probably this is because in METHOD DrawARow( nRow ) CLASS MyTBrowse the space from last row which has data up to ::rowcount the color is set by this statement if there is a ColorBlock:
Code:
cColor := hb_ColorIndex( ::cColorSpec, ColorToDisp( Eval( ::aColsInfo[ nCol, o_Obj ]:ColorBlock, ::aColsInfo[ nCol, o_Blank ] ), TBC_CLR_STANDARD ) - 1 )
(Code from tbrowse.prg 09/08/2004 - <maurilio.longo@libero.it>)
With Clipper V5.2c all the rows below the last data are black as the screen.
I prefer this, as for me it is more readable. (Perhaps in an other situation I prefer it the other way ;-) .)
The second problems generates a runtime error:
Code:
Error Base/1070 Argument error: == Arguments: ([1] = Type: C Val: [2] = Type: N Val : 0)
In this case I use tbColumn:ColorBlock to paint certain values with another color:
Code:
browse:colorSpec := "W/N,BG/N,BG/W,B/W,RB+/N"
col[LEN(col)]:colorBlock := {|wert| IIF(wert == 0,{5,5},{2,2})}
I assume that the error is caused by the same statement as above, Probably oBlank fills in Spaces and I try to compare with a Numerical.
I found two workarounds for this problem setting tbrowse:nBottom to the array length (if smaller then window) - or tesing in ColorBlock
.
But I would like to change the behaviour of the tbrowse by building my own one instead of going through all my code (Size of Clipper-exe about 800 KB).
It seems that Itamar Martins Lins Junior stated a similar problem with ColorRect in xHarbour.Unstable.CVS. But he got no answers yet.
I downloaded the xharbour-0.99.50.src.tests.zip and linked the tbrowse.prg ($Id: TBrowse.prg,v 1.3 2004/01/27 03:26:27 fsgiudice Exp $) I found there.
(Originally downloaded tbrowse.prg $Id: tbrowse.prg,v 1.105 2005/05/02 17:05:06 gdrouillard Exp $)
Unfortunately this does not seem to solve my problems. The following are first impressions. I have to test what really happens:
1. The fields are not colored as I like, the selected is BG/N and all others W/N.
2. Sometimes I get crazy behaviour as actual input not at same place as field or colon-delimiters all over the screen.
I understand that xharbour is not yet finished - and probably will never be as there are too many things you can do. But perhaps someone has an idea how I can solve my problem.
I just found the link to the sourceforge.net CVS. I need some time to "compile" the information there.
Best regards
Gaby