FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Little bug in TCBrowse class
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Little bug in TCBrowse class
Posted: 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).

#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Little bug in TCBrowse class
Posted: 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Little bug in TCBrowse class
Posted: 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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Little bug in TCBrowse class
Posted: 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. :-)

#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Little bug in TCBrowse class
Posted: 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

Continue the discussion