ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakc_5.4.0.1/rzakcmstmnubarc.htm

268 lines
15 KiB
HTML
Raw Permalink Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="reference" />
<meta name="DC.Title" content="MNUBARCHC (Menu-Bar Choice) keyword for display files" />
<meta name="abstract" content="Use this field-level keyword to define a choice for a menu-bar field." />
<meta name="description" content="Use this field-level keyword to define a choice for a menu-bar field." />
<meta name="DC.subject" content="MNUBARCHC (Menu-Bar Choice) keyword, Menu-Bar Choice (MNUBARCHC) keyword, menu-bar choice, creating" />
<meta name="keywords" content="MNUBARCHC (Menu-Bar Choice) keyword, Menu-Bar Choice (MNUBARCHC) keyword, menu-bar choice, creating" />
<meta name="DC.Relation" scheme="URI" content="rzakcmstkeyent.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2001, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzakcmstmnubarc" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>MNUBARCHC (Menu-Bar Choice) keyword for display files</title>
</head>
<body id="rzakcmstmnubarc"><a name="rzakcmstmnubarc"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">MNUBARCHC (Menu-Bar Choice) keyword for display files</h1>
<div><p>Use this field-level keyword to define a choice for a menu-bar
field.</p>
<div class="section"><p>A menu-bar choice represents a group of related actions that the
application user can select. A group of actions appears in a pull-down menu
when the user requests a menu-bar choice.</p>
<div class="p">The format of the keyword
is: <pre>MNUBARCHC(choice-number pull-down-record choice-text
[&amp;return-field])</pre>
</div>
<p>The choice-number parameter is required
and specifies an identification number. The choice number is returned to the
application to indicate which choice in the menu bar was selected. Valid values
for the choice number are integers 1 to 99. Duplicate values within a single
menu-bar field are not allowed.</p>
<p>The pull-down-record parameter is required
and specifies the name of the pull-down record that is displayed when the
user selects this choice. The record specified must exist within the file
and must contain a PULLDOWN keyword.</p>
<div class="p">The choice-text parameter is required
and defines the text that appears in the menu bar for the choice. The parameter
can be specified in one of two forms: <ul><li>As a character string: 'Choice text '</li>
<li>As a program-to-system field: &amp;field-name <p>The field-name specified
must exist in the menu bar record and must be defined as a character field
with usage P.</p>
</li>
</ul>
</div>
<p>The choice text must fit on one line of the display for the smallest
display size specified for the file. Because the text for the first menu-bar
choice on a line begins at position 3 and a trailing blank is always inserted
after the choice text, the maximum length of the choice text is 76 if the
smallest display size for the file is 24 x 80 and 128 if the smallest display
size for the file is 27 x 132.</p>
<p>When the choice text contained in the
character string or the program-to-system field is displayed, trailing blanks
in the text are truncated and 3 blank spaces are inserted between choices.
However, the number of lines that the menu-bar field occupies on the display
is determined by the sum of the lengths of the choice-text parameters, plus
3 blank spaces between each choice. The length of the choice-text is either
the length of the character string, excluding trailing blanks, or the length
of the program-to-system field. The maximum number of lines that a menu bar
field can occupy is 12 lines (this includes the separator line).</p>
<div class="p">Within
the choice text, you can specify a mnemonic for the choice by using a greater
than character (&gt;) to indicate the mnemonic character. The character to
the right of the &gt; is the mnemonic. Examples: <dl><dt><strong>Choice text</strong></dt>
<dd><strong>Appears as</strong></dd>
<dt class="dlterm">'&gt;File'</dt>
<dd><u>F</u>ile</dd>
<dt class="dlterm">'F&gt;inish'</dt>
<dd>F<u>i</u>nish</dd>
<dt class="dlterm">'Save &gt;As...'</dt>
<dd>Save <u>A</u>s...</dd>
<dt class="dlterm">'X &gt;= 1'</dt>
<dd>X <u>=</u> 1</dd>
</dl>
</div>
<div class="p">To specify a &gt; as a character in the text, you must
specify it twice, just as you must specify the apostrophe character twice
in order to get a single apostrophe character in the text. <dl><dt><strong>Choice text</strong></dt>
<dd><strong>Appears as</strong></dd>
<dt class="dlterm">'X &gt;&gt;= 1'</dt>
<dd>X &gt;= 1</dd>
<dt class="dlterm">'X &gt;&gt;&gt;= 1'</dt>
<dd>X &gt;<u>=</u> 1</dd>
</dl>
<div class="note"><span class="notetitle">Note:</span> It is not possible to specify the &gt; as the mnemonic
character.</div>
</div>
<p>The mnemonic character indicated must be a single-byte
character and must not be a blank. Only one mnemonic is allowed in the choice
text, and the same mnemonic character cannot be specified for more than one
choice.</p>
<p>The return-field parameter is optional and specifies whether
control is returned to the application because a menu bar choice was selected.
This parameter specifies the name of a hidden field in the menu-bar record
that contains the number of the choice selected when control is returned to
the application. The hidden field is defined as a data type Y (numeric), the
length of the field is two, and decimal positions are 0. The presence of a
choice number in this field indicates that control has been returned to the
application because a menu-bar choice was selected. The next operation of
the application updates (if necessary) and writes the pull-down record associated
with that choice; that is, the pull-down record specified on the MNUBARCHC
keyword for the choice. When a choice number is returned in this field, zero
is returned in the field that contains the choice number after pull-down input
has been received. Likewise, when pull-down input has been received, zero
is returned in this field, and the presence of a choice number in menu-bar
field or the choice field in the application record indicates that the application
should process the pull-down input.</p>
<p>The menu bar field contained in
the MNUBARCHC keywords is defined as an input-capable field with data type
Y (numeric). The length of the field is two and decimal positions 0. If the
menu bar record is read, the number of the choice selected (if any) is returned
in the menu-bar field. The menu-bar field must always be defined as starting
in row 1, column 2.</p>
<p>When MNUBARCHC is specified on a field, the MNUBAR
keyword is required at the record level.</p>
<p>Multiple MNUBARCHC keywords
can be specified for one menu bar field. The number of MNUBARCHC keywords
that can be specified is limited only by the lengths of the choice text parameters
(excluding trailing blanks in character string choice-text) and the 12 line
limit for a MNUBAR. All the choices defined for a menu bar field must fit
on the screen, allowing for 3 spaces between each choice.</p>
<p>The following
keywords can be specified on a field with the MNUBARCHC keyword:</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="void" border="0" rules="none"><tbody><tr><td valign="top" width="33.33333333333333%"><p>ALIAS<br />
CHCAVAIL<br />
CHCSLT</p>
</td>
<td valign="top" width="33.33333333333333%"><p>INDTXT<br />
MNUBARSEP<br />
TEXT</p>
</td>
<td valign="top" width="33.33333333333333%">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<p>Option indicators are valid for this keyword.</p>
</div>
<div class="section"><h4 class="sectiontitle">Examples</h4><p>The following examples show how to specify
the MNUBARCHC keyword.</p>
</div>
<div class="example"><h4 class="sectiontitle">Example 1</h4><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A DSPSIZ(*DS3 *DS4)
A R MENUBAR MNUBAR
A MNUFLD 2Y 0B 1 2
A MNUBARCHC(1 PULLFILE +
A '&gt;File ')
A 01 MNUBARCHC(2 PULLEDIT +
A '&gt;Edit ')
A MNUBARCHC(3 PULLVIEW +
A '&gt;View ')
A MNUBARCHC(4 PULLOPT +
A '&gt;Options ' &amp;RTNFLD);
A MNUBARCHC(5 PULLHELP +
A '&gt;Help ')
A RTNFLD 2Y 0H</pre>
<p>In this example, five
menu bar choices (File, Edit, View, Options and Help) are defined in a menu
bar. If option indicator 01 is on and the menu bar record is written before
the system displays it, the Edit choice is displayed when the system displays
the menu bar. If option indicator 01 is off or the menu-bar record is not
written before the system displays it, the Edit choice is not displayed. If
the Edit choice is not displayed, the list of choices are compressed and the
View choice will follow the File choice, with 3 blank spaces in between.</p>
<p>If
the File choice is selected, record PULLFILE is displayed as a pull-down menu
beneath the File choice. If the Options choice is selected, control is returned
to the application. The application can update the PULLOPT record before the
system displays it as a pull-down menu.</p>
<p>On displays capable of a single-character
underline, the mnemonic for each choice is the first character in the text.
If the menu-bar record is read, the menu-bar field MNUFLD contains the number
of the choice selected, or 0 if no choice was selected.</p>
<p>The text for
each choice has been specified as a character string, with 15 spaces available
for the text. However, the trailing blanks are removed before the system calculates
how many choices fit on a line. Therefore, the maximum space required for
the menu bar is 87 positions (28 for the text within the character strings,
plus 3 spaces between each choice). The menu-bar choices occupy one line.
The menu-bar separator occupies one more line; therefore the entire menu bar
occupies two lines.</p>
</div>
<div class="example"><h4 class="sectiontitle">Example 2</h4><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A DSPSIZ(*DS3 *DS4)
A R MENUBAR MNUBAR
A MNUFLD 2Y 0B 1 2
A MNUBARCHC(1 PULLFILE +
A &amp;FILETXT);
A 01 MNUBARCHC(2 PULLEDIT +
A &amp;EDITTXT);
A MNUBARCHC(3 PULLVIEW +
A &amp;VIEWTXT);
A MNUBARCHC(4 PULLOPT +
A &amp;OPTTXT &amp;RTNFLD);
A MNUBARCHC(5 PULLHELP +
A &amp;HELPTXT);
A FILETXT 15A P
A EDITTXT 15A P
A VIEWTXT 15A P
A OPTTXT 15A P
A HELPTXT 15A P
A RTNFLD 2Y 0H
A</pre>
<p>This example is the same as example 1, except that the
choice text has been specified using program-to-system fields.</p>
<p>At run
time, the choice text to be displayed for each choice is retrieved from the
program-to-system fields. Any mnemonics must be specified in the text supplied
by the application at run time. As in example 1 when the menu-bar record is
read, the menu-bar field MNUFLD contains the number of the choice selected,
or 0 if no choice was selected.</p>
<p>As in example 1, the number of spaces
available for the text for each choice is 15. The maximum space required for
the menu bar is 78 positions (15 possible text positions for each of the 5
choices plus 3 spaces between choices). Because the smallest display size
is 24x80 (*DS3), the menu-bar choices occupy 2 lines. The menu-bar separator
occupies one more line, so the entire menu bar occupies 3 lines. However,
the actual number of lines that is used to display the choices depends on
the text that is contained in the program-to-system fields. When the menu
bar is displayed, the trailing blanks in the P-fields are truncated, and 3
blanks are inserted between each choice.</p>
</div>
<div class="example"><h4 class="sectiontitle">Example 3</h4><pre>|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R MENUBAR MNUBAR
A MNUFLD 2Y 0B 1 2
A MNUBARCHC(1 PULLFILE +
A '&gt;File ')
A MNUBARCHC(2 PULLEDIT +
A '&gt;Edit ' &amp;RTNFLD);
A RTNFLD 2Y 0H</pre>
<p>In this example, if choice
2 in the menu bar is selected, control is returned to the application and
field RTNFLD contains the number 2. Field MNUFLD contains 0, indicating no
pull-down input received. The application must read record MENUBAR in order
to get the contents of field RTNFLD. The application must then write record
PULLEDIT. The system resumes control of the menu-bar interaction. If input
is then entered in record PULLEDIT, control is returned to the application,
and field MNUFLD contains number 2. Field RTNFLD contains 0, indicating control
has been returned because pull-down input was received.</p>
<p>If choice 1
is selected, the system displays pull-down record PULLFILE. If input is entered
in PULLFILE, control is returned to the application, and field MNUFLD contains
number 1. Field RTNFLD contains 0, indicating control has been returned because
pull-down input was received.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakcmstkeyent.htm" title="You type the keyword entries that define display files in positions 45 through 80 (functions).">DDS keyword entries for display files (positions 45 through 80)</a></div>
</div>
</div>
</body>
</html>