3

I have a custom control which utilizes TCollection and TCollectionItem. In the collection editor, I would like to add icons to each list item, which is sourced by an internal TImageList (inside its parent component). The collection items themselves represent icons, and I'd like to show the corresponding icon in this editor.

Collection Editor in Delphi

How can I make a custom collection editor to add my own icons to the list?

Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
  • 1
    The standard collection editor is not directly accessible, so you cannot derive from it, or subclass it. And it does not support displaying images for the list items, or custom drawing the list item. For what you are asking, you would have to create your own collection editor from scratch. – Remy Lebeau Aug 05 '18 at 00:15
  • @Remy I was afraid of that. Now I gotta figure out how to begin :-/ – Jerry Dodge Aug 05 '18 at 00:22
  • 1
    write a custom property editor for your `TCollection` property, and make that editor report `paDialog` as one of its attributes. Then, when the editor is invoked, it can display your own Form with whatever UI controls you want. – Remy Lebeau Aug 05 '18 at 01:06
  • 1
    BTW, the source of the Collection Editor can be found in the Delphi installations _source_ folder under _Property Editors\ColnEdit.pas_ – Uwe Raabe Aug 05 '18 at 05:22
  • This may just be another case where I answer my own question, once I get everything together... – Jerry Dodge Aug 05 '18 at 22:08

0 Answers0