Skip to content

Menu Mini

anidivr edited this page Jan 10, 2023 · 1 revision

Menu as row of icon buttons. Tooltip text displayed underneath

image

Code

Inputs

Name Type Default Description
menuitems Array empty List of menu items
margin number 0.02 Space between buttons
width number <calculated> Calculated width of menu in meters
selectable InteractiveObjects undefined Add to list of objects ray caster can test for overlap

Outputs

None

Examples

<flat-ui-menu-mini [menuitems]="menuitems" [selectable]="selectable"></flat-ui-menu-mini>
menuitems: Array<MenuItem> = [
  { text: 'Insert After', keycode: '', icon: 'add', enabled: true, submenu: this.actionmenu, selected: () => { this.showactions = true } },
  { text: 'Delete', keycode: 'DELETE', icon: 'delete', enabled: this.commands.length > 1, selected: () => { } },
  { text: 'Translate', keycode: 'T', icon: 'open_with', enabled: true, submenu: this.translatemenu, selected: () => { this.showtranslate = true } },
]

actionmenu: Array<MenuItem> = [
  { text: 'Line to', keycode: 'L', icon: '', enabled: true, selected: () => { } },
  { text: 'Vertical Line to', keycode: 'V', icon: '', enabled: true, selected: () => { } },
  { text: 'Horizontal Line to', keycode: 'H', icon: '', enabled: true, selected: () => { } },
  { text: 'Cubic Curve to', keycode: 'C', icon: '', enabled: true, selected: () => { } },
  { text: 'Bezier Curve to', keycode: 'Q', icon: '', enabled: true, selected: () => { } },
  { text: 'Close Path', keycode: 'Z', icon: '', enabled: true, selected: () => { } },
];
Clone this wiki locally