FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Tcbrowse 2 colour one for each line
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 09:02 AM
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
Posts: 246
Joined: Sat Mar 03, 2007 08:42 PM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 09:52 AM

Any news on how to do this in TWBrowse?

Tx

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 10:08 AM

It works fine using the same technique.

EMG

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 10:24 AM
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:
   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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 10:45 AM
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
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 12:08 PM

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

TWBrowse evaluates without any parameters.

Regards



G. N. Rao.

Hyderabad, India
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 04:43 PM
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM

Tcbrowse 2 colour one for each line

Posted: Fri Jan 11, 2008 05:56 PM

AHF,

>I use already a Tcbrowse subclass.

Great!

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion