Little bug in TCBrowse class

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

Little bug in TCBrowse class

Post by Enrico Maria Giordano »

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

#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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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

Code: Select all

#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
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Post Reply