Vertical Scrollbar Operation Not Working

Post Reply
GWard
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Vertical Scrollbar Operation Not Working

Post by GWard »

I have various browses with vertical scrollbars operating correctly. I have added an additional LISTBOX as below

Code: Select all

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

Post by Antonio Linares »

GWard,

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

Code: Select all

/*
   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}} 
*/
regards, saludos

Antonio Linares
www.fivetechsoft.com
GWard
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

Post 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.
GWard
Posts: 31
Joined: Thu Oct 13, 2005 10:18 am
Location: UK

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

Post 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 :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply