RE: Listviews and time....

new topic     » topic index » view thread      » older message » newer message

Euman wrote:
> global function addLVItem(integer id,atom iIcon,sequence text)
>
> Bahh, RECURSIVE AS HELL
>
> What's wrong with it? Everything if you have alot of info to
> feed your LV!
>
> I was hopeing someone might have an idea how to load in a
> couple thousand
> items to a Listview in a timely manner....

Done.

This has been coded for the new version.

  result = Dispatch( integer id, "addItems", sequence items)

where 'id' is the ID for a Listview, Treeview, List, Combo, or imagelist
   'items' is a list of items.
   For text only items, each element is a text sequence,
       image only items, each element is either a hWnd to a bitmap, or a
filename.
       text + image items (like listviews) , each element is a 2-element
sequence
       of atom(Icon) and sequence(Text)

eg.
  sequence result
  result = Dispatch(myListView, "addItems",
                 { {wipIcon, {"lib101","Bug","setTextColor() for edit
controls."}},
                   {doneIcon, {"lv027","Enhanc", "New addItems()"}},
                   {doneIcon, {"tv012","Enhanc", "New addItems()"}},
                 })
  if result[1] = -1 then
	-- Function not supported
      ... do it the long way ...
  end if

This also demonstrates the new Dispatch() function, which allows for
optional functionality to be implemented. This means that a mild form of OO
polymorphism is available. It also enables "light" versions of win32lib to
be created.

This is all optional as all the current functions still exist and no-one has
to go a rewrite their win32lib code blink

Oh, except if your are creating your own imagelists. The current
implementation only allowed for 32x32 or 16x16 pixel images. To cater for
more general imagelist usage I've changed the way the create() parameters
are interpreted. So let me know if this is going to hurt your code, anyone.

-----------
cheers,
Derek Parnell

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu