ThievingSix
asked on
TListView - OnAdvancedCustomDrawItem Shadowed Text
I have a TListView working like the Windows desktop. Basically icons with text underneath. The end user is also able to set their own background.
Now, like the Windows desktop I want to add a shadow to the icons caption. This is because if part of the background is white or a light color, the text will be very hard to see.
So, I wanted to use the AdvancedCustomDrawItem with the Stage being cdPostPaint. This way the item is already painted and I could do just the shadowing.
Now, I need the area which the caption is drawn. So I thought to use:
But, this doesn't return anything but null values. I stepped through the code and ListView_GetItemRect() returns True but the rect is full of zero's.
Any ideas? I'd also accept workarounds as well.
Now, like the Windows desktop I want to add a shadow to the icons caption. This is because if part of the background is white or a light color, the text will be very hard to see.
So, I wanted to use the AdvancedCustomDrawItem with the Stage being cdPostPaint. This way the item is already painted and I could do just the shadowing.
Now, I need the area which the caption is drawn. So I thought to use:
IconCaptionArea := Item.DisplayRect(drLabel);
But, this doesn't return anything but null values. I stepped through the code and ListView_GetItemRect() returns True but the rect is full of zero's.
Any ideas? I'd also accept workarounds as well.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can't believe I believed it didn't work.
ASKER
Below is what I'm using now. Too bad it doesn't work with long single words. Turns out like:
Open in new window
Untitled.png