Adding and Removing Properties Palette Tabs

The IAcPpPalette, IAcPpPaletteEvents, IAcPpPaletteSet, and IAcPpPaletteSetEvents interfaces allow you to define new palettes, or tabs, and add them to the Properties palette at runtime.

The IAcPpPalette and IAcPpPaletteEvents interfaces expose a single tab to the Properties palette. Every Properties palette tab embeds one Property Inspector control. The IAcPpPalette interface supplies access to the palette's name and its property inspector. IAcPpPaletteEvents allows the tab to send notifications of name changes and selection set events to connected listeners.

To create a custom tab, you get a pointer to an IAcPpPalette object by calling ::CoCreateInstance() with CLSID_AcPpPalette as its first argument. You must use this object's put_Name() method to set the unique name of your palette. The embedded Property Inspector is implemented internally.

Access to the entire set of Properties palettes tabs is provided through the IAcPpPaletteSet and IAcPpPaletteSetEvents interfaces. The Properties palette implements these interfaces to let you add, remove, insert, and access individual palettes. All Properties palette tabs are instances of IAcPpPalette. To add your palette to the Properties palette, you must first get the IAcPpPaletteSet interface pointer. Because all instances of IAcPpPaletteSet point to the singleton Properties palette dialog, you can retrieve this pointer by calling ::CoCreateInstance(), using CLSID_AcPpPaletteSet as its first argument. You then use the returned pointer to call either its AddPalette() or its InsertPalette() method. If you want to receive notification of changes to the Properties palette's tab set, you must connect yourself as a listener through the IAcPpPaletteSetEvents object's IConnectionPointContainer interface.