Class: Menu

Cadcorp.UI.Menu

Displays a menu
Parameters:
Name Type Description
config Object Configuration for this object. The config supplied directly extends the control

Members

dialogControllerID

Properties:
Name Type Description
dialogControllerID string The id of the dialog controller.

id

Properties:
Name Type Description
id string The id of this control.

itemArray

Properties:
Name Type Description
itemArray Array.<Cadcorp.UI.MenuItem> Array of menu items

showImageOnly

Properties:
Name Type Description
showImageOnly boolean True if the menu will only show images, otherwise false

Methods

close()

Closes the menu and all sub menus

deactivateMenu(menu)

Deactivates a menu item, if it is the current menu item
Parameters:
Name Type Description
menu Cadcorp.UI.MenuItem The menu item to deactivate

getDialog(dialogId) → {Cadcorp.UI.DialogBase|null}

Gets a dialog from the registered dialogs using the dialogControllerID.
Parameters:
Name Type Description
dialogId string The id of the dialog to get
Returns:
The found dialog
Type
Cadcorp.UI.DialogBase | null

getHeight() → {number}

Gets the height of this menu
Returns:
The height, in pixels, of this menu
Type
number

getMenuItem(dialogId) → {Cadcorp.UI.MenuItem|null}

Gets a menu item.
Parameters:
Name Type Description
dialogId string The id of the dialog to get
Returns:
The found dialog
Type
Cadcorp.UI.MenuItem | null

getPosition() → {Cadcorp.UI.Menu.Position}

Gets the position of the menu
Returns:
The position
Type
Cadcorp.UI.Menu.Position

hideDialog(dialogID)

Hides a dialog, using the dialogControllerID.
Parameters:
Name Type Description
dialogID string The id of the dialog to hide

showDialog(dialogID)

Shows a dialog using the dialogControllerID. If another dialog is already open it is closed
Parameters:
Name Type Description
dialogID string The id of the dialog to show

Type Definitions

Position

Describes the top left coordinate of an element
Type:
  • Object
Properties:
Name Type Description
top number The top position in pixels
left number The left position in pixels