Hi,
I want to customize a Property Grid in the following way:
The Property Grid should show a property which value should be changed
by a dropdown-listbox.
For example, there is a property called "animal" and when I want to
change the value of the property in the property grid it should show
me a dropdown-box with standard values like "cow","cat" or "bird".
In general it is not a problem. I created a new class
TStringConverterAnimal deriving from StringConverter which provides a
method StandardValuesCollection*
GetStandardValues(ITypeDescriptorContext* context). The
StandardValueCollection then contains the standard values "cow","cat"
and "bird".
This works fine - the property grid shows me a drop down - box with
the standard values.
Now my problem:
I want to show a small picture of the animal at the left side of
_every_
standard value in the dropdown-list.
My first idea was, that I create a class TAnimalPropertyEditor
deriving from
UITypeEditor. In this class I override the method
PaintValue(PaintValueEventArgs *pe), compare the String pe->Value with
the names of my animals and then I draw the picture of the animal with
pe->Graphics->... .
The problem is, that it only draws the picture of the animal beside
the first value in the dropdown-box. On the left of the other values
I can find a small Picture too, but it is empty.
How can I solve this problem?
Thanks and greetings
Andreas Poller
--
Andreas Poller
Student der TU Chemnitz
Fakultät für Informatik