Bug in TWBrowse:nClrPane

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

Bug in TWBrowse:nClrPane

Post by Enrico Maria Giordano »

This is the sample (you will see that all the not focused cells of the current row are black):

Code: Select all

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    USE TEST

    DEFINE DIALOG oDlg

    @ 0, 0 LISTBOX oBrw FIELDS

    oBrw:lCellStyle = .T.

    oBrw:nClrPane := { || CLR_HGREEN }

    ACTIVATE DIALOG oDlg;
             ON INIT oDlg:SetControl( oBrw );
             CENTER

    CLOSE

    RETURN NIL
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 »

Enrico,

I confirm the problem--with the Aug 2006/xHarbour build.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Enrico, James,

This change is required at source\classes\wbrowse.prg line 2268:

Code: Select all

            if nRowPos != 0
               SetTextColor( hDC, If( nColAct != nil, If( ValType( nClrTxt ) == "B",;
                             Eval( nClrTxt ), nClrTxt ), nClrText ) )
               SetBkColor( hDC, If( nRowPos == 0, GetSysColor( COLOR_BTNFACE ),;
                           If( nColAct == nil, nClrPane,;
                           If( ValType( nClrBack ) == "B", Eval( nClrBack ), nClrBack ) ) ) )
            endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

A better version:

Code: Select all

            if nRowPos != 0
               SetTextColor( hDC, If( nColAct != nil, If( ValType( nClrTxt ) == "B",;
                             Eval( nClrTxt ), nClrTxt ), nClrText ) )
               SetBkColor( hDC, If( nColAct != nil, If( ValType( nClrBack ) == "B",;
                             Eval( nClrBack ), nClrBack ), nClrPane ) )
            endif
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply