1. RE: For the ListView Pros.

Hi Tony,

> -----Original Message-----
> From: Tony Steward [mailto:figjam at nlc.net.au]
> Sent: Tuesday, 2 January 2001 10:41 AM
> To: EUforum
> Subject: For the ListView Pros.

> Firstly it seems to me that setIndex(LV, x) does not work
> with list views. I
> have a listview of nearly 2000 items so I want an input box
> where when I
> type into it the onChange event will scroll the LV to the
> appropriate item.
> I can to this with normal lists but not LV.

You're correct. setIndex() does not work with ListView controls. We have to
create a new function to do this and I'm not sure how it will work yet. I
think we have to set the state of the item to LVIS_FOCUSED. I'll experiment
a bit and let you know what I find.

> Secondly loading a listview with this number of items is
> painfully slow, I
> currently read a EU database and fill the list. It seems to
> me that if I can
> see the scroll bar shrinking as I add items it must be
> redrawing the LV
> after adding each item, this would slow it down considerable.
> Is there a
> better way, I seem to remember some talk on this a while ago.

This is the built-in behavior of a ListView. The only way I can think of to
get around this is to create a "virtual" list view by using the
LVS_OWNERDATA flag when creating the list view. This means that you then
have to manage all the data storage and some of the visualization yourself.
Not a trival exercise, but it does allow you to manage unlimited amounts of
data in a view.

To find out more, look at ...

http://msdn.microsoft.com/library/psdk/shellcc/CommCtls/ListView/ListView_Ov
erview.htm


-----------
cheers,
Derek Parnell
Senior Design Engineer
Global Technology Australasia Ltd
dparnell at glotec.com.au

---------------------

new topic     » topic index » view message » categorize

2. RE: For the ListView Pros.

Hi Derek,
Thanks for replying, Ok this looks like it is over my head I think my
customers will have to put up with slow loading. I haven't tried but do you
think E to C compliler would help.

Can you tell me how many items I can have in a list view. I didn't realize
it was limited.

Thanks

Tony Steward

-----Original Message-----
From: Derek Parnell [mailto:ddparnell at bigpond.com]
Sent: Tuesday, 22 May 2001 4:51 PM
To: EUforum
Subject: RE: For the ListView Pros.




Hi Tony,

> -----Original Message-----
> From: Tony Steward [mailto:figjam at nlc.net.au]
> Sent: Tuesday, 2 January 2001 10:41 AM
> To: EUforum
> Subject: For the ListView Pros.

> Firstly it seems to me that setIndex(LV, x) does not work
> with list views. I
> have a listview of nearly 2000 items so I want an input box
> where when I
> type into it the onChange event will scroll the LV to the
> appropriate item.
> I can to this with normal lists but not LV.

You're correct. setIndex() does not work with ListView controls. We have to
create a new function to do this and I'm not sure how it will work yet. I
think we have to set the state of the item to LVIS_FOCUSED. I'll experiment
a bit and let you know what I find.

> Secondly loading a listview with this number of items is
> painfully slow, I
> currently read a EU database and fill the list. It seems to
> me that if I can
> see the scroll bar shrinking as I add items it must be
> redrawing the LV
> after adding each item, this would slow it down considerable.
> Is there a
> better way, I seem to remember some talk on this a while ago.

This is the built-in behavior of a ListView. The only way I can think of to
get around this is to create a "virtual" list view by using the
LVS_OWNERDATA flag when creating the list view. This means that you then
have to manage all the data storage and some of the visualization yourself.
Not a trival exercise, but it does allow you to manage unlimited amounts of
data in a view.

To find out more, look at ...

http://msdn.microsoft.com/library/psdk/shellcc/CommCtls/ListView/ListView_Ov
erview.htm


-----------
cheers,
Derek Parnell
Senior Design Engineer
Global Technology Australasia Ltd
dparnell at glotec.com.au

---------------------

new topic     » goto parent     » topic index » view message » categorize

3. RE: For the ListView Pros.

Tony Steward wrote:
> Secondly loading a listview with this number of items is painfully slow, 
> I
> currently read a EU database and fill the list. It seems to me that if I 
> can
> see the scroll bar shrinking as I add items it must be redrawing the LV
> after adding each item, this would slow it down considerable. Is there a
> better way, I seem to remember some talk on this a while ago.

Tony,
I came across the same problem.  I was loading many items to a list view 
and the load time was really bad.  What I found to be the problem is 
that Win32Lib uses LPSTR_TEXTCALLBACK in addLVItem.  This causes Windows 
to call back to Win32Lib to get the text for each list view item instead 
of storing it internally.  Take a look at my SQL utility on the Recent 
Contributions page on the RDS site to see how I got around this.

HTH,

Jonas

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu