BimCT SDK / WebGL2 Viewer
    Preparing search index...

    Class BimCTContextMenu

    Class representing a BimCT context menu.

    Hierarchy

    • BimCTPopupMenu
      • BimCTContextMenu
    Index

    Constructors

    Accessors

    • get showing(): boolean

      Gets whether the menu is currently showing.

      Returns boolean

      True if the menu is showing, otherwise false.

    • get renderer(): LocalBIMRenderer

      Gets the renderer associated with the popup menu.

      Returns LocalBIMRenderer

      The renderer.

    • get popUpX(): number

      Returns number

    • get popUpY(): number

      Returns number

    Methods

    • Creates a 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.

      • Optionalenabled: BimCTMenuEnabledCallback

        Callback to check if the menu item is enabled.

      • image: string = null

        The image for the menu item.

      Returns BimCTPopupMenuItem

      The created menu item.

    • Creates a check 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.

      • Optionalenabled: BimCTMenuEnabledCallback

        Callback to check if the menu item is enabled.

      Returns BimCTPopupCheckMenuItem

      The created menu item.

    • Creates a bold and italic 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

      The created submenu.

    • Creates a submenu.

      Parameters

      • text: string

        The text of the submenu.

      • isI18n: boolean

        Whether the text is internationalized.

      • type: SUBMENU_TYPE

        The type of the submenu.

      • Optionalicon: string

      Returns BimCTPopupSubMenuItem

      The created submenu.

    • Adds a separator to the menu.

      Returns void

    • Removes a menu item.

      Parameters

      • item: BimCTMenuItem

        The menu item to remove.

      Returns void

    • Deletes the popup menu.

      Returns void

    • Gets the HTML div element of the popup menu.

      Returns HTMLDivElement

      The HTML div element.

    • Checks if the menu was clicked.

      Parameters

      • clientX: number

        The X coordinate of the click.

      • clientY: number

        The Y coordinate of the click.

      Returns boolean

      True if the menu was clicked, otherwise false.

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

      Parameters

      • customMenu: BimCTCustomMenu

      Returns BimCTCustomMenu

    • 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

    • Adds a custom menu item to the default custom menu

      Parameters

      Returns void

    • Clears all custom menu items.

      Returns void

    • Clears all custom menus.

      Returns void

    • Shows the context menu.

      Parameters

      • event: UIEvent

        The UI event that triggered the context menu.

      Returns void

    • Hides the context menu.

      Returns boolean

      True if the menu was showing, otherwise false.

    • Checks if the context menu is currently showing.

      Returns boolean

      True if the context menu is showing, otherwise false.

    • Constructs the context menu.

      Parameters

      • x: number

        The X coordinate for the menu.

      • y: number

        The Y coordinate for the menu.

      Returns Promise<void>

    • Parameters

      • OptionalonLiveUpdate: (rgb: { r: number; g: number; b: number }) => void

      Returns Promise<string>