Class representing a BimCT context menu.

Hierarchy

  • BimCTPopupMenu
    • BimCTContextMenu

Constructors

Accessors

  • get popUpX(): number
  • Returns number

  • get popUpY(): number
  • Returns number

  • get renderer(): LocalBIMRenderer
  • Gets the renderer associated with the popup menu.

    Returns

    The renderer.

    Returns LocalBIMRenderer

  • get showing(): boolean
  • Gets whether the menu is currently showing.

    Returns

    True if the menu is showing, otherwise false.

    Returns boolean

Methods

  • Adds a new custom menu that is placed on top of the context menu.

    Parameters

    • customMenu: BimCTCustomMenu

    Returns void

  • Adds a custom menu item to the default custom menu

    Parameters

    Returns void

  • Adds a separator to the menu.

    Returns void

  • Clears all custom menu items.

    Returns void

  • Clears all custom menus.

    Returns void

  • Constructs the context menu.

    Parameters

    • x: number

      The X coordinate for the menu.

    • y: number

      The Y coordinate for the menu.

    Returns Promise<void>

  • Creates a bold and italic submenu.

    Returns

    The created submenu.

    Parameters

    • text: string

      The text of the submenu.

    • isI18n: boolean

      Whether the text is internationalized.

    • type: SUBMENU_TYPE

      The type of the submenu.

    Returns BimCTPopupSubMenuItem

  • Creates a check menu item.

    Returns

    The created menu item.

    Parameters

    • text: string

      The text of the menu item.

    • isI18n: boolean

      Whether the text is internationalized.

    • shortcut: string

      The shortcut key for the menu item.

    • checked: boolean

      Whether the menu item is checked.

    • click: BimCTMenuEventCallback

      The click event callback.

    • Optional enabled: BimCTMenuEnabledCallback

      Callback to check if the menu item is enabled.

    Returns BimCTPopupCheckMenuItem

  • Creates a menu item.

    Returns

    The created menu item.

    Parameters

    • text: string

      The text of the menu item.

    • isI18n: boolean

      Whether the text is internationalized.

    • shortcut: string

      The shortcut key for the menu item.

    • click: BimCTMenuEventCallback

      The click event callback.

    • Optional enabled: BimCTMenuEnabledCallback

      Callback to check if the menu item is enabled.

    • image: string = null

      The image for the menu item.

    Returns BimCTPopupMenuItem

  • Creates a submenu.

    Returns

    The created submenu.

    Parameters

    • text: string

      The text of the submenu.

    • isI18n: boolean

      Whether the text is internationalized.

    • type: SUBMENU_TYPE

      The type of the submenu.

    • Optional icon: string

    Returns BimCTPopupSubMenuItem

  • Deletes the popup menu.

    Returns void

  • Gets the HTML div element of the popup menu.

    Returns

    The HTML div element.

    Returns HTMLDivElement

  • Hides the context menu.

    Returns

    True if the menu was showing, otherwise false.

    Returns boolean

  • Checks if the menu was clicked.

    Returns

    True if the menu was clicked, otherwise false.

    Parameters

    • clientX: number

      The X coordinate of the click.

    • clientY: number

      The Y coordinate of the click.

    Returns boolean

  • Checks if the context menu is currently showing.

    Returns

    True if the context menu is showing, otherwise false.

    Returns boolean

  • Removes a menu item.

    Parameters

    • item: BimCTMenuItem

      The menu item to remove.

    Returns void

  • Removes a custom menu.

    Parameters

    • customMenu: BimCTCustomMenu

    Returns void

  • Sets the custom menu text of the default custom menu.

    Parameters

    • text: string | BimCTTextCallback

      The custom menu text.

    Returns void

  • Shows the context menu.

    Parameters

    • event: UIEvent

      The UI event that triggered the context menu.

    Returns void