interface RibbonPanelType {
    addElement: (
        element: AddElementType,
    ) => Promise<null | RibbonElementType>;
    copyElementToPanel: (
        ribbonElement: RibbonElementType,
    ) => Promise<null | LPVOIDType>;
    getElementByIndex: (index: number) => Promise<null | RibbonElementType>;
    getElementByName: (
        elementName: string,
    ) => Promise<null | RibbonElementType>;
    getElementCount: () => Promise<number>;
    getName: () => Promise<string>;
    options: Options;
}

Implemented by

Properties

addElement: (element: AddElementType) => Promise<null | RibbonElementType>

Add a RibbonElement element to the current panel.

Type declaration

const parentWnd = await LPVOID.create();
const ribbonBar = await app.getRibbonBar(parentWnd);
const ribbonCategory = await ribbonBar.addCategory('categoryName', 'categoryTitle');
const ribbonPanel = await ribbonCategory.addPanel('panelName', 'panelTitle', btnBitmap);
const ribbonElement = await ribbonPanel.addElement({
elementType: FR_Ribbon_Element_Type.FR_RIBBON_BUTTON,
name: 'TestDropButton',
title: 'TestDropButton',
pos: -1
});
copyElementToPanel: (
    ribbonElement: RibbonElementType,
) => Promise<null | LPVOIDType>

Copy the element to the panel.

Type declaration

getElementByIndex: (index: number) => Promise<null | RibbonElementType>

Get the element object by index.

Type declaration

    • (index: number): Promise<null | RibbonElementType>
    • Parameters

      • index: number

        The index of the element. This value can be iterated through from getElementCount.

      Returns Promise<null | RibbonElementType>

      Get the specified element object.

getElementByName: (elementName: string) => Promise<null | RibbonElementType>

Get the RibbonElement element by the name of the element.

Type declaration

    • (elementName: string): Promise<null | RibbonElementType>
    • Parameters

      • elementName: string

        The name of the element.

      Returns Promise<null | RibbonElementType>

      Get the specified element object.

getElementCount: () => Promise<number>

Get the number of elements in the panel.

Type declaration

    • (): Promise<number>
    • Returns Promise<number>

      The number of elements in the panel.

getName: () => Promise<string>

Get the name of the panel.

Type declaration

    • (): Promise<string>
    • Returns Promise<string>

      The name of the panel.

options: Options