home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
proglc
/
scrn.lzh
/
SCRN_MAN.DOC
< prev
next >
Wrap
Text File
|
1987-10-15
|
12KB
|
219 lines
SCREEN-MAN Ver 1.0LS
(C) Copyright Daniel Burke Associates 1987
2 Cole Road, Haydenville, MA. 01039
Compuserve ID 71036,157
I. INTRODUCTION
SCREEN-MAN is a screen managment program which allows C language
programmers to quickly and easily display screens and accept input on
IBM PC's and compatibles. This document will explain how to create
and display screens. SCREEN-MAN differs from other screen management
packages in that it is a very powerful but extremely easy to use
tool. Just link with the SCREEN-MAN library and pass the name of
your screen to a SCREEN-MAN routine. This documentation will cover
the main features of SCREEN-MAN. Complete documentation is available
upon registration.
II. HOW TO CREATE A SCREEN
SCREEN-MAN requires a screen (slide) of character attribute pairs.
The best way to create such a slide is by using Dan Bricklin's Demo
program. Using demo, design your slide, position your fields,
prompts, titles, etc. Any field with the attribute of yellow on blue
( yellow foreground and blue background ) will be considered an input
field by SCREEN-MAN. You can specify the data type of an input field
by placing a character in the first position of the field. The
currently supported data types are discussed below. When the slide
is displayed by your application, SCREEN-MAN routines will accept
data for those yellow/blue fields. If using Demo, save the slide by
using the ESC, I/O, Print commands. On the print menu select:
Output to: Name the slide (e.g. slide1)
Character mapping: No Mapping
Output:
Text: Yes, Without CR/LF
Attributes: Interspersed
Everything else: No or None.
Make as many slides as you want: give each one a distinct name. When
you run your application, the slides must be in your current
directory.
III. DATA TYPES
Each input field on a slide you create must be given a data type. You
specify the data type by putting a one character id in the first
position of the field. Remember, any blue on yellow field is
considered an input field by SCREEN-MAN. The types currently
supported are listed below, including type name, character which you
place in the first position of the field to identify the type to
SCREEN-MAN, and a description of the type.
Name ID Description
Numeric: a Field will accept decimal digits (0 - 9) only.
ASCII: b All ASCII characters.
Alpha: c Alphabetic characters
Day: d Day of the month, 1 to 31
Month: e Month 1 to 12.
Year: f 2 digit year between 80 and 99.
Year4: g 4 digit year between 1900 and 1999
Second: h 0 to 59
Minute: i 0 to 69
Hour: j 0 to 23
E-YesNo k Enumerated Yes or No
E-Day l Enumerated Days of the week.
More types will be supported in the next version of SCREEN-MAN. In
addition, you will be able to easily define your own types. As noted
above, each field on a slide corresponds to a member of a data-values
structure which is passed as an argument to the routine fullscrn.
The members corresponding to the types Numeric, ASCII, and Alpha are
character arrays and can be initialized with strings (see example
below). Structure members corrresponding to all other types can be
initialized with ints. Most are obvious: initializing a field of
type Day to 13 will cause the value 13 to be displayed in that field
when the slide is first displayed. You can initailize all members to
NULL, in which case all fields will be blank when the slide is first
displayed. If your structure is static and unitialized, it will be
all NULL.
The enumerated types deserve special mention. The corresponding
structure member can be initialized as an int between 0 and 9. When
the user moves to an enumerated type field, a window pops up listing
the possible values for that field, e.g. Yes and No, along with the
Function keys to use to select one of the possible values.
Initializing the corresponding member to 0 causes the field to be
blank initially. Initializing the member to 1 causes the first
possible value to be displayed, 2 the second, etc. As the user
selects from the window of possible values the contents of the field
change. Currently two enumerated types are supported, Yes/No and the
days of the week. More will be added and the next version of
SCREEN-MAN will allow you to define your own enumerated types.
IV. HOW TO DISPLAY A SLIDE IN AN APPLICATION
You can display a slide at any point in your application by making the
call:
fullscrn( slide, datavals )
char *slide; /* the name of the slide you have created */
char *datavals; /* address of struct with initial values */
(described below).
Fullscrn displays a full 24 by 80 slide. To display a smaller slide
call:
adjmenu( slide, datavals, top, bottom, left, right);
char *slide; /* name of the slide */
char *datavals; /* address of struct with initial values */
int top; /* top line of slide on screen */
int bottom; /* bottom line of slide on screen */
int left; /* left most column of slide on screen */
int right; /* right most column of slide on screen */
The slide must be in the current directory. If you have created a
slide with no input fields, pass NULL for the datavals parameter.
V. HOW TO MAKE A STRUCTURE TO INITIALIZE INPUT FIELDS AND HOW TO GET
DATA BACK FROM A SLIDE
The second argument to fullscrn or adjmenu is a pointer to a
structure. This structure has one member for each input field on the
corresponding slide. The initial values of this structure are
displayed when the slide is first displayed. If the user changes any
field, the modified data is passed back to your application in the
structure. Structure members are either ints or character arrays,
depending on the type of the corresponding field. SCREEN-MAN
includes a utility to make these structures. If you run DBASTRUC,
passing it the name of your slide file, it will output a file with a
structure template that corresponds to your slide. For example, if
you have created a slide called myslide.txt, run "dbastruct
myslide.txt". The output will be a file called myslide.dba that
looks something like this:
struct myslide
{
char var0[19]; /* Row 0 Col 50 Ascii */
int var3; /* Row 7 Col 16 Day: 1 - 31 */
int var4; /* Row 8 Col 16 Month: 1 - 12 */
int var5; /* Row 9 Col 16 Year: 86 - 99 */
int var7; /* Row 11 Col 16 Minute: 0 - 59 */
int var8; /* Row 14 Col 61 Minute: 0 - 59 */
int var9; /* Row 15 Col 61 Hour: 0 - 23 */
char var10[13]; /* Row 16 Col 64 Ascii decimal*/
int var11; /* Row 24 Col 29 Enumerated Yes-No Field */
};
Read this file into your source file, create a structure of this type,
initialize the members ( all uninitialized ints should be set to 0,
and all character arrays should be NULL terminated; this will be true
if your structure is static), and pass a pointer to this structure to
fullscrn or adjmenu. If your slide has no input fields, pass a NULL
pointer. That's all there is to it. When your application returns
from the call to fullscrn or adjmenu, data for any fields the user
filled in will be in the corresponding members of the structure.
VI. MOVING FROM FIELD TO FIELD IN A SLIDE; MOVING WITHIN A FIELD;
SAVING DATA A USER ENTERS INTO FIELDS OF A SLIDE
When your application displays a SCREEN-MAN slide, you can use various
keys to move among the fields of the slide.
TAB takes you to the next field.
BACK TAB takes you to the previous field.
UP ARROW takes you to the next field above the currrent field
that starts in the same column as the current field.
DOWN ARROW is like UP ARROW, except it takes you down.
ENTER takes you to the next field.
Within a field you can use these keystrokes:
INSERT toggles you between insert and overstrike modes within a
field.
DEL deletes the character at the cursor position.
RIGHT ARROW moves the cursor right.
LEFT ARROW moves the cursor left.
BACKSPACE is destructive backspace within a field.
And to leave a slide:
ESC and F10 exit the slide and return to the routine that called
fullscrn or adjmenu. Any fields the user changed are saved in
the corrsponding members of the data values structure. It is
suggested that an F10 return indicate that the user has entered
valid data and an ESC return indicate an abort, i.e. that
modified data in the data values structure be discarded.
VII. ETC.
Version 1.0LS of the SCREEN-MAN library has been compiled with Lattice
3.1 for the small model. Libraries for Lattice C, all other models,
are available upon registration if requested. Libraries for
Microsoft 4.0 are also available. Versions for other popular
compilers will follow shortly. The current version runs on CGA and
EGA systems. Support for mono will be available by October 20. DBA
Software encourages your comments and suggestions. We will attempt
to make any additions or enhancements to SCREEN-MAN you may request.
The registration fee is $25.00 for which you will receive complete
documentation, all updates for one year at no additional cost other
than shipping and handling, and phone support. The complete
documentation includes extensive examples, descriptions of many more
DBA screen functions included in the SCREEN-MAN library, such as
window functions and error reporting functions, information on adding
your own types, and more. To register, please send your check for
$25.00 to DBA Software at the above address. You will receive a disk
with documentation and libraries for the compilers and models you
request.
VIII. FILES.
The files on this disk are:
DBA_DEMO.EXE - A short demo of SCREEN-MAN.
DBA_0.TXT, DBA_1.TXT, and DBA_2.TXT are ouptput from DAN Bricklin's
Demo program. Running DBASTRUCT on a .TXT file produces the
corresponding .DBA file.
DBA_1.DBA AND DBA_2.DBA are files containing structures corresponding
to the slides. Since DBA_0.TXT has no input fields, it has no
structure associated with it and therefore has no .DBA file.
DBA_DEMO.C is the source file which displays the slides. Use this as
an example of how to create your structures and call SCREEN-MAN
functions.
DBA_DEMO.LNK is an example link file, in Plink86 format.
SCRN_MAN.LIB is the Lattice Small model library of all SCREEN-MAN
functions. Include this library in your link before Lattice
libraries.
IX. DISCLAIMER
For obvious reasons the user is totally responsible for use of
this program and determining that it is suitable for his/her use,
and she/he uses this program with no warranty.