menus.mc revision 1.4 1 /* $NetBSD: menus.mc,v 1.4 1998/06/25 09:58:58 phil Exp $ */
2
3 /*
4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved.
6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software develooped for the NetBSD Project by
20 * Piermont Information Systems Inc.
21 * 4. The name of Piermont Information Systems Inc. may not be used to endorse
22 * or promote products derived from this software without specific prior
23 * written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
29 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
35 * THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 */
38
39 {
40
41 /* Initial code for definitions and includes. */
42
43 }
44
45 default x=20, y=10;
46
47 error action { fprintf (stderr, "Testm: Could not initialize curses.\n");
48 exit(1); };
49
50 menu root, title " Main Menu of Test System";
51 option "Do nothing option",
52 action { }
53 ;
54 option "Try a sub menu",
55 sub menu submenu
56 ;
57 option "A scrollable menu",
58 sub menu scrollit
59 ;
60 option "Run a shell...",
61 action (endwin) { system ("/bin/sh"); }
62 ;
63 exit action (endwin) { printf ("Thanks for playing\n"); };
64 help {
65 Main Menu Help Screen
66
67 This is help text for the main menu of the menu test system. This
68 text should appear verbatim when asked for by use of the ? key by
69 the user. This should allow scrolling, if needed. If the first
70 character in the help is the newline (as the case for this help),
71 then that newline is not included in the help text.
72
73 Now this tests lines for scrolling:
74 10
75 11
76 12
77 13
78 14
79 15
80 16
81 17
82 18
83 19
84 20
85 21
86 22
87 23
88 24
89 25
90 26
91 27
92 28
93 29
94 30
95 31
96 32
97 33
98 34
99 35
100 36
101 37
102 38
103 39
104 40
105 41
106 42
107 43
108 44
109 45
110 46
111 47
112 48
113 49
114 50
115 51
116 52
117 53
118 54
119 55
120 56
121 57
122 58
123 59
124 60
125 61
126 62
127 63
128 64
129 65
130 66
131 67
132 68
133 69
134 70
135 71
136 72
137 73
138 74
139 75
140 76
141 77
142 78
143 79
144 80
145 };
146
147 menu submenu, title " submenu test";
148 option "upper right", sub menu upperright;
149 option "lower right", sub menu lowerleft;
150 option "middle, no title", sub menu middle;
151
152 menu upperright, title "upper right", y=2, x=60, no exit;
153 option "Just Exit!", exit;
154
155 menu lowerleft, title "lower left", y=20, x=2, no exit;
156 option "Just Exit!", exit;
157
158 menu middle, no box;
159 option "Just Exit!", exit;
160
161 menu scrollit, scrollable, h=4, title " Scrollable Menu";
162 option "option 1", action {};
163 option "option 2", action {};
164 option "option 3", action {};
165 option "option 4", action {};
166 option "option 5", action {};
167 option "option 6", action {};
168