The
Menu Editor is a tool which can be used for creating a menu visually. Menu
is represented here as a tree structure of menu items and menu folders.
We decided to use tree structure, because this visual representation is
natural for menus and allows you to control and maintain your menu easier.
During your work in the Menu Editor, you can watch your menu growing in
the Form Editor window.
Parts of the Menu Editor
The Menu Editor contains:
command menu - Menu Editor's own menu for user to specify commands
such as insert, remove etc.
menu tree - tree structure which shows current content of the
menu
vertical scrollbar
Invoking the Menu Editor
Menu editor can be invoked only using the Component Inspector when inspecting
form's component Menubar. To invoke the menu editor, follow these steps:
add Menubar component to the form (see the Form Editor and the
Component Palette for further help). Menubar's attributes will appear in
the Component Inspector window.
"Items..." is a special input property, so the button
with three points will appear.
press the "special input" button and the Menu Editor
will appear.
Using the Menu Editor
So far, so good. Now we are in the Menu Editor(ME). Working with the
ME should be natural and intuitive. Whole process of the work with
the ME can be separated into several actions:
Working with the tree
Moving across the tree Only one menu item or folder can be selected at a time, you can
move with this selection by pressing up/down arrow keys or by clicking
the mouse on the name of specified item. When pressing arrows, area will
be scrolled automatically if necessary. Opening / closing the folders User can open (pull down) or close (pull up) menu folder by using
proper menu command, by pressing the "Space" key or by clicking
the mouse on the icon before the name of the folder.
Note: When you invoke the ME for the first time, you will
see that it already has small "empty" menu. In fact, this is
the smallest possible menu which you can maintain with the Menu Editor.
Th Menu Editor must not be blank.
Inserting menu folders, items
When you want to insert some menu folder or item, there are actually
two possible ways.
enter the command menu (submenu creation) and specify your need
or press the shortcut
In either case, the Menu editor will switch into edit mode and allow
you to type the name of your new folder or item. When you are finished,
press the Enter key to commit changes or Esc key to abandom
them. See the below picture to find out how edit mode looks like.
Note: New folder or item is always placed after currently
selected one and then selected.
Note: When you insert a separator, there's no need to edit it. That's
why the Menu Editor will not switch into edit mode when inserting separator.
click command menu Creation/Remove or press Del key
Note: The next item to deleted will be selected. Use this feature
with care, because it has no confirmation. When you try to remove folder,
all submenu will be deleted.
You will probably immediately notice that content of the Component Inspector
changes as you 're working with the ME. From the Component Inspector's
point of view, the Menu Editor is just another inspectable (beside the
Form Editor). Component inspector shows you all menu components in the
selection choice (important notice - menu items are components too!) and
you can work with them as usual. The Component Inspector and the Menu Editor
share and modify the same data. When you change something in the Menu Editor,
the Component Inspector is notified and changes are immediatelly visible.
Going backwards, when you make changes in the Component inspector, changes
will affect the Menu Editor immediatelly. Note: the CI will inspect content of the ME util you activate
another inspectable (such as the Form Editor). Similarly, when you activate
the ME again, the CI will forget the content of the Form editor and
show content of the ME again.
Connection to the Form Editor, understanding
multiple menus
The Menu Editor also can set a menu which is builded into target frame,
more specifically to the Form Editor frame window. Using this feature you
can watch exactly how your menu will look like. The Menu Editor is connected
with the Form Editor and every change you make in the Menu Editor is refrected
in the Form Editor frame's menu.
But there's one drawback: The form can have multiple menus attached. Which
one is currently active we can see from the value of form's property "Menu".
Value of this property is a name of the menu which is visible on the form
at the time. Note: You can see a menu you are building with the ME on the
form only and only if form's active menu equals your menu that you are
building.
It is quite legal to build menu which is not showed on the form. If
you don't want to know, how your menu looks like in its final form, simply
set form's "Menu" property to "<no menu>" value
and you're done. You can work with the Menu Editor as before and the Form
Editor frame will not be affected by changes.
Table of possible actions and their meanings
User action
What does it mean
Up/Down key arrow pressed
Moves the selection one entry up/down
Home/End keys pressed
Moves the selection to the first/last visible entry of the menu tree
Mouse clicked on the entry name
Clicked entry is selected
Command menu Edit/Edit or Enter key pressed
Starts editing of selected entry (switches into edit mode). When already
in edit mode, commits changes and switches back to view mode.
Command menu Edit/Escape or Esc key pressed
Escapes edit mode and abandon changes. Works only in edit mode (does
nothing when in view mode)
Commnad menu Edit/Toggle pull or Space key pressed or icon beside item's
name clicked
Opens folder if it has been closed, closes folder if it has been opened.
Does nothing if entry hasn't been the folder.
Command menu Creation/New menu or shortcut Ctrl+F pressed
New menu folder is inserted after currently selected entry if possible
Command menu Creation/New item or shortcut Ctrl+I pressed
New menu item is inserted after currently selected entry if possible
Command menu Creation/New separator or shortcut Ctrl+S pressed
New menu separator is inserted after currently selected entry if possible
Restrictions and limitations
The Menu editor tool has some restrictions and limitations. Let's explain
them.
folders cannot be empty - every time you will try to remove
last child of some folder, operation will fail
no way to insert new item as a first child of the folder - new
item or folder is always placed after currently selected one. User have
to workaround this limitation by renaming first child. This bug will be
fixed in future versions.
root entry cannot be deleted nor edited
root folder can contain only folders - this is a java AWT limitation.
Root menu folder cannot have plain items, but only folders.
moving with selection is disabled in edit mode - when in edit
mode, the Menu Editor disables functionality of movement keys (arrows,
Home, End) and also disables functionality of scrollbar
the Menu Editor can build only frame menus - menus which are
attached to the frame. Pop-up menu support is not done in current version
(it's not in java AWT 1.0.2 also).