Página 1 de 1

GTWVW pequeno FIX ?

Enviado: 16 Nov 2013 19:21
por Itamar M. Lins Jr.
O pai da GTWVW apareceu lá no users-harbour puxei assunto sobre a WVW... conversa vai conversa vem, saiu esse fix p/ que usa a WVW
Obs, eu não uso a WVW, mas sei que muitos usam.

Código: Selecionar todos


function VXBscroller(nWinNum, XBid, XBmsg, XBpos)
* generic VXBscroller
static snlasttrack := NIL
local hotreturn, keypress := 0
local aInfo, nrelative, nratio

  * if we can't handle non topmost window we must return right away
  if nWinNum <> wvw_nNumWindows()-1 ; return NIL ; endif

  do case
     case XBmsg == SB_LINEUP
        keypress := K_UP
     case XBmsg == SB_LINEDOWN
        keypress := K_DOWN
     case XBmsg == SB_PAGEUP
        keypress := K_PGUP
     case XBmsg == SB_PAGEDOWN
        keypress := K_PGDN

     case XBmsg == SB_THUMBTRACK
        aInfo := wvw_xbinfo( nWinNum, XBid )
        if snlasttrack==NIL
           snlasttrack := aInfo[4] //last position
        endif
        * are we moving?
        if snlasttrack==XBpos
           * no, do nothing.
           return NIL
        endif

        * are we moving to TOP?
        if XBpos==aInfo[1] //min
           zbgotop(,.t.)
           zbredisp()
           snlasttrack := XBpos
           return NIL
        endif

        * are we moving to BOT?
        if XBpos+aInfo[3]>aInfo[2] //pos+page>max
           zbgobottom()
           zbredisp()
           snlasttrack := XBpos
           return NIL
        endif

        * what's the relative position to current track pos?
        nrelative := XBpos - snlasttrack
        * must convert nrelative to records unit
        nratio := zvscrollratio(nWinNum+1)
        if nrelative>0
           zblinedown(.t., nrelative*nratio)
        else
           zblineup(.t., -nrelative*nratio)
        endif

        * update snlasttrack
        snlasttrack := XBpos

        return NIL

     case XBmsg == SB_THUMBPOSITION
        aInfo := wvw_xbinfo( nWinNum, XBid )

        if snlasttrack==NIL
           * weird, do nothing
           return NIL
        endif
        * are we moving?
        if snlasttrack==XBpos
           * no, do nothing. but first clear the snlasttrack
           snlasttrack := NIL
           return NIL
        endif

        * are we moving to TOP?
        if XBpos==aInfo[1] //min
           zbgotop(,.t.)
           zbredisp()
           snlasttrack := XBpos
           return NIL
        endif

        * are we moving to BOT?
        if XBpos+aInfo[3]>aInfo[2] //pos+page>max
           zbgobottom()
           zbredisp()
           snlasttrack := XBpos
           return NIL
        endif

        * what's the relative position to current track pos?
        nrelative := XBpos - snlasttrack
        * must convert nrelative to records unit
        nratio := zvscrollratio(nWinNum+1)
        if nrelative>0
           zblinedown(.t., nrelative*nratio)
        else
           zblineup(.t., -nrelative*nratio)
        endif

        * reset snlasttrack
        snlasttrack := NIL

        return NIL

  endcase

  if ( (hotreturn:=ASCAN(keylist, {|x| x[1]==keypress})) > 0 )
     xRunKeyList(hotreturn, @keypress)
  endif

return NIL

</quote>

regards,
budyanto
O FIX é p/ esse problema.
Hello Budyanto,

First of all GTWVW is a remarkable library. Thank you.

When you have some time, please look at vertical scroll bar. Thumb track can not be dragged to the end of a list of selected records when this list contains more that 65000 records.
Saudações,
Itamar M. Lins Jr.