root/trunk/txt/txtwin.c

Revision 12, 94.7 kB (checked in by jvw, 3 years ago)

Updated to match changed library interfaces

Line 
1//
2//                     TxWin, Textmode Windowing Library
3//
4//   Original code Copyright (c) 1995-2005 Fsys Software and Jan van Wijk
5//
6// ==========================================================================
7//
8// This file contains Original Code and/or Modifications of Original Code as
9// defined in and that are subject to the GNU Lesser General Public License.
10// You may not use this file except in compliance with the License.
11// BY USING THIS FILE YOU AGREE TO ALL TERMS AND CONDITIONS OF THE LICENSE.
12// A copy of the License is provided with the Original Code and Modifications,
13// and is also available at http://www.dfsee.com/txwin/lgpl.htm
14//
15// This library is free software; you can redistribute it and/or modify
16// it under the terms of the GNU Lesser General Public License as published
17// by the Free Software Foundation; either version 2.1 of the License,
18// or (at your option) any later version.
19//
20// This library is distributed in the hope that it will be useful,
21// but WITHOUT ANY WARRANTY; without even the implied warranty of
22// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23// See the GNU Lesser General Public License for more details.
24//
25// You should have received a copy of the GNU Lesser General Public License
26// along with this library; (lgpl.htm) if not, write to the Free Software
27// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28//
29// Questions on TxWin licensing can be directed to: txwin@fsys.nl
30//
31// ==========================================================================
32//
33// TXTst windowed user interface
34//
35// Author: J. van Wijk
36//
37// 1.00 08-07-2003    Initial version, derived from dfswin.c and tptest.c
38
39#include <txlib.h>                              // TX library interface
40
41#include <txtver.h>                             // TXT version info
42#include <txt.h>                                // command executor
43#include <txtwin.h>                             // windowed entry point
44
45#define TXT_SCROLL_L   9999                     // total  5 Mb
46#define TXT_SCROLL_W    250
47
48// minimum scroll-buffer for memory constrained environments (mainly DOS)
49#define TXT_SMALLB_L   5000                     // total  1 Mb
50#define TXT_SMALLB_W    100
51
52#define TXT_WID_ENTRY      201                  // window id entry-field
53#define TXT_WID_SCROLL     202                  // window id scroll-buffer
54
55#define TXT_H_APPLIC       100                  // help ID TXTst application
56#define TXT_H_INTERF       101                  // help ID TXTst interface
57
58
59#define TXT_HIST_SIZE       96
60#define TXT_HIST_LINE  TXMAXLN
61
62static TXLN        entryftxt = "";
63static TXHIST      cmd_history;                 // history buffer info
64
65static TXWINDOW    entryfwin;
66static TXWINDOW    scrbuffwin;
67static TXWINDOW    desktopwin;
68
69static TXWHANDLE   desktop = 0;
70static TXWHANDLE   sbufwin = 0;
71static TXWHANDLE   entrwin = 0;
72
73static TXSBDATA    scrollBufData =
74{
75   20,
76   80,
77   60,
78   0,
79   FALSE,                                       // no scrolling when in middle
80   TRUE,                                        // wrap on write on long lines
81   0,
82   NULL
83};
84
85
86static  char       *mainwinhelp[] =
87{
88   "",
89   "#100 TXTst application and desktop window",
90   "",
91   " Note: To get help on the TxWindows userinterface, press <F1> again",
92   "",
93   " This is the built in help text for the TXTst application.",
94   "",
95   " It lists (function) key assignments specific to TXTst, the generic",
96   " assignments are listed with the TxWindows help information (F1).",
97   "",
98   "       F3         Quit TXTest completely",
99   "       F4         Save current screen-buffer to a file (txtest.log)",
100   "       F5         Start generic test dialog",
101   "       F6         Show a simple message-box",
102   "       F7         Present an input dialog",
103   "       F8         Start test dialog for a selection list",
104   "       F10        Activate the MenuBar with pulldown menus",
105   "       F11        Execute command 'about' TXTst version information",
106   "",
107   " On large screens (> 80x25), the desktop will have a visible border",
108   " around it. This can also be forced using program switches as follows:",
109   "",
110   "    -f         = force a desktop frame border to be used",
111   "    -f:yes     = force a desktop frame",
112   "    -f-        = Do NOT use a frame border around the desktop",
113   "",
114   "",
115   "  For help on commands, use '?' in the entry-field or select the",
116   "  'application command help' from the menu and for more detailed",
117   "  information and examples see the TXTst documentation",
118   "",
119   "", "", "", "", "", "", "", "", "", "", "", "",
120   "",
121   "#101 Command entry field and output text window",
122   "",
123   " Note: To get more generic help on TXTst, press <F1>",
124   "",
125   " T H E   C O M M A N D   E N T R Y   F I E L D",
126   " =============================================",
127   "",
128   " This is the (normally green) field at the bottom of the TXTst screen.",
129   "",
130   " Commands can be typed here, and will be processed by the TXTst",
131   " application when <Enter> is pressed.",
132   "",
133   " The syntax of a (multiple) TXTst command is:",
134   "",
135   "    cmd1 [-options | parameters]#cmd2 [-options | parameters]#cmd3 ...",
136   "",
137   " Where the '#' is the separator character (adjustable with '-s' switch)",
138   " that is used to execute multiple commands as used a lot from scripts.",
139   "",
140   " In interactive mode you normally execute a single command at a time.",
141   "",
142   " Options are recognized by the first character after any space being",
143   " a '-' and are case sensitive, so '-r' and '-R' are different!",
144   " Options may appear at any place in the command (free format)",
145   "",
146   " Options can have a numeric or string value, the string part can use",
147   " single or double quotes to allow embedded spaces in them. Explicit",
148   " values, when given, must be specified directly after the semicolon",
149   "",
150   " Some examples of valid option syntax are:",
151   "",
152   "    '-r'     or '-refresh'   or '-r+'        refresh option, value YES",
153   "    '-r:no'  or '-refresh:0' or '-r-'        refresh option, value NO",
154   "    '-s:256' or '-size:0xff' or '-s:33,c'    size option variants",
155   "    '-i:WIN2000' or '-iba:\"eCS GA\"'          for a setboot option ",
156   "",
157   " All parts of the command that are not options, are command parameters",
158   " They too can use single or double quotes to allow embedded spaces.",
159   "",
160   " For more details and specific command-options see: DFSCMDS/TXT and",
161   " the usage descriptions for some commands like 'find' and 'create'.",
162   "",
163   "",
164   " After completing the command it will be saved in the historybuffer.",
165   " Older commands can be retrieved from this buffer by using the UP",
166   " and DOWN keys and <Alt> + [ or <Alt> + ] (completion)",
167   "",
168   " For very long commands, that do not fit in the visible part of the",
169   " entryfield, the contents will be scrolled to the left so the last part",
170   " of the field where you are typing stays visible all the time.",
171   "",
172   " While the entryfield has the focus, the output from executed commands",
173   " that appears in the text output window above it, can be scrolled using",
174   " the PGUP, PGDN or the <Ctrl>+arrow keys",
175   "",
176   " For easier scrolling you can also change the focus to that window using",
177   " the <Tab> or <Shift>+<Tab> key, notice the DOUBLE window-lines after this",
178   "",
179   " Another <Tab>, <Shift>+<Tab> or <Esc> sets focus back to the entryfield",
180   "",
181   " As a convenience, the scroll-buffer will be scrolled to the end just",
182   " before executing any command, allowing you to see generated output,",
183   " even if you had scrolled up a few pages ...",
184   " For special cases this can be avoided by using <Ctrl>+<Enter>",
185   "",
186   " You can tell the entryfield has focus because the border-markers '[ ]'",
187   " will change color, and the cursor is blinking inside the entryfield.",
188   " You will notice that the text output window above it has a SINGLE line",
189   " border drawn around it to indicate it does NOT have focus.",
190   "",
191   " The following keys can be used to edit the entryfield:",
192   "",
193   "    Insert              Toggle between Insert and replace mode",
194   "    Delete              Delete the character at the cursor position",
195   "    Backspace           Delete the character before the cursor position",
196   "    Home                Move cursor to the start of the entryfield",
197   "    End                 Move cursor to the end of the entryfield",
198   "    Escape              Clear entry-field completely, making it empty",
199   "    Ctrl + Backspace    Clear entry-field completely (like Escape)",
200   "    Ctrl + B            Clear entry-field from cursor to begin-of-field",
201   "    Ctrl + E            Clear entry-field from cursor to end-of-field",
202   "    Ctrl + Right Arrow  Move one word to the right in the field",
203   "    Ctrl + Left  Arrow  Move one word to the left  in the field",
204   "    Up                  Recall previous (older)  command from history",
205   "    Down                Recall next     (newer)  command from history",
206   "    Alt  + \\            Show history contents, for recall/completion",
207   "    Alt  + [            Find previous match in history (completion)",
208   "    Alt  + ]            Find next     match in history (completion)",
209   "",
210   "    Other keys are either inserted/replaced in the entryfield content,",
211   "    like letters, digits and interpunction, or ignored",
212   "",
213   "      completion: All characters in the entryfield upto the cursor are",
214   "                  used in the partial-match. Use Alt + up/down to walk",
215   "                  through commands starting with the same characters",
216   "",
217   "",
218   "",
219   " T H E   O U T P U T   T E X T   W I N D O W",
220   " ===========================================",
221   "",
222   " This is the output window for all commands executed by TXTst.",
223   " It can contain many lines of output, of which normally only the",
224   " last screenfull is displayed.",
225   "",
226   " The screen can be scrolled up and down to view older output.",
227   "",
228   " For new output to cause automatic scrolling, the display must be at",
229   " the LAST line. You can use the <Ctrl>+<End> key to get there.",
230   " As a convenience, the scroll-buffer will automatically be scrolled to",
231   " the end just before executing any command using the <Enter> key",
232   "",
233   "",
234   " The following keys can be used:",
235   "",
236   "    Ctrl + PgUp/PgDn Scroll output window up/down by one page",
237   "    Ctrl + Home      Scroll up to first non-empty line in the buffer",
238   "    Ctrl + End       Scroll down to last, most current, output-line",
239   "    Ctrl + Arrows    Scroll one line/col in the direction of arrow",
240   "",
241   "    These work when the window has focus (DOUBLE line border) as well",
242   "    as when the focus is on the entryfield (SINGLE line border) or",
243   "    even when a (help) dialog is over the text output window.",
244   "",
245   "    PgUp and PgDn    Scoll output window when entryfield has focus",
246   "",
247   "    When the output window has focus, some more keys are available:",
248   "",
249   "    Left / Right  Scroll output window left/right to view long lines",
250   "    Up   / Down   Scroll output window up  / down line by line",
251   "    Home / End    Scroll output window to left/right margin",
252   "    Ctrl + -      Scroll up to first line of the buffer (usualy empty)",
253   "    Alt  + Arrows Move and/or resize the text output window",
254   "    F12           Collapse scroll-window to just the title-bar",
255   "    Alt  + F12    Cycle SCROLLBUFFER colors: NORMAL - BRIGHT - INVERT",
256   "",
257   "",
258   NULL
259};
260
261
262static  char       *confirmhelp[] =
263{
264   " No help available. (memory restriction)",
265   " This section contains help for all TXTst confirmation requests",
266   "",
267   "", "", "", "", "", "", "", "", "", "", "", "",
268   "",
269   "#001 Program bug, from menu selection",
270   "",
271   " This is to inform you that the menu item you have choosen is",
272   " not fully implemented yet. This is most likely a program bug,",
273   " but it could be a 'work in progress' if the TXTest version you",
274   " are using is a BETA or PREVIEW one ...",
275   "",
276   "", "", "", "", "", "", "", "", "", "", "", "",
277   "",
278   "#003 About the TXTst program",
279   "",
280   " This dialog informs you of the version of the TXTst program, and",
281   " some of the other components and tools used in building it.",
282   "",
283   " All rights reserved by Fsys Software for TXTst and TXlib, and by",
284   " the owners of the mentioned tools and components for the rest.",
285   "",
286   " Usage of 3rd party components and tools permitted by the licences",
287   " as found with the distribution or on the related web-site.",
288   "", "", "", "", "", "", "", "", "", "", "", "",
289   "",
290   "#004 TXTst version and operating-system mismatch",
291   "",
292   " This is to inform you that the TXTst version that is now active",
293   " is not optimal for the operating system detected, or that the",
294   " operating environment is not configured optimally.",
295   "",
296   " Use the recommended TXTest version or make changes to your",
297   " operating system configuration as instructed for the best",
298   " results and maximum reliability.",
299   "",
300   " If you want to take the risk and run the program anyway, select 'Yes'",
301   " in the dialog, otherwise select 'No' or use the <Esc> key to quit ...",
302   "",
303   "", "", "", "", "", "", "", "", "", "", "", "",
304   "",
305   NULL
306};
307
308
309static  char       *menusyshelp[] =
310{
311   "#010 Txt main menu",
312   "",
313   " The main menu for the application consists of a menu-bar with",
314   " several menu pull-downs.",
315   "",
316   "", "", "", "", "", "", "", "", "", "", "", "",
317   "",
318   "#030 Default menu pull-down",
319   "",
320   " The last pull-down used, will be the default selected one on",
321   " subsequent activation of the menu",
322   "",
323   "", "", "", "", "", "", "", "", "", "", "", "",
324   "",
325   "#100 File menu pulldown",
326   "",
327   " This menu contains all File related menu selections",
328   "",
329   "", "", "", "", "", "", "", "", "", "", "", "",
330   "",
331   "#110 Open logfile",
332   "",
333   " This will prompt for a filename to be used for the logfile",
334   " and open that file. All information that goes to the screen",
335   " will be appended to this file as well.",
336   "",
337   "", "", "", "", "", "", "", "", "", "", "", "",
338   "",
339   NULL
340};
341
342
343static  char       *dialoghelp[] =
344{
345   "",
346   " Built in help text for test dialog and its controls",
347   "",
348   "#001 Little text viewer",
349   "",
350   " This is the textviewer control that displays the command-help text",
351   " in a small window. The text can be scrolled in any direction.",
352   "",
353   " Using the <Alt> + arrow keys will move the whole dialog window.",
354   "",
355   "", "", "", "", "", "", "", "", "", "", "", "",
356   "",
357   "#011 entryfield nr 1",
358   "",
359   " This is the first entryfield in the dialog",
360   " Any text or number can be typed in here, on <Enter> the",
361   " contents of the field can be processed (currently disabled)",
362   " and it will be added to the entry-fields history for later",
363   " retrieval with the UP and DOWN keys.",
364   "",
365   " Using the <Alt> + arrow keys will move the whole dialog window.",
366   "",
367   "", "", "", "", "", "", "", "", "", "", "", "",
368   "",
369   "#012 entryfield nr 2",
370   "",
371   " This is the second entryfield in the dialog",
372   " Any text or number can be typed in here, on <Enter> the",
373   " contents of the field can be processed (currently disabled)",
374   " and it will be added to the entry-fields history for later",
375   " retrieval with the UP and DOWN keys.",
376   "",
377   "",
378   " Using the <Alt> + arrow keys will move the whole dialog window.",
379   "",
380   "", "", "", "", "", "", "", "", "", "", "", "",
381   "",
382   "#031 Dialog OK button",
383   "",
384   " This button ends the dialog, signalling an OK condition to the",
385   " calling application, so the dialog results can be processed",
386   "",
387   "", "", "", "", "", "", "", "", "", "", "", "",
388   "",
389   "#032 Dialog HELP button",
390   "",
391   " This is the HELP button for the dialog.",
392   "",
393   "", "", "", "", "", "", "", "", "", "", "", "",
394   "",
395   "#033 Dialog CANCEL button",
396   "",
397   " This button ends the dialog, signalling a CANCEL condition to the",
398   " calling application, so the dialog results must be discarded",
399   "",
400   "", "", "", "", "", "", "", "", "", "", "", "",
401   "",
402   "#051 Dialog specific push-button",
403   "",
404   " This is the test pushbutton in the dialog",
405   " Currently is also ends the dialog, using a specific result",
406   " code so the application can take the needed action.",
407   "",
408   "", "", "", "", "", "", "", "", "", "", "", "",
409   "",
410   "#061 Radio button nr 1",
411   "",
412   " This is the first Radio button in a set of three.",
413   " It can be toggled using the <Space> bar on the keyboard",
414   "",
415   "", "", "", "", "", "", "", "", "", "", "", "",
416   "",
417   "#062 Radio button nr 2",
418   "",
419   " This is the second Radio button in a set of three.",
420   " It can be toggled using the <Space> bar on the keyboard",
421   "",
422   "", "", "", "", "", "", "", "", "", "", "", "",
423   "",
424   "#063 Radio button nr 3",
425   "",
426   " This is the third Radio button in a set of three.",
427   " It can be toggled using the <Space> bar on the keyboard",
428   "",
429   "", "", "", "", "", "", "", "", "", "", "", "",
430   "",
431   "#071 Checkbox nr 1",
432   "",
433   " This is the first Checkbox in a set of three.",
434   " It can be toggled using the <Space> bar on the keyboard",
435   "",
436   "", "", "", "", "", "", "", "", "", "", "", "",
437   "",
438   "#072 Checkbox nr 2",
439   "",
440   " This is the second Checkbox in a set of three.",
441   " It can be toggled using the <Space> bar on the keyboard",
442   "",
443   "", "", "", "", "", "", "", "", "", "", "", "",
444   "",
445   "#073 Checkbox nr 3",
446   "",
447   " This is the third Checkbox in a set of three.",
448   " It can be toggled using the <Space> bar on the keyboard",
449   "",
450   "", "", "", "", "", "", "", "", "", "", "", "",
451   "",
452   "#101 Listbox nr 1",
453   "",
454   " This is the first ListBox, plain value selection.",
455   "",
456   "", "", "", "", "", "", "", "", "", "", "", "",
457   "",
458   "#102 Listbox nr 2",
459   "",
460   " This is the second ListBox, value drop-down.",
461   "",
462   "", "", "", "", "", "", "", "", "", "", "", "",
463   "",
464   "#103 Listbox nr 3",
465   "",
466   " This is the third ListBox, menu style single line.",
467   "",
468   "", "", "", "", "", "", "", "", "", "", "", "",
469   "",
470   NULL
471};
472
473
474static  TXTM bordertxt;                         // versioned window title
475
476static  char stattxt[] =
477   "F1=help F3=quit F4=save    F10=menu   F12=collapse  Esc=abort";
478
479
480// definitions for the test-dialog
481
482#define TXT_WID_DIALOG1   300                   // window id dialog1
483#define TXT_WID_D1TVIEW1  301                   // dialog1 text view 1
484#define TXT_WID_D1ENTRY1  311                   // dialog1 entry 1
485#define TXT_WID_D1ENTRYH  317                   // dialog1 entry Head
486#define TXT_WID_D1ENTRYS  318                   // dialog1 entry Sector
487#define TXT_WID_D1ENTRY2  312                   // dialog1 entry 1
488#define TXT_WID_D1BUTTN1  331                   // dialog1 button 1
489#define TXT_WID_D1BUTTN2  332                   // dialog1 button 2
490#define TXT_WID_D1BUTTN3  333                   // dialog1 button 3
491#define TXT_WID_D1STATIC  341                   // dialog1 static text
492#define TXT_WID_D1PUSHB1  351                   // dialog1 push button  1
493#define TXT_WID_D1RADIO1  361                   // dialog1 radio button 1
494#define TXT_WID_D1RADIO2  362                   // dialog1 radio button 2
495#define TXT_WID_D1RADIO3  363                   // dialog1 radio button 3
496#define TXT_WID_D1CHECK1  371                   // dialog1 check button 1
497#define TXT_WID_D1CHECK2  372                   // dialog1 check button 2
498#define TXT_WID_D1CHECK3  373                   // dialog1 check button 3
499
500#define TXT_WID_DIALOG2   400                   // window id dialog2
501#define TXT_WID_D2LIST1   401                   // dialog2 text list 1
502#define TXT_WID_D2LIST2   402                   // dialog2 text list 2
503#define TXT_WID_D2LIST3   403                   // dialog2 text list 3
504#define TXT_WID_D2LIST4   404                   // dialog2 text list 4
505#define TXT_WID_D2LIST5   405                   // dialog2 text list 5
506#define TXT_WID_D2LIST6   406                   // dialog2 text list 6
507#define TXT_WID_D2LIST7   407                   // dialog2 text list 7
508
509
510// to be refined, these variables should be local to the dialog
511// when reentrancy is an issue (otherwise stop F5=dialog from dialog)
512static TXWINDOW    d1frame1win;
513static TXWINDOW    d1tview1win;
514static TXWINDOW    d1entry1win;
515static TXWINDOW    d1entryHwin;
516static TXWINDOW    d1entrySwin;
517static TXWINDOW    d1entry2win;
518static TXWINDOW    d1buttn1win;
519static TXWINDOW    d1buttn2win;
520static TXWINDOW    d1buttn3win;
521static TXWINDOW    d1staticwin;
522static TXWINDOW    d1pushb1win;
523static TXWINDOW    d1radio1win;
524static TXWINDOW    d1radio2win;
525static TXWINDOW    d1radio3win;
526static TXWINDOW    d1check1win;
527static TXWINDOW    d1check2win;
528static TXWINDOW    d1check3win;
529
530static TXWHANDLE   d1frame1;
531static TXWHANDLE   d1tview1;
532static TXWHANDLE   d1entry1;
533static TXWHANDLE   d1entryH;
534static TXWHANDLE   d1entryS;
535static TXWHANDLE   d1entry2;
536static TXWHANDLE   d1buttn1;
537static TXWHANDLE   d1buttn2;
538static TXWHANDLE   d1buttn3;
539static TXWHANDLE   d1static;
540static TXWHANDLE   d1pushb1;
541static TXWHANDLE   d1radio1;
542static TXWHANDLE   d1radio2;
543static TXWHANDLE   d1radio3;
544static TXWHANDLE   d1check1;
545static TXWHANDLE   d1check2;
546static TXWHANDLE   d1check3;
547
548
549static TXLN        d1entry1txt = "";
550static TXLN        d1entryHtxt = "255";
551static TXLN        d1entryStxt = "63";
552static TXLN        d1entry2txt = "";
553
554static TXHIST      d1entry1his;
555static TXHIST      d1entry2his;
556
557static  char      *d1frame1txt[] =
558{
559   "",
560   "    ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿",
561   "    ³                                                     ³ ³               ³",
562   "    ³                                                     ³ ³               ³",
563   "    ³                                                     ³ ³               ³",
564   "    ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ³               ³",
565   "                                                            ³               ³",
566   "                                                            ³               ³",
567   "                                                            ³               ³",
568   "                                                            ³               ³",
569   "                                                            ³               ³",
570   "                                                            ³               ³",
571   "                                                            ³               ³",
572   "                                                            ³               ³",
573   "                                                            ³               ³",
574   "                                                            ³               ³",
575   "                                                            ³               ³",
576   "                                                            ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ",
577   NULL
578};
579
580static  char       d1buttn1txt[] = "OK";
581static  char       d1buttn2txt[] = "Help";
582static  char       d1buttn3txt[] = "Cancel";
583
584static  char      *d1statictxt[] =
585{
586   "Button styles",
587   "® test area ¯",
588   NULL
589};
590
591static  char       d1pushb1txt[] = "Push me";
592static  char       d1radio1txt[] = "Radio 1";
593static  char       d1radio2txt[] = "Radio 2";
594static  char       d1radio3txt[] = "Radio 3";
595static  char       d1check1txt[] = "Check 1";
596static  char       d1check2txt[] = "Check 2";
597static  char       d1check3txt[] = "Check 3";
598
599static  BOOL       d1radio1value = FALSE;
600static  BOOL       d1radio2value = TRUE;
601static  BOOL       d1radio3value = FALSE;
602static  BOOL       d1check1value = FALSE;
603static  BOOL       d1check2value = TRUE;
604static  BOOL       d1check3value = FALSE;
605
606static  char       txtMsgTitle[] = " Test Message box ";
607static  char       txtMsgText[]  =
608  "This is message text to test the txwMessageBox. It has some long lines that "
609  "need to be split by the Box and also some that are short enough already.\n"
610  "So let us see if that works, with an empty line:\n\nAnd a last one ...";
611
612static  char       txtPromptTitle[] = " Test Prompt box ";
613static  char       txtPromptText[]  =
614  "This is message text to test the txwPromptBox. Fill in any value ...";
615
616
617//- Definition of a static menu selection list for ListBox test-dialog
618TXSitem(tst1,2001,0,TXSF_MARKED    ,1,"First line in list"      ,"Descriptiption for line 1");
619TXSitem(tst2,2002,0,TXSF_MARKED    ,1,"2nd   line in list"      ,"Must be the second line");
620TXSitem(tst3,2003,0,0              ,1,"another line, and longer","says it all ...");
621TXSitem(tst4,2004,0,0              ,8,"shorty 4"                ,"four");
622TXSitem(tst5,2005,0,TXSF_DISABLED  ,8,"shorty 5"                ,"five");
623TXSitem(tst6,2006,0,0              ,8,"shorty 6"                ,"six");
624TXSitem(tst7,2007,0,TXSF_MARK_STD  ,1,"Last  line in list"      ,"You are at the last line now");
625static TXS_ITEM *tst[] = {&tst1, &tst2, &tst3, &tst4, &tst5, &tst6, &tst7};
626
627TXSlist(tstlist1,7,7,tst);
628TXSlist(tstlist2,7,3,tst);
629TXSlist(tstlist3,7,4,tst);
630
631
632//- Definition of static main-menu selection lists
633
634TXSitem(mmsp,0            ,0,TXSF_DISABLED | TXSF_SEPARATOR,     0,""    ,"");
635
636TXSitem(mm11,TXTC_OPEN    ,0,0             , 1,"Open logfile"              ,"Open a logfile for screen output");
637TXSitem(mm12,TXTC_SAVE    ,0,0             , 1,"Save screen   F4"          ,"Save screenbuffer to a file");
638TXSitem(mm13,TXTC_RUNS    ,0,0             , 1,"Run script"                ,"Run a TXTest script");
639TXSitem(mm14,TXTC_EXIT    ,0,0             , 2,"Exit      Alt-F4"          ,"Exit the TXTest program");
640static TXS_ITEM *mm1[] = {&mm11, &mm12, &mm13, &mmsp, &mm14};
641TXSlist(tstmm1,5,5,mm1);
642
643TXSitem(mm31,TXTC_DISPLAY ,0,0             , 1,"Display size"              ,"Show size of display screen");
644TXSitem(mm32,TXTC_VOLUMES ,0,0             , 1,"Volume list"               ,"Show list of disk volumes");
645TXSitem(mm33,TXTC_DIRALL  ,0,0             , 1,"Current directory"         ,"Show files and sub-directories in current directory");
646TXSitem(mm34,TXTC_DIRFILE ,0,0             , 1,"Files in current DIR"      ,"Show files-only in current directory");
647TXSitem(mm35,TXTC_DIRSUBS ,0,0             , 1,"Subdirs in current DIR"    ,"Show sub-directories only in current directory");
648TXSitem(mm36,TXTC_DIRTREE ,0,0             ,11,"Show all, recursive"       ,"Show all, including subdirectory contents (tree)");
649TXSitem(mm3a,TXTC_CHRSET  ,0,0             , 1,"Character set display"     ,"Show all 256 characters in defaultc character");
650TXSitem(mm3b,TXTC_BOXES   ,0,0             , 1,"Box line drawings"         ,"Draw several boxes using all CP-437 drawing characters");
651TXSitem(mm3c,TXTC_COLORR  ,0,0             , 1,"RAW colors display"        ,"Show 256 color combinations FG and BG, direct to screen");
652TXSitem(mm3d,TXTC_COLORS  ,0,0             , 0,"Display colors, buffer"    ,"Show 256 color combinations FG and BG, in scroll-buffer");
653static TXS_ITEM *mm3[] = {&mm31, &mm32, &mmsp,
654                          &mm33, &mm34, &mm35, &mm36, &mmsp,
655                          &mm3a, &mm3b, &mm3c, &mm3d};
656TXSlist(tstmm3,12,12,mm3);
657
658TXSsubm(s26s,TXTC_SCHEME  ,0,TXTB_SCHEME,0 , 1,"Select window color scheme ¯" ,"Select and activate any of the available window-color schemes              ");
659TXSitem(mm41,TXTC_INVSCR  ,0,0             , 1,"Inverted output-screen"       ,"Use inverted colors (black-on-white text) on the scrollable output screen  ");
660TXSitem(mm42,TXTC_BRTSCR  ,0,0             , 8,"Bright foreground-text"       ,"Use bright foreground colors only on the scrollable output screen          ");
661TXSitem(mm43,TXTC_B2BSCR  ,0,0             , 1,"Blue/Brown background"        ,"Use blue (or brown, inverted) background instead of classic black or white ");
662TXSitem(mm44,TXTC_ASCII7  ,0,0             , 5,"Use 7-bit ASCII only"         ,"Use 7-bit ASCII character only, avoid non-standard 'drawing chars'         ");
663TXSitem(mm45,TXTC_COLTXT  ,0,0             , 1,"ANSI colored texts"           ,"Use ANSI-like colored text string on the scrollable output screen          ");
664TXSitem(mm46,TXTC_AUTOMB  ,0,0             ,11,"Automatic menu activation"    ,"Automatically activate MenuBar after each menu-selection (F10 to exit menu)");
665TXSitem(mm47,TXTC_AUTODR  ,0,0             ,16,"Automatic menu Dropdown"      ,"Automatically open menu pulldown on selecting menu-heading in the MenuBar  ");
666static TXS_ITEM *mm4[] = {&s26s, &mmsp,
667