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