list box scrolling issue

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • list box scrolling issue

    Dear all,

    I am designing an address book using the LISBOX widget, to make the entries visible I use a large font so no more than seven entries can be displayed; but the address book entries can be much more than seven so I set a LISTBOX_IncSel() reaction to the pressure of the down arrow button I have on the board and LISTBOX_DecSel() to the pressure of the up arrow button; correspondingly I see the items scrolling on the display, each time a new entry appears at the bottom the first entry disappears at the top, so everything looks fine.

    My problem is the following: when I reach the last but one item, so the last but one is the selected item and there is the last item in the last visible position, and I press once again the down arrow button I still have a scrolling operation and all the items go up, hence I have the last entry in the last but one position and a blank entry in the last position.

    I attach a simple diagram to illustrate the concept.

    What I would like to avoid is the last scrolling, that makes visible the blank entry.

    Thanks,
    Ezio
    Images
    • address_book_issue_v1.jpg

      31.35 kB, 398×275, viewed 728 times

    The post was edited 1 time, last by ezio_noventa ().

  • Thanks Adrian,

    but I did not understand your suggestion.

    The number of items that are completely visible is 7.

    But the total number can be much higher, can be 100 or even 1000.

    The problem is that if I start scrolling the lowest position I can see selected is not the last one, the seventh, it is the sixth, so when I reach the real last item of the list I see it as selected in the sixth position and there is an empty white cell in the last, seventh, position.

    You see the same effect with one of your examples:

    segger.com/cms/admin/uploads/u…/DIALOG_FS_ChooseFile.exe

    if you go on scrolling you reach the last item, that is 'pagefile', but it is not in the last position, it is in the last but one, the last position is empty.

    How can avoid that unnecessary empty cell visualisation?

    Best regards,
    Ezio