UIMenu

class UIMenu

extends Component implements UIRenderable

Represents a menu that can be displayed on screen. The menu itself is built up dynamically using a platform dependent builder class.

Example

For an example of how UIMenu can be used, refer to UIModalController.

Constructor

(): UIMenu

.builder

UIMenuBuilder

Menu builder, can be used to build up the menu before it is displayed.

.render()

(callback: RenderCallback<Output<UIRenderable, any>>): void

Build the current menu and render it using UIMenu.builder.

.menu

UIRenderable

The last menu that was built, as a child object.

.gravity

"start" | "end" | "stretch"

Menu gravity in relation to reference component (start/stretch/end).

.options

{ key: string; text: Stringable; }[]

List of initial menu options; for advanced menus use onBuild to build the menu dynamically.

.selected

string

The key of the menu item that was last selected, if any.

.isPresetComponent() protected

(): boolean

Inherited from Component.isPresetComponent.

.getParentComponent()

[1]. (): Component
[2]. <TParent extends Component>(ParentClass: ComponentConstructor<TParent>): TParent

Inherited from Component.getParentComponent.

.getCompositeParent()

<TParent extends Component>(ParentClass?: ComponentConstructor<TParent>): TParent

Inherited from Component.getCompositeParent.

.propagateComponentEvent()

(name: string, inner?: ManagedEvent): void

Inherited from Component.propagateComponentEvent.

.managedId

number

Inherited from ManagedObject.managedId.

.managedState

ManagedState

Inherited from ManagedObject.managedState.

.getReferenceCount() protected

(): number

Inherited from ManagedObject.getReferenceCount.

.getManagedReferrers() protected

(): ManagedObject[]

Inherited from ManagedObject.getManagedReferrers.

.getManagedParent() protected

[1]. (): ManagedObject
[2]. <TParent extends ManagedObject>(ParentClass: ManagedObjectConstructor<TParent>): TParent

Inherited from ManagedObject.getManagedParent.

.emit()

<TEvent extends ManagedEvent = ManagedEvent, TConstructorArgs extends any[] = any[]>(e: string | TEvent | (new (...args: TConstructorArgs) => TEvent), ...constructorArgs: TConstructorArgs): this

Inherited from ManagedObject.emit.

.propagateChildEvents() protected

[1]. (f?: (this: this, e: ManagedEvent, propertyName: string) => void | ManagedEvent | ManagedEvent[]): this
[2]. (...types: (ManagedEvent | (new (...args: any[]) => ManagedEvent))[]): this

Inherited from ManagedObject.propagateChildEvents.

.activateManagedAsync() protected

(): Promise<any>

Inherited from ManagedObject.activateManagedAsync.

.deactivateManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.deactivateManagedAsync.

.destroyManagedAsync() protected

(): Promise<void>

Inherited from ManagedObject.destroyManagedAsync.

.onManagedStateActivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActivatingAsync.

.onManagedStateActiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateActiveAsync.

.onManagedStateDeactivatingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDeactivatingAsync.

.onManagedStateInactiveAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateInactiveAsync.

.onManagedStateDestroyingAsync() protected

(): Promise<void>

Inherited from ManagedObject.onManagedStateDestroyingAsync.


UIMenu.Presets

UIMenu presets type, for use with Component.with.

.options

{ key: string; text: string; }[]

List of menu options; for advanced menus use onBuild to build the menu dynamically.

.gravity

"start" | "end" | "stretch"

Menu gravity in relation to reference component (start/stretch/end).

.onBuild

ComponentEventHandler<UIMenu, ComponentEvent>

Event handler that is invoked every time just before the menu is rendered.

.onSelectMenuItem

ComponentEventHandler<UIMenu, UIMenuItemSelectedEvent>

Event handler that is invoked after a menu item has been picked.