Using the GUI PainterProgramming ToolsUsing the Image Editor
 

Using the Menu Editor

Index

 

Introduction

The ST/X Menu Editor allows you to build hierarchical menu structures for: For each of them, components are defined in the Menu Editor using the same mechanism and operations.

The Menu Editor generates a resource method which contains and returns the menu specification. This method is typically created in the menu specs-category of the class protocol. It returns a symbolic representation (literal array) of the menu components and their behavior. The menu resource methods are invoked by the UIBuilder when the application's window is created for those widgets which define a menu aspect.

Of course, menu-specifications can also be converted to a real menu programmatically; by sending the #decodeAsLiteralArray-message to the spec (as returned by a spec method), a corresponding menu object is retrieved.

Starting the Menu Editor

There are multiple ways to start a Menu Editor:  After startup, a Menu Editor appears as shown in next figure:

A View of a Menu Editor
 

Menu Structure

Menus consist of a hierarchical collection of MenuItems, which can be regular menu items, separators and submenus.
Submenus can be either defined directly inside a menu definition, or indirectly, by referring to another menu specification (so called linked-menus).
The attributes of these menu components are described in more detail below.

Functions of the Menu Editor

The Menu Editor offers all functions for loading, saving, and modifying menu specifications. The basic functions can be accessed both by the menu and the tool bar. The basic functions are as follows:
 
Menu Button Description
File/Load Opens a dialog to load a menu spec from a class. 
File/Save Saves the current menu spec
and (if modified) also saves the help spec. 
Edit/Cut Cuts the selected item(s) and places it/them into clipboard.
Edit/Copy Copies the selected item(s) to the clipboard.
Edit/Paste Pastes the contents of the clipboard.
Edit/Move Up Moves the selected item one step up
(towards the top of the menu). 
Edit/Move Down Moves the selected item one step down
(towards the end of the menu). 
Edit/Move Into Next Moves the selected item into the next item
(which must be a submenu). 
Edit/Move Into Previous Moves the selected item into the previous item
(which must be a submenu). 
Edit/Move Out Moves the selected item out of its submenu
(i.e. into the parent menu). 
Add/Separator Adds a new menu separator. 
Add/Menu Item Adds a new regular menu item.
The items action will be performed when the
item is activated
(can be defined to activate on press or release). 
Add/Slice Adds a menu slice.
A slice is a partial menu and embedded (sliced-into) the menu.
(In contrast to submenus, slices are embedded right into the current menu instead of popping up a submenu). 
Add/Submenu Adds a new submenu.
The submenus definition will be embedded
in the edited menu spec. 
Add/Linked Submenu Adds a new linked submenu.
The submenus definition will be requested dynamically
from the application, by sending a
configured message. 
Add/Delayed Submenu Adds a delayed submenu under the current selected item.
Delayed menus have both an action and a submenu.
If pressed only for a short time, the action
will be preformed. If the mouse button is held
down for a longer time, a menu will appear. 
Add/Delayed Linked Submenu Adds a delayed linked submenu under the current selected item.
This is typically used for "back-in-history" type of menus. 
 
 
Further, there are functions from the menu:
 
File Menu Description
File/New Creates a new empty menu spec. 
File/Load Opens a dialog to load a menu spec from a class. 
File/Save As Opens a dialog to save
the current menu spec. 
File/Pick A Menu... Lets the user pick a menus definition from an existing menu
as present on the screen.
Changes the cursor to a cross-hair-cursor to indicate that
the user should click on a menu. 
File/Show Menu Spec Displays the current menu spec in a textView
(for debugging purposes).
File/Browse Class Opens a System Browser on the class which contains
the edited menu spec.
File/Exit Exits the Menu Editor.
 
 
Test Menu Description
Test/... Shows a menu preview of the current menu spec.
 
 
History Menu Description
History/... Switch to a previously edited menu spec. 
 
 
The editing of properties of the menu components is described in the next chapter.
 

Description of the Menu

After creating or loading of a menu specification the menu and its components are displayed in the tree view on the left side of the Menu Editor. The root item of the tree represents the menu itself. This single item is always shown, even if no menu is loaded. The only purpose of this item is to hold the menu spec selector. This selector must also be defined as the menu selector of the corresponding component in the GUI Painter.
If the item is selected, the user is able to configure the selector of the menu under which the generated menu spec is saved.

 The basic menu components from which a menu can be constructed are:

Recent Changes


[stx-logo]
Copyright © 1998 eXept Software AG, all rights reserved