interface RibbonElementType {
    addSubItem: (subItemInfo: AddSubItemType) => Promise<null | LPVOIDType>;
    getSubElementByName: (name: string) => Promise<null | RibbonElementType>;
    options?: Options;
    setExecuteProc: (proc: ExecuteProcCallbacksType) => Promise<void>;
    setTooltip: (tooltip: string) => Promise<void>;
    setEnabled(enable: boolean): Promise<void>;
}

Implemented by

Properties

addSubItem: (subItemInfo: AddSubItemType) => Promise<null | LPVOIDType>

Add a sub item to the parent element.

Type declaration

const ribbonBar = await app.getRibbonBar();
const ribbonCategory = await ribbonBar.addCategory('categoryName', 'categoryTitle');
const ribbonPanel = await ribbonCategory.addPanel('panelName', 'panelTitle', btnBitmap);
const ribbonElement = await ribbonPanel.addElement('elementName', 'elementTitle', btnBitmap);
const subribbonElement = await btnElement.addSubItem({
elementType: 0,
name: 'SubItem1',
title: 'SubItem1',
pos: -1,
isOnTop: true,
isChangeFun: false,
isChangeImage: false
});
getSubElementByName: (name: string) => Promise<null | RibbonElementType>

Get the sub element by name.

Type declaration

options?: Options
setExecuteProc: (proc: ExecuteProcCallbacksType) => Promise<void>

Set execute proc callback , which is called when the element is clicked.

Type declaration

let executeProc = {
FRExecuteProc: async (clientData: LPVOID) => {
console.log('This is a button', clientData);
}
};
await btnElement.setExecuteProc(executeProc);
setTooltip: (tooltip: string) => Promise<void>

Set the tooltip information.

Type declaration

    • (tooltip: string): Promise<void>
    • Parameters

      • tooltip: string

        The tooltip information.

      Returns Promise<void>

Methods

  • Set the ribbon element to be disabled or enabled.

    Parameters

    • enable: boolean

      Whether the compute function is enabled.

    Returns Promise<void>