Hello, I would like to know the limits of listicongadget.
How many columns can it support?
How many lines can it support?
how many cells can it support?
Thank you for your collaboration. This is to find out the maximum number of names that should be created to define, the rows, the columns and the cells.
Limit of the listicon gadget.
- a_carignan
- User
- Posts: 98
- Joined: Sat Feb 21, 2009 2:01 am
- Location: Canada
Re: Limit of the listicon gadget.
I did some tests a while back for one of my own apps to see what might happen when a database got big.
This information is Windows only - I never did these tests on the other platforms, but the test code will run unmodified on the others apart from the API calls.
Column wise - there is a limit on the number of columns that the control will support properly. At the time I didn't find any supporting documentation to describe it offically so I don't know what the precise cause is. Somewhere around 300 columns the header stops working properly and stops displaying the later column titles. You can't resize column width properly and the sync on scroll between the header/data area also gets messed up totally. This will limit the number of columns that you can viably create. (I think anyone creating this many columns needs to rethink their design though!)
Column performance seems to be slightly worse than row performance, which didn't really surprise me after the experience above.
That is to say that a control with N rows and M columns will perform slightly better than a control with M rows and N columns where N >> M.
Row wise - The major limiting factor will be response times, with initial load times the slowest. Your users will be complaining about the poor peformance of the application long before you reach any limits of the control. Performance will alter per the spec of machine and the amount of available RAM.
This information is Windows only - I never did these tests on the other platforms, but the test code will run unmodified on the others apart from the API calls.
Column wise - there is a limit on the number of columns that the control will support properly. At the time I didn't find any supporting documentation to describe it offically so I don't know what the precise cause is. Somewhere around 300 columns the header stops working properly and stops displaying the later column titles. You can't resize column width properly and the sync on scroll between the header/data area also gets messed up totally. This will limit the number of columns that you can viably create. (I think anyone creating this many columns needs to rethink their design though!)
Column performance seems to be slightly worse than row performance, which didn't really surprise me after the experience above.
That is to say that a control with N rows and M columns will perform slightly better than a control with M rows and N columns where N >> M.
Row wise - The major limiting factor will be response times, with initial load times the slowest. Your users will be complaining about the poor peformance of the application long before you reach any limits of the control. Performance will alter per the spec of machine and the amount of available RAM.
Code: Select all
#Width = 600
#Height = 400
; Load becomes noticable.
#Rows = 200
#Columns = 10
; Load takes over a minute. You can improve this with SetRedraw.
; #Rows = 100000
; #Columns = 30
; Load takes nearly two minutes.
; #Rows = 100000
; #Columns = 100
; This one works fine.
; #Rows = 400
; #Columns = 2
; This one is broken.
; The last columns won't display in the header. Header/layout will get out of sync on h-scrolling.
; #Rows = 2
; #Columns = 400
Define.S sText
Define.I iCol, iRow, iEvent
If OpenWindow(0, 50, 50, #Width, #Height, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, #Width - 10, #Height - 10, "Column 1", 100, #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
; This will improve load times (a bit).
; SendMessage_(GadgetID(0), #WM_SETREDRAW, #False, 0)
For iCol = 2 To #Columns
AddGadgetColumn(0, iCol, "Column " + StrU(iCol), 100)
Next iCol
For iRow = 1 To #Rows
sText = #Empty$
For iCol = 1 To #Columns
sText + "Item " + StrU(iRow) + "." + StrU(iCol) + Chr(10)
Next iCol
AddGadgetItem(0, -1, sText)
Next iRow
; Need this too if you have the one above uncommented.
; SendMessage_(GadgetID(0), #WM_SETREDRAW, #True, 0)
Repeat
iEvent = WaitWindowEvent()
Until iEvent = #PB_Event_CloseWindow
EndIf
Last edited by spikey on Sat Feb 29, 2020 3:17 pm, edited 1 time in total.
Re: Limit of the listicon gadget.
On Windows, at least up to Win 7, the ListIcon header has a max width of 32767 pixels. If your total column widths exceed this value then expect problems! 

I may look like a mule, but I'm not a complete ass.
Re: Limit of the listicon gadget.
Ah, that'll be it then - where did you find that documented? I'd like to read the rest of the citation...srod wrote:the ListIcon header has a max width of 32767 pixels.
- a_carignan
- User
- Posts: 98
- Joined: Sat Feb 21, 2009 2:01 am
- Location: Canada
Re: Limit of the listicon gadget.
thanks for the information. 

Re: Limit of the listicon gadget.
Found that out the hard way some years ago!spikey wrote:Ah, that'll be it then - where did you find that documented? I'd like to read the rest of the citation...srod wrote:the ListIcon header has a max width of 32767 pixels.

I may look like a mule, but I'm not a complete ass.
Re: Limit of the listicon gadget.
Sounds entirely reasonable, 2^(16-1) and using the other bit for sign...