PopupMenu

PopupMenu displays a list of options.

PopupMenu is the typical Control that displays a list of options. They are popular in toolbars or context menus.

@GodotBaseClass
struct PopupMenu {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

_getItems
Array _getItems()
_guiInput
void _guiInput(InputEvent arg0)
_setItems
void _setItems(Array arg0)
_submenuTimeout
void _submenuTimeout()
addCheckItem
void addCheckItem(StringArg0 label, long id, long accel)

Add a new checkable item with text "label". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.

addCheckShortcut
void addCheckShortcut(ShortCut shortcut, long id, bool global)
addIconCheckItem
void addIconCheckItem(Texture texture, StringArg1 label, long id, long accel)

Add a new checkable item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.

addIconCheckShortcut
void addIconCheckShortcut(Texture texture, ShortCut shortcut, long id, bool global)
addIconItem
void addIconItem(Texture texture, StringArg1 label, long id, long accel)

Add a new item with text "label" and icon "texture". An id can optionally be provided, as well as an accelerator keybinding. If no id is provided, one will be created from the index.

addIconShortcut
void addIconShortcut(Texture texture, ShortCut shortcut, long id, bool global)
addItem
void addItem(StringArg0 label, long id, long accel)

Add a new item with text "label". An id can optionally be provided, as well as an accelerator keybinding. If no id is provided, one will be created from the index.

addRadioCheckItem
void addRadioCheckItem(StringArg0 label, long id, long accel)

The same as addCheckItem but the inserted item will look as a radio button. Remember this is just cosmetic and you have to add the logic for checking/unchecking items in radio groups.

addRadioCheckShortcut
void addRadioCheckShortcut(ShortCut shortcut, long id, bool global)
addSeparator
void addSeparator(StringArg0 label)

Add a separator between items. Separators also occupy an index.

addShortcut
void addShortcut(ShortCut shortcut, long id, bool global)
addSubmenuItem
void addSubmenuItem(StringArg0 label, StringArg1 submenu, long id)

Adds an item with a submenu. The submenu is the name of a child PopupMenu node that would be shown when the item is clicked. An id can optionally be provided, but if is isn't provided, one will be created from the index.

clear
void clear()

Clear the popup menu, in effect removing all items.

getItemAccelerator
long getItemAccelerator(long idx)

Return the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is focused.

getItemCount
long getItemCount()

Return the amount of items.

getItemIcon
Ref!Texture getItemIcon(long idx)

Return the icon of the item at index "idx".

getItemId
long getItemId(long idx)

Return the id of the item at index "idx".

getItemIndex
long getItemIndex(long id)

Find and return the index of the item containing a given id.

getItemMetadata
Variant getItemMetadata(long idx)

Return the metadata of an item, which might be of any type. You can set it with setItemMetadata, which provides a simple way of assigning context data to items.

getItemShortcut
Ref!ShortCut getItemShortcut(long idx)
getItemSubmenu
String getItemSubmenu(long idx)

Return the submenu name of the item at index "idx".

getItemText
String getItemText(long idx)

Return the text of the item at index "idx".

getItemTooltip
String getItemTooltip(long idx)
getSubmenuPopupDelay
double getSubmenuPopupDelay()
isHideOnCheckableItemSelection
bool isHideOnCheckableItemSelection()
isHideOnItemSelection
bool isHideOnItemSelection()
isHideOnStateItemSelection
bool isHideOnStateItemSelection()
isHideOnWindowLoseFocus
bool isHideOnWindowLoseFocus()
isItemCheckable
bool isItemCheckable(long idx)

Return whether the item at index "idx" is checkable in some way, i.e., whether has a checkbox or radio button. Note that checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually.

isItemChecked
bool isItemChecked(long idx)

Return whether the item at index "idx" is checked.

isItemDisabled
bool isItemDisabled(long idx)

Return whether the item at index "idx" is disabled. When it is disabled it can't be selected, or its action invoked.

isItemRadioCheckable
bool isItemRadioCheckable(long idx)

Return whether the item at index "idx" has radio-button-style checkability. Remember this is just cosmetic and you have to add the logic for checking/unchecking items in radio groups.

isItemSeparator
bool isItemSeparator(long idx)

Return whether the item is a separator. If it is, it would be displayed as a line.

isItemShortcutDisabled
bool isItemShortcutDisabled(long idx)
opAssign
PopupMenu opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(PopupMenu other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
removeItem
void removeItem(long idx)

Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one.

setHideOnCheckableItemSelection
void setHideOnCheckableItemSelection(bool enable)
setHideOnItemSelection
void setHideOnItemSelection(bool enable)
setHideOnStateItemSelection
void setHideOnStateItemSelection(bool enable)
setHideOnWindowLoseFocus
void setHideOnWindowLoseFocus(bool enable)
setItemAccelerator
void setItemAccelerator(long idx, long accel)

Set the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is focused.

setItemAsCheckable
void setItemAsCheckable(long idx, bool enable)

Set whether the item at index "idx" has a checkbox. Note that checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually.

setItemAsRadioCheckable
void setItemAsRadioCheckable(long idx, bool enable)

The same as setItemAsCheckable but placing a radio button in case of enabling. If used for disabling, it's the same. Remember this is just cosmetic and you have to add the logic for checking/unchecking items in radio groups.

setItemAsSeparator
void setItemAsSeparator(long idx, bool enable)

Mark the item at index "idx" as a separator, which means that it would be displayed as a mere line.

setItemChecked
void setItemChecked(long idx, bool checked)

Set the checkstate status of the item at index "idx".

setItemDisabled
void setItemDisabled(long idx, bool disabled)

Sets whether the item at index "idx" is disabled or not. When it is disabled it can't be selected, or its action invoked.

setItemIcon
void setItemIcon(long idx, Texture icon)
setItemId
void setItemId(long idx, long id)

Set the id of the item at index "idx".

setItemMetadata
void setItemMetadata(long idx, VariantArg1 metadata)

Sets the metadata of an item, which might be of any type. You can later get it with getItemMetadata, which provides a simple way of assigning context data to items.

setItemMultistate
void setItemMultistate(long idx, long state)
setItemShortcut
void setItemShortcut(long idx, ShortCut shortcut, bool global)
setItemShortcutDisabled
void setItemShortcutDisabled(long idx, bool disabled)
setItemSubmenu
void setItemSubmenu(long idx, StringArg1 submenu)

Sets the submenu of the item at index "idx". The submenu is the name of a child PopupMenu node that would be shown when the item is clicked.

setItemText
void setItemText(long idx, StringArg1 text)

Set the text of the item at index "idx".

setItemTooltip
void setItemTooltip(long idx, StringArg1 tooltip)
setSubmenuPopupDelay
void setSubmenuPopupDelay(double seconds)
toggleItemChecked
void toggleItemChecked(long idx)
toggleItemMultistate
void toggleItemMultistate(long idx)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

hideOnCheckableItemSelection
bool hideOnCheckableItemSelection [@property getter]
bool hideOnCheckableItemSelection [@property setter]
hideOnItemSelection
bool hideOnItemSelection [@property getter]
bool hideOnItemSelection [@property setter]
hideOnStateItemSelection
bool hideOnStateItemSelection [@property getter]
bool hideOnStateItemSelection [@property setter]
items
Array items [@property getter]
Array items [@property setter]
submenuPopupDelay
double submenuPopupDelay [@property getter]
double submenuPopupDelay [@property setter]

Sets the delay time for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item. Default value: 0.3 seconds.

Static functions

_new
PopupMenu _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta