Tcbrowse 2 colour one for each line

User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

James Bott wrote:Granted it will be easier right now to use the modified TCBrowse, but then you will have to modify each new version of FWH.
I think this is a bug that should be fixed in the standard class.

EMG
User avatar
Patrick Mast
Posts: 244
Joined: Sat Mar 03, 2007 8:42 pm

Post by Patrick Mast »

Any news on how to do this in TWBrowse?

Tx
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

TWBrowse:

Mr James Bott's code using skip block works perfectly with TWBrowse also. Personally I prefer to use his method in my programs.

But if some one still insists on modifying the twbrowse.prg ( I personally consider it not worthwhile ) then here is the way:

1) Create new data nRowScrol ( or any other similar name ) and initialize with 0.
2) In GoUp and GoDown methods keep swapping the value between 0 and 1.
3) In paint method make the value of this data as Zero.
4) Modify the inline code of DrawLine method as below:

Code: Select all

   METHOD DrawLine( nRow ) INLINE ;
               wBrwLine( ::hWnd, ::hDC, If( nRow == nil, ::nRowPos, nRow ), ;
               Eval( ::bLine, Self ), ::GetColSizes(), ::nColPos,;
               ::nClrText, ;
               iif( valtype( ::nClrPane ) == 'B', eval( ::nClrPane, nRow + ::nRowScrol), ::nClrPane) ,;
               If( ::oFont != nil, ::oFont:hFont, 0 ),;
               ValType( ::aColSizes ) == "B", ::aJustify, nil, ::nLineStyle,,, ::oVScroll,;
               ::bLogicLen  )
I did not test it but this is the logic I used in modifying the TCBrowse.Prg. It should work for TWBrowse also.
But I myself prefer to use Mr James Bott's code and not to modify the FWH source for these two classes. If Mr. Antonio himself releases similar facility, I would welcome that.
TXBrowse, ofcourse, is a different case.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

nageswaragunupudi wrote:But if some one still insists on modifying the twbrowse.prg ( I personally consider it not worthwhile ) then here is the way:
My opinion is that the parameter nRow passed to the bSkip codeblock should be enough for this task and the current behavior is a bug that should be fixed.

EMG
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

Only TCBrowse evaluates bClrPane with parameters row number and column number.

TWBrowse evaluates without any parameters.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

nageswaragunupudi wrote:Only TCBrowse evaluates bClrPane with parameters row number and column number.

TWBrowse evaluates without any parameters.
You are right. Ok for James solution. :-)

EMG
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

AHF,

>I use already a Tcbrowse subclass.

Great!

James
Post Reply