Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make the Object Inspector show more TColor property values?

The IDE Object Inspector shows TColor properties with a drop-down ColorBox, and the color can be selected by name - clBlack etc, as defined in the Graphics unit. The problem is that the clWeb colors also defined in the Graphics unit are not present, and any custom colors I define are also not there.

So how do I extend the defined colors that are selectable in the Object Inspector?

PS Delphi XE

like image 949
HMcG Avatar asked Jan 04 '11 23:01

HMcG


1 Answers

I would try to derive a class from TColorProperty (unit VCLEditors) and override GetValue/GetValues/SetValue. See here for a detailed discussion.

Edit: My original link is broken by now. Try the thread Custom colors in Delphi 7 (in borland.public.delphi.vcl.components.writing.general) instead.

like image 161
Uli Gerhardt Avatar answered Oct 22 '22 10:10

Uli Gerhardt