Page 1 of 1

Vertical Scrollbar Operation Not Working

PostPosted: Mon Jan 23, 2006 10:22 am
by GWard
I have various browses with vertical scrollbars operating correctly. I have added an additional LISTBOX as below
Code: Select all  Expand view
   @ 0,0 LISTBOX oLbx FIELDS FSTOCK->ROLL_NO,FSTOCK->QCODE,FSTOCK->LOCATION, ;
          str(FSTOCK->QUANTITY,7,2),FSTOCK->TEMP ;
        HEADERS "Roll No","Product","Loc","Vol","Tag" SIZE 240,200 OF oWnd ;
          FIELDSIZES 65,80,25,40,20 UPDATE

   oLbx:SetFont(oFont2)
   oLbx:blClicked := {|nRow,nCol,nKeyFlags|  if(oLbx:nAtCol(nCol)=5,ProcessTap(oLbx,oSay6,oGet1,oGet2),nil)}
   oLbx:lCellStyle    := .T.
   oLbx:bGoTop    := {|| FSTOCK->(DbGoTop())}
   oLbx:bGoBottom :=  {|| FSTOCK->(DbGoBottom())}
   oLBx:bSkip        := {|nRecs| FSTOCK->(DbSkipper(nRecs))}
   oLbx:bLine        := {|| {FSTOCK->Roll_No,;
                       FSTOCK->Qcode,;
                       FSTOCK->Location,;
                      str(FSTOCK->Quantity,7,2),;
                      FSTOCK->Temp}}


When the browse is displayed the Roll No of the first record is highlighted.

If I tap on the down button of the vertical scroll button nothing happens. If I tap on the second record's Roll No the scroll bar becomes active however if I pull the slider to the bottom the browse does not go to the last record.

This is the only browse behaving in this way.

Is there specific code I can use to force correct behaviour on this scrollbar?

PostPosted: Mon Jan 23, 2006 10:27 am
by Antonio Linares
GWard,

Just a quick test. Please comment out this entire section and try it again:

Code: Select all  Expand view
/*
   oLbx:blClicked := {|nRow,nCol,nKeyFlags|  if(oLbx:nAtCol(nCol)=5,ProcessTap(oLbx,oSay6,oGet1,oGet2),nil)}
   oLbx:lCellStyle    := .T.
   oLbx:bGoTop    := {|| FSTOCK->(DbGoTop())}
   oLbx:bGoBottom :=  {|| FSTOCK->(DbGoBottom())}
   oLBx:bSkip        := {|nRecs| FSTOCK->(DbSkipper(nRecs))}
   oLbx:bLine        := {|| {FSTOCK->Roll_No,;
                       FSTOCK->Qcode,;
                       FSTOCK->Location,;
                      str(FSTOCK->Quantity,7,2),;
                      FSTOCK->Temp}}
*/

PostPosted: Mon Jan 23, 2006 11:23 am
by GWard
Antonio,

If I remove that section the LISTBOX only displays the first record.

If I leave in only the oLbx:bSkip codeblock the entire file is displayed but the scrollbar still does not work until I tap on a different record.

Even once the scroll down button activates the slider hits bottom many records before the eof is reached.

If it any help I open/close all required files in the MAIN window at start and end of program use. As stated other browses work as expected.

PostPosted: Mon Jan 23, 2006 11:55 am
by GWard
Antonio,

Looks as if I have solved it by placing a DbSelectArea("FSTOCK") immediately before the @ 0,0 LISTBOX line.

It also works perfectly with file filters.

One to remember!

Cheers.

PostPosted: Mon Jan 23, 2006 1:09 pm
by Antonio Linares
GWard,

Yes, it looks as it was using a wrong workarea. You may use the clause ALIAS when creating the browse, so you may do:

@ ..., ... LISTBOX ... FIELDS .... ALIAS "FSTOCK" ...

Just in case you are not selected in the same workarea to use in the browse. This way you don't need the DbSelectArea() call.

Glad to know its solved :)