the drop-down list of a ComboBoxGadget? One of my apps
keeps a history of text in it, but I'm worried that a heavy
user might put around 1000 or more items in it.
Code: Select all
OpenWindow(0,0,0,120,80,"ComboBox Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ComboBoxGadget(0,5,5,110,20)
For i=1 To 100000
AddGadgetItem(0,i-1,Str(i))
Next
Repeat
Until WaitWindowEvent(20)=#PB_Event_CloseWindowI flinched on 1000000 !! but got there in the end.citystate wrote:not too sure of the upper maximum, but I tested it out with 100000 items and it didn't flinch
Code: Select all
OpenWindow(0,0,0,120,80,"ComboBox Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) ComboBoxGadget(0,5,5,110,20) For i=1 To 100000 AddGadgetItem(0,i-1,Str(i)) Next Repeat Until WaitWindowEvent(20)=#PB_Event_CloseWindow
Code: Select all
Win=OpenWindow(#PB_Any,0,0,520,580,"ComboBox Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
Sgad=ComboBoxGadget(#PB_Any,5,5,510,520)
For i=1 To 65566; that's too much, the ultimate max here should be 65'565.
AddGadgetItem(Sgad,i-1,Str(i-1))
Next
Repeat
Event=WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
ExitEventLoop=#True
Case #PB_Event_Gadget
Gadget=EventGadget()
Select Gadget
Case Sgad
Debug GetGadgetState(Sgad)
EndSelect
EndSelect
Until ExitEventLoop
I think the 16 bit limit is 65535, as 0 need to be counted to make 65536.blueznl wrote:I messed with different Windows controls as I was doing the same thing: storing everything in a control / gadget. Behaviour got unpredictable when going over 65533 (not 65536, strangely enough). Must be somewhere a hardcoded 16 bits limit. I'd suggest to keep the controls a little smaller