BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using OnDrawItem in a TListView

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Steve
Guest





PostPosted: Tue Aug 23, 2005 10:53 am    Post subject: Using OnDrawItem in a TListView Reply with quote



I see a lot here about taking an image (typically a thumbnail) and
displaying in a TListView by intercepting the OnDrawItem event. I
want to display an image with text, very similar to the icon view of
the Windows Explorer. I've seen several references to how to do
it but all the explanations leave a little out, assuming more
knowledge than I have at this point.

I've posted this before with no responses so maybe if I rephrase it...

From what I can tell, I intercept the formation of the cell in the
ListView with the OnDrawItem event. At that point I determine the
coordinates (they are either passed as part of the OnDrawItem or I can
get them from the DispRect property, can't remember which right
now...) and I use those to put the image on the ListView with a Draw.
Then I do some calcs and figure out based on the image size where to
put the text so that it is next to the image (or under or whatever)
and use a TextOut method to do that?

Is that the best/usual way of doing such a thing? If not, is there a
better way?

Also, the OnDrawItem event seems to prevent the normal output, the
output that triggered the OnDrawItem in the first place, from being
written at all. If once I get control in the OnDrawItem, I don't do
anything, nothing is output. Once I get control in the OnDrawItem
event, if I determine that I really don't need to manipulate the
output and would be happy with the output that triggered the
OnDrawItem, is there a way that I can just let the normal output
proceed, kind of a "nevermind, you go ahead..." to the OnDrawItem?

Any help will be greatly appreciated...

Steve
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.