Page 1 of 1

ListIconGadget autoscroll

Posted: Sun Aug 18, 2024 5:19 pm
by rndrei
Please add the automatic rewind function to the last position in the ListIcon Gadget!

Re: ListIconGadget autoscroll

Posted: Sun Aug 18, 2024 7:09 pm
by Fred
Could we have more info, especially a small code to show the issue ?

Re: ListIconGadget autoscroll

Posted: Sun Aug 18, 2024 7:33 pm
by rndrei
So that the pointer automatically stands at the last position and scrolls the window down

Code: Select all

If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
   ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
   AddGadgetItem(0, -1, "1")
   AddGadgetItem(0, -1, "2")
   AddGadgetItem(0, -1, "3")
   AddGadgetItem(0, -1, "4")
   AddGadgetItem(0, -1, "5")
   Repeat
     Event = WaitWindowEvent()
   Until Event = #PB_Event_CloseWindow
 EndIf

Re: ListIconGadget autoscroll

Posted: Sun Aug 18, 2024 10:06 pm
by BarryG
It's up to the user to manually do that (see below). It shouldn't be automatic because items can be added to the end in the background while the user is looking at or working with top items for selection. Like when the debug output window is adding lots of items and you can't scroll to the top to see what was first until all the additions finish.

Code: Select all

If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
  AddGadgetItem(0, -1, "1")
  AddGadgetItem(0, -1, "2")
  AddGadgetItem(0, -1, "3")
  AddGadgetItem(0, -1, "4")
  AddGadgetItem(0, -1, "5")
  SetGadgetState(0, 4)
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

Re: ListIconGadget autoscroll

Posted: Mon Aug 19, 2024 5:17 am
by rndrei
I figured it out, everything works!