Creating Menu Buttons

Menu buttons can either cause another menu page to be displayed or initiate execution of a V+ routine or AIM sequence.

To create a new button, display the menu page you want to create a button for and select:

Utilities -> Edit Menu -> New -> Menu Button or Spawn Rtn Button
or
Sequence Button

To edit an existing button, display the menu page the button is on and select:

Utilities -> Edit Menu -> double-click on button

Figure 8-3. Creating a Menu Button

Menu Button Options

1

Select the font number for the label on the button.

2

Indicate the conditional section you want associated with this button. Conditional sections are discussed in Creating a Conditional Section.

3

The upper left corner of the button is specified in the first two boxes. The width and height of the button are specified in the second two boxes.

4

 Enter the help search string associated with this item. When this item is selected and the F1 key is pressed, the help database associated with the menu page file will be searched for a record with this name. If a matching record is found, it will be displayed in the help window (see Custom Online Help).

5

 Enter the label you want to display with the button. In the "Relative position" data boxes, enter the position for this label relative to the upper left corner of the button. Double click on Aa|Aa (next to Text color) to display a pop-up menu showing you the text and background color options. If Opaque is selected, the label will look like the left "Aa", otherwise it will look like the right "Aa".

6

 If Menu page is selected, the menu page specified in "Page" from the file specified in "File" will be displayed. See Creating a Conditional Section for details on the primary database.

If Spawn Rtn is selected, the routine entered into Routine will be executed when the button is pressed. The argument specified in "Arg" will be passed to the routine (see AIM Menu Page Routines). See menu.but.spawn (arg, db.p, $cmd) for details on creating subroutine spawns. Since no operator input can be handled while the routine is executing, the routine should have a short duration or the AIM GUI will appear to be "hung". The commands shown in the table I/O Buffer Qualifiers for Menu Commands Without Parameters can be specified as the spawn routine. For example, if you specify "ky.exit", the menu page will be closed.

If a disk file name is specified in "File", it will be treated as an overlay subroutine and the disk file will be loaded before the program is called. The overlay file must follow the convention of having a header program with the same name as the disk file. For example, NEWPROG.OVR is the name of the header program for the disk file NEWPROG.OVR.

If Sequence is selected, the sequence entered in Sequence and Module will be executed. This must be a control sequence.

7

 Depending on which option is selected in item 6, these data boxes will request information on the menu page to be displayed, the routine to be executed, or the sequence to be executed.

8

If Sequence idle is selected, this button will be disabled when any runtime task is executing. (When this button is pressed during debug operation, a message indicating the operation is illegal will be displayed.)

If Disable if remote is selected, this button will be disabled when a remote front panel is enabled.

Access level indicates the user access level required before this button will be active. See the AIM Baseline User's Guide for details on assigning user access levels.

9

 If Top Level is selected, the menu page displayed by this button will be a top level window, all other windows will be closed before this window is displayed.

If Replace is selected, the menu page displayed by this button will replace the current page (the current window is closed when the new window is displayed).

If On Top is selected, the menu page displayed by this button will be displayed on top of the current menu page (the current window remains open behind the new window).

 

10

 If Icon is selected, the icon specified in "Icon name" will be displayed at the coordinates specified in item 3. The icon name must be one of the standard Adept icons, or one you have created using the EDITICON utility. Custom icons must be loaded to system memory before they are usable. (See the Instructions for Adept Utility Programs for details on creating custom icons. See ai.load.icon ($file, halt) for details on loading icon files. See CGM Editor Sections( ) for details on loading icons in a plug-in file.) The icon size is not affected by the dx, dy values (item 3). Icons are always displayed the same size as when they were created. The dx dy values do determine the area of the screen where mouse clicks will be interpreted as being aimed at the button.

If Panel is selected, the "Icon name" data box will disappear and the button will be displayed as the standard AIM menu button with the size and location specified in item 3.

If Transparent is selected, the button will be invisible. This allows you to generate your own graphics for a button.

 

Specifying Menu Page and Menu File Names in a Database

If field 3 of the primary database is a string array field named "menu page name", a menu button can extract the menu page name and file from this field in the primary database. To use this field: