Phedit Menu Editor


Introduction

The Phedit Menu Editor allows you to completely customize the menus used by Phedit. You do this by drawing the menus in this menu editor and saving them in a menu file. You then start up Phedit with the -u option, giving it the name of the menu file.

Example:

The following depicts what the menu editor would look like if you were already deeply into editing a moderately complex menu file.

introduction

Creating a New Menu File

If you have been working on a menu file make sure you save it before you create a new menu file. The editor will not warn you of this.

To create a new menu file go to the File menu and choose New.

An empty Working Menubar will appear in the Work Area. This empty Working Menubar where you will place your menubar items as you fill up your menu.

Opening a Menu File

If you are currently working on a menu make sure you save it before opening another one.

To open a menu file from the File menu choose Open Menu File ... The File Selector dialog will appear. Menu filenames typically end with .mnu. If your menu filename ends in something else change the pattern in the File Spec edit area.

Loading a Macro File

If you are going to be linking any menu items to macros then you must load the macro file that contains those macros. To do this go to the File menu and choose Load Macro File. This will cause the File Selector window to appear.

Reloading a Macro File

You may be working on a menu and decide that you need a new macro in your macro file. You then go into Phedit and create the new macro. If the macro file has already been loaded then you can reload it (ie; get the newer version) by going to the File menu and choosing Reload Macro File.

Setting Fonts

You can specify which fonts the text of the menus will use. To do this go to the Edit menu and choose Set Fonts ... You can specify different fonts for menubar items, submenu items and hotkeys.

Adding a Menu Item

To add an item to a menu you first click on the Add button. Move your mouse to the menu in the Work Area to which you wish to add an item. Whenever you are in add mode and your mouse pointer is in the Work Area your mouse pointer will appear as a cross.

Simply point to the part of the menu where you want the item to be added and click.

If you are adding the item to the Working Menubar then the Menubar Item Editor window will appear. Once you are done with the Menubar Item Editor window your item will have been added where you had asked for it to be put. Since it is an item on the Working Menubar you will see a plus sign to the left of the menu item's text. Clicking on this plus sign causes it to change into a minus sign and an empty submenu will appear. You would add more items to this submenu. Clicking on the minus sign causes the submenu to be closed.

If you are adding the item to a submenu then the Submenu Item Editor window will appear. Once you are done with the Submenu Item Editor window your item will have been added where you had asked for it to be put. If you indicated in the Submenu Item Editor dialog that the item was a Submenu item type then you will see a plus sign to the left of the item's text. Clicking on this plus sign causes it to change into a minus sign and an empty submenu will appear. You would add more items to this submenu. Clicking on the minus sign causes the submenu to be closed.

Changing a Menu Item

Click on the item you wish to change. It will be highlighted and the Change button will be enabled. Clicking on the Change button will bring up the appropriate window, either the Menubar Item Editor window or the Submenu Item Editor window.

Deleting a Menu Item

Click on the item you wish to delete. It will be highlighted and the Delete button will be enabled. If the item has a submenu then the submenu and any submenus below it will be deleted as well. The Menubar Item Editor window is used for adding and changing menubar items. It appears as follows.

menubareditor

The Submenu Item Editor window will vary depending on which Item Type you choose in the window. In the following sample under the Item Type in the top left corner of the window interior the Command toggle button has been selected so this is a command type item.

smecommand

The three item types are:
Item Type Decription
Command Use this type if you want a primitive or macro to be run whenever the user chooses this menu item.
Submenu Use this type to add a submenu. When the user chooses this item a submenu will appear.
Separator Use this type for a visual separation between items in your menu.

Command Item Type

Separator Item Type

Parameter Editor Window

The Parameter Editor window is only available for primitives that expect to be passed one or more parameters. A sample one appears as follows.

parameditor

The white area is a list of the parameters for which you must provide values. There are currently only two types of parameters:
Type Expected Format for the Value
int This should be a number with no decimal places.
string This should be a string of characters surrounded by double quotes.
To edit a parameter you must first select it from the list. A selected parameter is highlighted with a black background. When you select a parameter if it already has a value then the value will appear in the Value: field below the list.

Edit the Value: field that appears below the list until it contains the value you want to be passed for that parameter whenever the menu item is selected. In the sample above, whenever the Run Shell Window menu item is chosen the RunProgram() primitive will be run in the following way:

The effect of this will be to have a pterm window appear with a shell prompt in it.

Once the Value: field contains what you want it to contain you must then click on Apply Edits for it to be reflected in the list.

Only once the list contains all the values that you want then you can click on Done to return to the Submenu Item Editor window.