Popup Menu - Custom, Icons, Color, Radio...

Popup menu anchored to a button. It can include text options, icons from the application's "Assets", HTML text, change the menu radius, background color and the separator line between items.

20241023_065758


Function

ShowPopupMenu

  1. anchorComponent: Button where the menu will be anchored.
  2. options: List of text options to display in the menu.
  3. icons: List of icons from Assets. If the list of icons is smaller than the list of options, the first icon is reused.
  4. backgroundColor: Background color of the menu, which accepts both hexadecimal and int formats.
  5. cornerRadius: Radius of the corners of the menu.
  6. textSize: Text size.
  7. textColor: Text color, which also accepts hexadecimal or int formats.
  8. useHtml: Boolean indicating whether text options should be interpreted as HTML or not.
  9. separatorColor: Color of the separators between the options.
  10. showAboveAnchor: Boolean to determine whether the menu should appear above or below the anchored component.

Event

PopupMenuItemSelected

  • Parámetros:
  1. item: Texto de la opción seleccionada.
  2. index: Indice de la opción seleccionada.
  3. iconPath: Ruta del icono asociado con la opción seleccionada, si hay uno disponible.

Extension:
joejsanz.joedevpopupmenu.aix (12.4 KB)


Thanks.

9 Likes

Good work, looks like a prettified version of Ulli's PopupMenu extension.

  • Does the popupmenu have to be anchored to a component? can it be positioned by coordinates or location - e.g. centre/centre
  • what happens if "showAboveAnchor" is set to false, and the anchor is at the bottom of a fixed page view
2 Likes

Thanks a lot Tim.

  • Yes, it must be anchored, it cannot be positioned by coordinates or location.

  • If "showAboveAnchor" is set to false and the anchor is at the bottom, the popup menu will not be visible, which is why I set that parameter, so it could appear at the bottom or top.
    Although now that you mention it, I think I could make it detect what position the anchor is at.

1 Like