Menu item events
Menu items have the following events:
-
Clicked
Typically, your application will contain Clicked scripts for
each menu item in a drop-down or cascading menu. For example, the
script for the Clicked event for the Open menu item on the File
menu opens a file. -
Help
You can provide Help on a menu item when a user presses the
F1 key, or when the user clicks the context Help button [?] on the
title bar of the window with which the menu is associated, and
then clicks on a menu item. -
Selected
You will probably use few Selected scripts since users do
not expect things to happen when they simply highlight a menu
item. One use of Selected scripts is to change MicroHelp displayed
in an MDI application as the user scrolls through a menu.
About the Clicked event
The Clicked event is triggered whenever:
-
The user clicks the menu item
-
The user selects (highlights) the menu item using the
keyboard and then presses ENTER -
The user presses the shortcut key for the menu item
-
The menu containing the menu item is displayed and the user
presses the accelerator key Alt+key -
A script executes the PopMenu function and displays a pop-up
menu -
A menu item responds to a mouse-click or the keyboard only
if both its Visible and Enabled properties are set to
“true”. -
If the menu item has a drop-down or cascading menu under it,
the script for its Clicked event (if any) is executed when the
mouse button is pressed, and then the drop-down or cascading menu
displays. If the menu item does not have a menu under it, the
script for the Clicked event is executed when the mouse button is
released.
Using the Clicked event to specify menu item
properties
When the user clicks an item on the menu bar to display a
drop-down menu, the Clicked event for the menu item on the menu bar
is triggered and then the drop-down menu is displayed.
You can use the menu bar’s Clicked event to specify the
properties of the menu items in the drop-down menu. For example, if
you want to disable items in a drop-down menu, you can disable them
in the script for the Clicked event for the menu item in the menu
bar.
About the Help event
The Help event is triggered when the user presses F1 or clicks
the context Help button [?] on a window’s title bar and then points
and clicks on a menu item.
About the Selected event
The Selected event is triggered when the user selects a menu
item.