🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4161

Re: Getting SYS Icons

#4161
From: Remy Lebeau (TeamB)
Date: Fri, 10 Mar 2006 19:18
50 lines
3413 bytes
"poojo hackma" <poojo.com/mail> wrote in message
news:4411a01a@newsgroups.borland.com...

> Also, it looks like once I add the OnGetImageIndex event handler
> for lvPC (the virtual ListView), the virtual part appears to stop working

Please elaborate.

> so I am only using the event for lvFtp (which not virtual ...because
> of my limited understanding of Shell Items used in the examples).

Using a virtual ListView has nothing to do with whether you are using the OS
Shell specifically.  You can use a virtual ListView for any purpose.  All it
does is allows you to store your own memory for the list item data, rather
than copying the data into the ListView (which is required for non-virtual
ListViews).  For example, if you have a TStringList, or other container,
that is storeing your FTP directory information, then you can have the
ListView display that container data directly, rather than requiring you to
manually add items to the TListView and copy the container data to the
TListItem properties for each item.

> I have to confess:  I'm not entirely sure how to make a TListView behave
> as a virtual ListView, but it seems the OwnerData property needs to be
true.

To use a TListView in virtual mode, there are several steps that you need to
do:

1) set the OwnerData property to True.

2) assign an OnData event handler that assigns the TListItem properties for
a specific TListItem.  On entry, the TListItem's Index property is usually
the only value that is assigned yet.  You use that indes to match the
TListItem to the cooresponding data in your container.

3) if you have a lot of items, or are performing filtering, then consider
also assigning an OnDataHint event handler so that you can cache the data
more effectively.  The event handler will provide the range of ListView
indexes that are most likely to be needed by the OnData event soon, so you
can ensure that those data items are available beforehand.

3) when adding items to the ListView, always use the TListItems::Count
property instead of the TListItems::Add/Insert() methods.  Arrange the data
in your container as needed, and then set the Count to the number of items
to display.  The OnData and OnDataHint events will be triggered when the
TListView needs list item data from you.


Gambit
Technical Details
Message-ID: <4411d0d2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <440ef041$1@newsgroups.borland.com> <440f3555$3@newsgroups.borland.com> <44108aa0$1@newsgroups.borland.com> <441090a9$1@newsgroups.borland.com> <4410abd3@newsgroups.borland.com> <4410cfe9$1@newsgroups.borland.com> <4411a01a@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9456c511753bafd3
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <440ef041$1@newsgroups.borland.com> <440f3555$3@newsgroups.borland.com> <44108aa0$1@newsgroups.borland.com> <441090a9$1@newsgroups.borland.com> <4410abd3@newsgroups.borland.com> <4410cfe9$1@newsgroups.borland.com> <4411a01a@newsgroups.borland.com>
Subject: Re: Getting SYS Icons
Date: Fri, 10 Mar 2006 11:18:48 -0800
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <4411d0d2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1142018258 68.69.17.41 (10 Mar 2006 11:17:38 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail