Implements

Methods

  • Add a sub item to the parent element.

    Parameters

    Returns Promise<null | LPVOIDType>

    The LPVOID obj added to the parent element.

    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
    });
  • Set the ribbon element to be disabled or enabled.

    Parameters

    • enable: boolean = false

      Whether the compute function is enabled.

    Returns Promise<void>

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

    Parameters

    Returns Promise<void>

    let executeProc = {
    onExecute: async (clientData: LPVOID) => {
    console.log('This is a button', clientData);
    }
    };
    await btnElement.setExecuteProc(executeProc);
  • Set the tooltip information.

    Parameters

    • tooltip: string

      The tooltip information.

    Returns Promise<void>