Previous Topic

Next Topic

Inhoudsopgave

Book Index

InitMenu Event

Event Event InitMenu( aMenu: TMenuItem)

Description

Event that is fired when the screen is opened and the main menu of this screen is built up.

Remarks

Use the InitMenu procedure to dynamicaly add menu items from event scripts.

Parameters

InitMenu Event Methods

Method Method AddItem( Caption: String, Event: Event ): TMenuItem

Adds a menu item to the Edit menu. Use the AddItem function in the InitMenu procedure of an event script. Parameters:

Code Snippet

rem Example of the use of custom menu items

rem Added by script to default edit menu in screen

Sub NewMenuItemClick(aMenu)

rem The event to run when the user

rem clicks the new menu item

MsgBox "You clicked the new menu item"

End Sub

Sub InitMenu(aMenu)

rem Add a menu item to the Edit menu.

rem And set the event to run as a script event

Set item = aMenu.AddItem( "New MenuItem", "NewMenuItemClick")

End Sub