In addition to customizing the appearance of standard Property Inspector controls, a property source also may provide display instructions for each of its individual properties. Per-property customization allows you to
Objects implement the IAcPiPropertyDisplay interface to customize the display on a per-property basis. This is done with least effort by deriving from the IAcPiPropertyDisplayImpl template class and declaring a per-property display map. IAcPiPropertyDisplayImpl implements the entire IAcPiPropertyDisplay interface for you. To customize this implementation, you simply list your custom settings in the map. Each map entry provides the following information for a single property:
For example, the following map sets the color of a MyProp property to red (0x000000ff):
BEGIN_PERPROPDISPLAY_MAP() PROP_DISP_ENTRY(DISP_MYPROP, NULL, NULL, NULL, NULL, NULL, 0x000000ff, FALSE, 0, 0) END_PERPROPDISPLAY_MAP()
For static properties, the Property Inspector queries the object's or command's IUnknown interface for a pointer to the IAcPiPropertyDisplay interface. For dynamic properties, either the IDynamicProperty or IDynamicProperty2 interface is queried for this pointer. If a valid pointer is obtained, the Property Inspector invokes its methods to determine each property's custom display attributes. One method that is invoked is GetCustomPropertyCtrl(). Objects implement this method if they want their properties to be edited with a custom ActiveX control. The Property Inspector always consults this method before attempting to assign a stock control.
See the Implementing Dynamic Properties section for additional information on customizing dynamic property displays.