FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Bug in TWBrowse:nClrPane
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Bug in TWBrowse:nClrPane
Posted: Sat Oct 14, 2006 04:12 PM
This is the sample (you will see that all the not focused cells of the current row are black):

#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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Bug in TWBrowse:nClrPane
Posted: Sun Oct 15, 2006 04:23 PM

Enrico,

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TWBrowse:nClrPane
Posted: Sun Oct 15, 2006 08:04 PM
Enrico, James,

This change is required at source\classes\wbrowse.prg line 2268:
            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
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Bug in TWBrowse:nClrPane
Posted: Sun Oct 15, 2006 08:07 PM
A better version:
            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
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM

Continue the discussion