BCGControlBar Pro for MFC
void CBCGPRibbonPaletteButton::AddSubItem ( CBCGPBaseRibbonElement pSubItem,
int  nIndex = -1,
BOOL  bOnTop = FALSE 
)

Adds a new menu item to the drop down popup menu.

It's possible to combine popup palettes (Galleries) with popup menu items. Menu items may be placed before and/or after the gallery.

Use this function to add menu items to the popup gallery.

If you wish to insert the item at the top (before the Gallery), set bOnTop to TRUE. Set this parameter to FALSE to insert the item below the Gallery. Please note, that nIndex specifies the insertion index at the top and at the bottom separately.

For example, if you need to insert one item at position 1 before the Gallery, and one item at position 1 below the gallery, nIndex in both cases should be 1.

Copy
AddSubItem (pElem1, 1, TRUE);
AddSubItem (pElem2, 1, FALSE);
Parameters
pSubItemA pointer to the new menu item.
nIndexSpecifies the zero-based index to insert the item at.
bOnTopSpecifies whether the item should be inserted before (TRUE), or after (FALSE) the palette (gallery).