Tcbrowse 2 colour one for each line

Postby Enrico Maria Giordano » Fri Jan 11, 2008 9: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Patrick Mast » Fri Jan 11, 2008 9:52 am

Any news on how to do this in TWBrowse?

Tx
User avatar
Patrick Mast
 
Posts: 246
Joined: Sat Mar 03, 2007 8:42 pm

Postby Enrico Maria Giordano » Fri Jan 11, 2008 10:08 am

It works fine using the same technique.

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

Postby nageswaragunupudi » 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:
Code: Select all  Expand view
   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
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Enrico Maria Giordano » Fri Jan 11, 2008 4: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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Fri Jan 11, 2008 5:56 pm

AHF,

>I use already a Tcbrowse subclass.

Great!

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests