Board index » delphi » Need example of using virtual Listview

Need example of using virtual Listview

If anybody has or can produce an example of using listview with ownerdata, I would really appreciate it. The documentation in d5 online help says you have to write event handlers for ondata, ondatafind and ondatahint, but shows no examples and does not describe what the handlers are explicitly to do.

I'm sure that the ondata must provide the data to be displayed for a specified listview item, but I don't see how this is to be done. I have searched codebase and several Delphi sites and have not found anything on this.

If anyone knows of a source of more information on this, please post it.

 

Re:Need example of using virtual Listview


Quote
>Joe Hicks wrote:

>If anybody has or can produce an example of using listview with ownerdata

You have a complete example in Delphi\Demos\VirtualListView.
________
Andreas
Delphi 5.01 Pro, NT4.0 Sp6a
Direct replies mailto:p...@augsburg.netsurf.de

Re:Need example of using virtual Listview


Thanks a bunch. I had just about figured it out by examining the vcl source and have since worked it out by trial and error and inspection. No thanks at all to the sample which confused the issue with it's shellitem(item.index)^ everywhere. It's not
that complicated now that I've figured it out and could have been demonstrated clearly with a code snippet of a short ondata proc.

Anyway, now that I have it working, is there a way to prevent it from windowshading every time the scroolbar is moved--other than doing owner draw as well as owner data. Also the column widths seem to be a constant problem in that trying to size them based on the column heading textwidth or the data width (-1 and -2) does not seem to work at all. Using the StringWidth function also comes up short every time if I use the exact information. I've had to fudge it to get them to come out right and I feel I should be able to precisely calculate the proper widths.

I have not done anything yet with the ownerdataonhint or the ownerdatasearch method.

Quote
Andreas Pawlik <p...@augsburg.netsurf.de> wrote:
>>Joe Hicks wrote:

>>If anybody has or can produce an example of using listview with ownerdata

>You have a complete example in Delphi\Demos\VirtualListView.
>________
>Andreas
>Delphi 5.01 Pro, NT4.0 Sp6a
>Direct replies mailto:p...@augsburg.netsurf.de

Re:Need example of using virtual Listview


The Delphi VirtualListView example is well and good if all you want to do is
build yet another system listview to view your files on storage devices.
Frankly, I leave the system tree/list views to the experts and would rather
purchase (and have done so) them than attempt to create my own.  However, I
use a listview to display 128x128 thumbnail images. At those thumbnail
dimensions, I can only display about 260 images on the listview because I'm
limited by the size of the imagelist canvas.  Can a virtual listview help in
this situation?  If so, how?

I agree with Mr. Hicks assessment of the virtual listview example and its
confusing of the issue with it's shellitem(item.index)^ everywhere as he so
eloquently put it.

Herminio

Quote
"Andreas Pawlik" <p...@augsburg.netsurf.de> wrote in message

news:3B053F9C.86D8BCD0@augsburg.netsurf.de...
Quote
> >Joe Hicks wrote:

> >If anybody has or can produce an example of using listview with ownerdata

> You have a complete example in Delphi\Demos\VirtualListView.
> ________
> Andreas
> Delphi 5.01 Pro, NT4.0 Sp6a
> Direct replies mailto:p...@augsburg.netsurf.de

Other Threads