Page 1 of 1

Bug in TWBrowse:nClrPane

Posted: Sat Oct 14, 2006 4:12 pm
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

Posted: Sun Oct 15, 2006 4:23 pm
by James Bott
Enrico,

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

James

Posted: Sun Oct 15, 2006 8:04 pm
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

Posted: Sun Oct 15, 2006 8:07 pm
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

Posted: Mon Oct 16, 2006 7:11 am
by Enrico Maria Giordano
Thank you.

EMG