Little bug in TCBrowse class

Little bug in TCBrowse class

Postby Enrico Maria Giordano » Sat Dec 15, 2007 10:45 am

In the following sample press 13 times the right arrow key on the keyboard and then look at the browse headers. You should see a little change on them (the bottom shadow becomes gray and larger).

Code: Select all  Expand view  RUN
#include "Fivewin.ch"
#include "Tcbrowse.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    LOCAL i

    USE TEST

    DEFINE DIALOG oDlg;
           SIZE 400, 400

    @ 0, 0 BROWSE oBrw

    ADD COLUMN TO oBrw;
               DATA "Frozen";
               HEADER "FROZEN"

    oBrw:bLogicLen = { || LastRec() }

    oBrw:lCellStyle = .T.

    oBrw:nFreeze = 1

    FOR i = 1 TO 20
        ADD COLUMN TO oBrw;
                   DATA "Data";
                   HEADER "DATA" + LTRIM( STR( i ) )
    NEXT

    ADD COLUMN TO oBrw

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

    CLOSE

    RETURN NIL


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

Postby Antonio Linares » Sat Dec 15, 2007 10:45 pm

Enrico,

Fixed. It was such a little thing but took me several hours to found it :-)

In Class TCBrowse Method DrawHeaders() change this line:

#define SM_CXVSCROLL 2

local nMaxWidth := ::nWidth() - GetSysMetrics( SM_CXVSCROLL ) - 4
regards, saludos

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

Postby Enrico Maria Giordano » Sun Dec 16, 2007 10:09 am

Antonio Linares wrote:Enrico,

Fixed. It was such a little thing but took me several hours to found it :-)


I'm very sorry. :-(

Anyway, thank you.

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

Postby Enrico Maria Giordano » Sun Dec 16, 2007 10:25 am

And while you are looking at it, please see if you can easily implement codeblocks for nClrForeFocus and nClrBackFocus. :-)

Code: Select all  Expand view  RUN
#include "Fivewin.ch"
#include "Tcbrowse.ch"


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    USE TEST

    DEFINE DIALOG oDlg;
           SIZE 400, 400

    @ 0, 0 BROWSE oBrw

    oBrw:bLogicLen = { || LastRec() }

    oBrw:lCellStyle = .T.

    oBrw:nClrBackFocus = { || CLR_HGREEN }

    ADD COLUMN TO oBrw;
               DATA "Data" + LTRIM( STR( RECNO() ) ) + "   ";
               HEADER "DATA"

    ADD COLUMN TO oBrw

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

    CLOSE

    RETURN NIL


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

Postby Antonio Linares » Sun Dec 16, 2007 11:02 am

Enrico,

Don't feel sorry at all. I really appreciate your feedback,

Its our job to locate and solve the bugs :-) Thanks!
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 60 guests