Page 1 of 1

TWBrowse scrollbar bug

Posted: Thu Feb 23, 2006 10:10 am
by Enrico Maria Giordano
In the following sample, try to hit down arrow key (on the keyboard) many times till to move the highlight to the last record and then hit down arrow key one more time. Now hit up arrow key and you will see that the scrollbar thumb doesn't move up (it will move when you hit up arrow key again):

Code: Select all

#include "Fivewin.ch"


REQUEST DBFCDX


FUNCTION MAIN()

    LOCAL oDlg, oBrw

    RDDSETDEFAULT( "DBFCDX" )

    USE TEST

    INDEX ON FIELD -> last + FIELD -> first TO "TEMP__" FOR FIELD -> last = "A"

    DEFINE DIALOG oDlg;
           SIZE 400, 400

    @ 1, 1 LISTBOX oBrw FIELDS TEST -> last,;
                               TEST -> first;
           SIZE 200, 200 PIXEL

    oBrw:bLogicLen = { || ( oBrw:cAlias ) -> ( OrdKeyCount() ) }

    ACTIVATE DIALOG oDlg;
             CENTER

    CLOSE

    FERASE( "TEMP__.CDX" )

    RETURN NIL
A possible fix:

Code: Select all

METHOD VGoDown()       INLINE iif( ::nVScrollPos < ::nLen, ::VSetPos( ::nVScrollPos + 1 ), )
METHOD VGoUp()         INLINE iif( ::nVScrollPos > 1, ::VSetPos( ::nVScrollPos - 1 ), )
EMG

Posted: Thu Feb 23, 2006 11:52 am
by dpaterso
Are you aware that this also happens when you do the same at the top of the browse i.e. go to the top and do the same thing with the arrow key (or click on the scroll bar up arrow) and the same thing happens?

Regards,

Dale.

Posted: Thu Feb 23, 2006 12:29 pm
by Enrico Maria Giordano
Yes. That's why I fixed both methods VGoDown() and VGoUp().

EMG

Posted: Thu Feb 23, 2006 1:55 pm
by dpaterso
Sorry, I did not see that.

But you have no idea how grateful I am!!!

Now what about being able to make the lines and headings higher / wider AND GETTING IT INCORPORATED INTO THE NEXT RELEASE OF FWH? :)

And let us not forget about the WIN32 HEADERS!!! :)

Thanks,

Dale.

Posted: Thu Feb 23, 2006 2:02 pm
by dpaterso
I can't thank you enough!!!

Regards,

Dale.

Posted: Thu Feb 23, 2006 2:04 pm
by Enrico Maria Giordano
In wbrowse.prg there is a single call to DrawHeader() function. Try to play with it.

EMG

Posted: Thu Feb 23, 2006 7:15 pm
by E. Bartzokas
EnricoMaria wrote:In wbrowse.prg there is a single call to DrawHeader() function. Try to play with it.

EMG
Enrico hi,
Any idea how I can add lines (horizontal separator lines, as in TWBROWSE() from record to record when browseing a single dimensional array ?

Regards
Evans

Posted: Thu Feb 23, 2006 8:22 pm
by Enrico Maria Giordano
Have you tried oBrw:nLineStyle?

EMG

Posted: Thu Feb 23, 2006 9:31 pm
by E. Bartzokas
EnricoMaria wrote:Have you tried oBrw:nLineStyle?

EMG
Thanks, I'll try it and will let you know!

Kind regards
Evans

Posted: Thu Feb 23, 2006 10:02 pm
by E. Bartzokas
EnricoMaria wrote:Have you tried oBrw:nLineStyle?

EMG
Itried oLbx:nLineStyle := LINES_GRAY

and here is the error...

Error description: Error BASE/1005 Message not found:
TLISTBOX:_NLINESTYLE

Stack Calls
===========
Called from: => TLISTBOX:ERROR(175)
Called from: tobject.prg => (b)HBOBJECT:HBOBJECT(105)
Called from: => TLISTBOX:MSGNOTFOUND(0)
Called from: => TLISTBOX:_NLINESTYLE(167)

Posted: Thu Feb 23, 2006 10:07 pm
by Enrico Maria Giordano
E. Bartzokas wrote:Error description: Error BASE/1005 Message not found: TLISTBOX:_NLINESTYLE
nLineStyle is an instance variable of TWBrowse not of TListBox.

EMG

Posted: Fri Feb 24, 2006 4:21 pm
by E. Bartzokas
EnricoMaria wrote:
E. Bartzokas wrote:Error description: Error BASE/1005 Message not found: TLISTBOX:_NLINESTYLE
nLineStyle is an instance variable of TWBrowse not of TListBox.

EMG
Correct.
I am using TLISTBOX, and asked if I can make a listbox have horizontal line separators between items, as we have it in TWBROWSE...
I didn't find any method in TLISTBOX to guide me towards this problem, and therefore I ask for your opinion and a piece of your knowledge.
;-)

Posted: Fri Feb 24, 2006 4:59 pm
by Enrico Maria Giordano
No, you can't, as far as I know.

EMG

Posted: Sun Feb 26, 2006 7:16 am
by Antonio Linares
Enrico,

Thanks! :)