1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #include <dos.h>
22 #include "wstdefs.h"
23 #include "wstglob.h"
24
25 char *general_help_lines[] = {
26 "-------------------------- WSTERM FUNCTIONS ----------------------------------",
27 "ALT-0 Send an ASCII NUL | ALT-D Display pending foreground",
28 "ALT-B Send a break to host | message",
29 "^BREAK Send a break if /B control | ALT-H Enter help screen",
30 " argument specified | ALT-M Enter background screen",
31 "ALT-C Clear the display | ALT-Q Exit (quit) wsterm",
32 " | ALT-S No scroll (any key resumes)",
33 "",
34 "",
35 "------------------------- WSTERM MODES (toggles) -----------------------------",
36 "ALT-I,<INS> keyboard insert/replace -| ALT-E edit mode ON/OFF",
37 " (in edit mode only) | ALT-O local paging ON/OFF",
38 "ALT-F file audit ON/OFF | ALT-P line printer audit ON/OFF",
39 "",
40 "",
41 "",
42
43 "-------------------------------- EDIT MODE -----------------------------------",
44 "A variety of editing and history functions are available in edit mode. While",
45 "in edit mode, all keyboard input is buffered and echoed, allowing various",
46 "editing to take place until the <RETURN> key is hit, sending the line to the",
47 "host. Note that before the attach_mowse/atm command is invoked, the host",
48 "also echoes input, resulting in a \"double echo\". Thus it may be desirable",
49 "to turn off echoing by the host (e.g. stty -modes ^echoplex) in this case.",
50 "",
51 "---------------------- Edit Mode cursor movement keys ------------------------",
52 "^A,<HOME> cursor to beginning of line| ^E,<END> move cursor to end of line",
53 "^F,-> move cursor forward a char | ^B,-> move cursor backward a char",
54 "^->,esc F move cursor forward a word | ^<-,esc B move cursor backward a word",
55 "",
56 "-------------------------- Edit Mode editing keys ----------------------------",
57 "Backspace erase (previous char) | @ kill (to beginning of line)",
58 "<DEL> delete previous char | esc <DEL> delete to previous word",
59 "^D delete current char | esc D delete to end of word",
60 "^K kill to end of line | \\ literal escape character",
61 "",
62 "* cursor movement and edit keys may be repeated N times by entering",
63 " <ESC> N before the key. N is some unsigned integer value.",
64 "",
65 "----------------------- Edit Mode History Functions --------------------------",
66 "ALT-V enter history screen | ^P recall previous command",
67 "NN ^P select the NNth previous | ^N recall the next command",
68 " command",
69 "",
70 "",
71 "",
72 "",
73 "",
74 "",
75 "----------------------------- Status Line ------------------------------------",
76 "The bottom line of the screen is the status line. It is displayed in reverse",
77 "video and is used to display local messages to the user. In the foreground",
78 "screen, WSTERM's current mode settings are displayed as follows:",
79 "",
80 "G Edit Replace Audit(FILE,PRINTER) Page No-Scroll [background] [foreground]",
81 "1 2 3 4 5 6 7 8",
82 "",
83 "1) G=Glass tty (before atm); A=Async (after atm); S=Sync (atm & video)",
84 "2) Edit=Edit mode enabled; <BLANK>=Edit mode disabled",
85 "3) Replace=text overstrikes; Insert=text inserts; <BLANK>=not in Edit mode",
86 "4) <BLANK>=No audit; Audit(FILE)=File audit; Audit(PRINTER)=Printer audit;",
87 " Audit(FILE,PRINTER)=File and Printer audit",
88 "5) Page=local paging after atm; <BLANK>=no local page after atm",
89 "6) <BLANK>=scrolling; No-Scroll=local stopping of scrolling",
90 "7) <BLANK>-no background messages; [background]=background message(s) pending,",
91 " enter background screen to examine messages.",
92 "8) <BLANK>-no foreground messages; [foreground]=foreground message(s) pending",
93 " while entering input, hit ALT-D to display message, then resume input",
94 "",
95 "Note: The status line is also used to temporarily display error messages.",
96 " Status line information is also different in other screens. See help",
97 " for other screens."
98 };
99
100
101 #define N_GENERAL_HELP_LINES (sizeof(general_help_lines)/sizeof(char *))
102
103 char *bg_help_lines[] = {
104 "----------------------------BACKGROUND SCREEN---------------------------------",
105 "This screen displays the number of pending background messages and displays",
106 "the next background message whenever <ALT-M> or <ALT-D> is hit. The user",
107 "may also enter this screen just to look at background messages which were",
108 "previously displayed but have not been scrolled off.",
109 "",
110 " ALT-M,ALT-D - display next background messages if it exists",
111 " Q - quit from background screen",
112 " P - enter background polling mode",
113 "",
114 "----------------------------BACKGROUND POLLING--------------------------------",
115 "This screen displays all pending background messages and sits in a polling",
116 "loop, displaying any background message whenever it is received.",
117 "",
118 " Q - quit from background screen",
119 " <other> - toggle between scroll and no scroll",
120 "",
121 "-------------------- Replying to background query messages -------------------",
122 "When the message \"Enter Reply:\" appears on the status line, the most recent",
123 "background message displayed is a background query message. Any text until",
124 "a <RETURN> is hit will then be sent as a reply to this query.",
125 "",
126 "NOTE: Acceptable keys are listed between \"[\" and \"]\" on the status line"
127 };
128
129
130 #define N_BG_HELP_LINES (sizeof(bg_help_lines)/sizeof(char *))
131
132 char *history_help_lines[] = {
133 "---------------- HISTORY SCREEN FUNCTIONS (in edit mode only) ----------------",
134 "This screen allows previously entered lines of input to be examined and/or",
135 "selected. Selecting an input line copies that line as current input, just",
136 "as if entered from the keyboard. Further editing may take place before",
137 "sending the line to the host by hitting the <RETURN> key.",
138 "",
139 " NN <RETURN> - exit the history screen and select the specified history",
140 " line (beeps if invalid selection)",
141 " NN <L> - shift screen left NN columns; NN defaults to 1",
142 " NN <R> - shift screen right NN columns; NN defaults to 1",
143 " <P> - display previous history page (beeps if no previous page)",
144 " <N> - display next history page (beeps if no next page)",
145 " <Q> - quit from the history screen",
146 "",
147 "",
148 "NOTE 1: NN refers to an unsigned integer value and is specified by entering",
149 " any of the digit keys (0 thru 9).",
150 "NOTE 2: The status line will display the current screen offset.",
151 "NOTE 3: Recognized command keys are listed between \"[\" and \"]\" on the",
152 " status line."
153 };
154
155 #define N_HISTORY_HELP_LINES (sizeof(history_help_lines)/sizeof(char *))
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185 help(order)
186 int order;
187 {
188 int i;
189 int cnt;
190 int ch;
191 char **hlp[N_HELP_TOPICS];
192 int hlp_cnt[N_HELP_TOPICS];
193 int help_index;
194
195
196 if (order == BG_HELP) {
197 hlp[FIRST_TOPIC_INDEX] = bg_help_lines;
198 hlp_cnt[FIRST_TOPIC_INDEX] = N_BG_HELP_LINES;
199 hlp[SECOND_TOPIC_INDEX] = general_help_lines;
200 hlp_cnt[SECOND_TOPIC_INDEX] = N_GENERAL_HELP_LINES;
201 hlp[THIRD_TOPIC_INDEX] = history_help_lines;
202 hlp_cnt[THIRD_TOPIC_INDEX] = N_HISTORY_HELP_LINES;
203 }
204
205 else if (order == HISTORY_HELP) {
206 hlp[FIRST_TOPIC_INDEX] = history_help_lines;
207 hlp_cnt[FIRST_TOPIC_INDEX] = N_HISTORY_HELP_LINES;
208 hlp[SECOND_TOPIC_INDEX] = general_help_lines;
209 hlp_cnt[SECOND_TOPIC_INDEX] = N_GENERAL_HELP_LINES;
210 hlp[THIRD_TOPIC_INDEX] = bg_help_lines;
211 hlp_cnt[THIRD_TOPIC_INDEX] = N_BG_HELP_LINES;
212 }
213
214 else {
215 hlp[FIRST_TOPIC_INDEX] = general_help_lines;
216 hlp_cnt[FIRST_TOPIC_INDEX] = N_GENERAL_HELP_LINES;
217 hlp[SECOND_TOPIC_INDEX] = bg_help_lines;
218 hlp_cnt[SECOND_TOPIC_INDEX] = N_BG_HELP_LINES;
219 hlp[THIRD_TOPIC_INDEX] = history_help_lines;
220 hlp_cnt[THIRD_TOPIC_INDEX] = N_HISTORY_HELP_LINES;
221 }
222
223
224 save_wst_screen(&wst_tmp_screen);
225
226
227 cursor_move(HIDE_CURSOR_ROW,HIDE_CURSOR_COL);
228
229
230 ch = 0;
231 i = 0;
232 cnt = 0;
233
234
235 help_index = 0;
236
237
238 wst_screen_clear(&wst_help_screen);
239
240 while (TRUE) {
241 if (help_index >= LAST_HELP_TOPIC_INDEX && i >= hlp_cnt[help_index])
242 break;
243
244
245 if (cnt >= N_HELP_PAGE_LINES || i >= hlp_cnt[help_index]) {
246
247
248 restore_wst_screen(&wst_help_screen);
249
250
251 cursor_move(HIDE_CURSOR_ROW,HIDE_CURSOR_COL);
252
253
254 status_line("HELP SCREEN: <q> - quit, <any other> - next");
255
256
257 ch = getkey(BLOCK);
258 if (uppercase(ch) == 'Q')
259 break;
260
261
262 cnt = 0;
263 wst_screen_clear(&wst_help_screen);
264
265 if (i >= hlp_cnt[help_index]) {
266 help_index++;
267 i = 0;
268 if (help_index > LAST_HELP_TOPIC_INDEX) break;
269 }
270 }
271
272
273 wst_screen_printline(&wst_help_screen,hlp[help_index][i]);
274 i++;
275 cnt++;
276 }
277
278
279 if (uppercase(ch) != 'Q') {
280
281
282 restore_wst_screen(&wst_help_screen);
283
284
285 cursor_move(HIDE_CURSOR_ROW,HIDE_CURSOR_COL);
286
287
288 status_line("HELP SCREEN: <any key> - quit");
289 wait_for_key();
290 }
291
292
293 restore_wst_screen(&wst_tmp_screen);
294 }