I have created a special type of listbox, which extends listbox_base,
just like the normal xul listbox does.
listbox is using a special boxObject (nsIListBoxObject), but I still
don't understand how the listbox is connected to it. It is not done in
the XBL (neither in listbox_base nor in listbox), and I also didn't
find the place where it is connected in mozilla-central.
My problem is, that my own listbox - due to using the "normal"
boxObject - will fully load all items (images and labels), even though
they may not be not visible, which gives me a big performance impact
on long lists, due to loading all images.
I believe nsIListBoxObject is more intelligent then this.
So, I guess I have to write my own box object type. But how will I
connect it to my XBL control??
Any ideas?
Thanks a lot!
Cheers.
The boxObject doesn't do anything itself. It's main use is to provide
access to apis implemented natively.
I think what you are actually wanting is to use display="xul:listbox" or
just ensure that the special listbox you've created just has the same
tag 'listbox' (and 'listitem' and so forth).
Note that I still plan to remove the code in listbox that normally skips
doing that; if you need performance on long lists, you should probably
be using a tree...
-Boris
What I am actually trying is to create a list-fileview, just like
Windows Explorer has, meaning: columns of small lists (with a
horizontal overflow if there are many items). See this pic:
Essentially it is nothing, but a big list that is separated into
columns. that is, why I extended listbox_base, as it provides list-
functionality without implying how the list looks.
Although tree supports multiple columns, it doesn't support multiple
selection of cells, what would be needed for this.
I further investigated the display="xul:listbox" thing from Neil
Deakin's answer to find out about frames and that these are actually
doing what I thought the boxObject does, namely drawing
intelligently.
So one solution might be to create my own nsIFrame.
On the other side, it might also be possible, that my column-list-
thing is just a container of multiple trees. For this case, I would
need to extend/replace the eventhandlers, so that the trees are
treated as one big list. But then the question still is: will a tree
only load the items that are visible, or will it also load items, if
itself is not visible at the moment (what would be the case for a
column that is outside of the view)?
Every hint would be helpful!
Thank you!
>My problem is, that my own listbox - due to using the "normal" boxObject - will fully load all items (images and labels), even though they may not be not visible, which gives me a big performance impact on long lists, due to loading all images.
>
It's actually the <listboxbody> that does this. Are you using one?
--
Warning: May contain traces of nuts.
No, I am not using a listboxbody. I also doubt it will work, as my
list control is more complicated than the normal list. see my answer
to Boris Zbarsky.
Guess I have to dig into Frames and such.
Thanks.