Workbench User Guide : 2. Structuring an Application : How You Can Change Global Constants at Runtime : Selecting an Operation Style
 
Share this page                  
Selecting an Operation Style
Whether you structure your application around a control frame, sequential frames, or a multiple-use frame, you have many choices for providing operations to the user. Some of these options include:
Menu bar with commands and speed keys
Toolbars
Buttons such as push buttons and control buttons
Enumerated fields (such as list fields or palette fields) or table fields
Drag-and-drop actions
External class objects (ActiveX controls)
Tree views
List views
A single control frame may offer several kinds of interactions, such as a table field for selecting tasks and buttons or a menu bar for standard operations such as Close and Help. Moreover, the same frame may have more than one method for invoking operations to enable end users to interact with an application in the manner most comfortable for them.
For example, a menu bar with speed keys can repeat operations offered in the table field, enabling the user to invoke the same operation either from the keyboard or the mouse.
How You Can Provide Multiple Invocation Styles
Providing multiple invocation styles does not require multiple blocks of code. For example, the following event block provides both a Close button and a Close menu operation (that can have an associated speed key):
on click close_button,
on click menu.file.close_menu =
{
     return;
}
Note:  You must refer to menu operations by their complete names. The syntax is:
MenuBar.MenuStack.MenuItem
MenuBar
Specifies the name of the menu bar. Menu bars are named “menu” by default when you create them in the Menu Editor, although you can rename a dynamically created menu bar whatever you want.
MenuStack
Refers to the operation name that appears on the menu bar, such as File or Options. Each operation that appears on the menu bar can have a stack of operations associated with it that appears when the user clicks the operation name. The operation that appears on the bar for the example stack is probably called File, as its variable name is "file."
MenuItem
Specifies the associated operation for this particular menu item—for example, the Open, Close, and Exit items on the File menu. The operation on the example stack affected by this event is the "close_menu" operation.