Bug in TWBrowse:nClrPane

Bug in TWBrowse:nClrPane

Postby Enrico Maria Giordano » Sat Oct 14, 2006 4:12 pm

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

Code: Select all  Expand view
#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
Enrico Maria Giordano
 
Posts: 8600
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby James Bott » Sun Oct 15, 2006 4:23 pm

Enrico,

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

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

Postby Antonio Linares » Sun Oct 15, 2006 8:04 pm

Enrico, James,

This change is required at source\classes\wbrowse.prg line 2268:
Code: Select all  Expand view
            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: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun Oct 15, 2006 8:07 pm

A better version:
Code: Select all  Expand view
            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
User avatar
Antonio Linares
Site Admin
 
Posts: 41937
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Mon Oct 16, 2006 7:11 am

Thank you.

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 55 guests