Page 1 of 1

ListIconGadget

Posted: Tue Feb 18, 2025 6:08 pm
by Little John
After running the following code, press [A], [ B ], [Shift]+[A] or [Shift]+[ B ]:
The selection jumps to an item, where the content of the first column starts with „a“ or with „b“, respectively.
(tested with PB 6.20 on Windows 11)

Maybe it's worth documenting this behaviour?

Code: Select all

If OpenWindow(0, 100, 100, 300, 130, "ListIcon demo", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) = 0
   MessageRequester("Fatal error", "Can't open main window.")
   End
EndIf

ListIconGadget(0, 5, 5, 280, 110, "Name", 100, #PB_ListIcon_FullRowSelect)
AddGadgetColumn(0, 1, "Address", 170)
AddGadgetItem(0, -1, "ax" + #LF$ + "Here")
AddGadgetItem(0, -1, "bx" + #LF$ + "There")
AddGadgetItem(0, -1, "ay" + #LF$ + "By the Bay")
AddGadgetItem(0, -1, "by" + #LF$ + "CodeCity")
SetActiveGadget(0)
SetGadgetState(0, 0)

Repeat
   event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow

Re: ListIconGadget

Posted: Tue Feb 18, 2025 6:24 pm
by AZJIO
This has always been the case with Windows. Implicit search.

Code: Select all

If OpenWindow(0, 100, 100, 200, 730, "ListIcon demo", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	ListIconGadget(0, 5, 5, 180, 710, "Name", 80, #PB_ListIcon_FullRowSelect)
	AddGadgetColumn(0, 1, "Random", 80)
	For i = 65 To 90
		AddGadgetItem(0, -1, Chr(i) + Chr(Random(122, 65)) + #LF$ + Chr(Random(122, 65)))
	Next
	SetActiveGadget(0)
	SetGadgetState(0, 0)
	Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

Re: ListIconGadget

Posted: Tue Feb 18, 2025 7:10 pm
by Quin
Yeah, this is super common Windows behavior. Press win+m or win+d to go to your desktop and try the same thing, or do it in Windows Explorer/Xplorer2. It's an incredibly nice accessibility feature.
The Mac, of course, gets it wrong, and at least in the Finder there's a bug with their implementation where if you press L, it takes you to the last item starting with L. Guess someone forgot a break...

Re: ListIconGadget

Posted: Tue Feb 18, 2025 7:18 pm
by Little John
Quin wrote: Tue Feb 18, 2025 7:10 pm Yeah, this is super common Windows behavior. Press win+m or win+d to go to your desktop and try the same thing, or do it in Windows Explorer/Xplorer2.
Interesting! I didn't know that, and so I was surprised when I encountered this behaviour.
So I posted it here in this section of the forum, because I want to raise the question whether it makes sense to mention this behaviour in the documentation of the ListIconGadget.

Re: ListIconGadget

Posted: Tue Feb 18, 2025 9:36 pm
by Andre
As far as I remember Fred want to avoid OS-specific documentation in the (cross-platform) docs...

Re: ListIconGadget

Posted: Thu Feb 20, 2025 8:32 pm
by Little John
Hello André,

on the one hand, I can understand that. On the other hand, it is unsatisfactory when you accidentally discover that a gadget behaves differently than expected because the property in question is not documented.

Re: ListIconGadget

Posted: Sat May 17, 2025 3:04 pm
by Andre
Little John wrote: Thu Feb 20, 2025 8:32 pm on the one hand, I can understand that. On the other hand, it is unsatisfactory when you accidentally discover that a gadget behaves differently than expected because the property in question is not documented.
I can understand that. It's up to Fred, what he would like to have included in the docs...