Shell Curses -- version 1.11
----------------------------

In this distribution, a generic menuing/database system is provided and
has been tested under AIX, HPUX, SCO, and NCR SVR4.  This menuing system
can be copied and modified to perform a variety of functions.  The demo
provided with this distribution is the user interface to a UUCP
communications control system.  Other implementations of the shell
script curses include a shell program generator, time and journal log,
printer/form control system, and a satellite printing system.

The provided demo requires the ability to use file name lengths greater
than 14 characters.  The reason for this requirement is that the
concepts in the demo will be rolled into a larger development project,
which will become an Object Oriented Shell ( "oosh" or maybe "sh++" ).

For documentation on the menuing system, see the readme file in the
"demo" directory.

If you have any problems or questions, please contact me at:

Dana French, Senior Technical Consultant
Applied Intelligence Group
501 East 15th Street, Suite 202
Edmond, OK  73013

Internet: dfrench@vialink.com
   Voice: 405-341-7700
     FAX: 405-341-8898



If you simply must see shell curses do something now, Now, NOW!!!,
run the program "rundemo.sh".


The shell script "curses.sh" provides curses-like functionality in
bourne shell scripts.  The Curses functionality provided include cursor
movement and screen addressing.  Window addressing--maybe later.

The curses functions are grouped together in a file called "curses.sh". 
To use the functions, include the file in the user's shell script as
follows:

	#!/bin/sh
	. curses.sh
	initscr
	# example useage follows
	move 10 10
	clrtoeol
	addstr "Hellow World!!!"
	refresh
	endwin

You must include the ". " <PERIOD><SPACE> before the curses.sh command
so that the functions are included in the current shell.  Before using
any of the curses functions, you must initialize them with the "initscr"
function.  The "move" command, in the above example, moves the cursor to
row 10 column 10.  The "clrtoeol" command clears the current line from
the current column to the end of the line.  "addstr" inserts a string at
the current line and column.  The "refresh" command actually displays
the screen modifications. 

A logical screen buffer is modified by calls to the curses functions. 
The logical screen buffer is flushed to the display by the "refresh"
command.

To reiterate, the following functions modify the logical screen buffer
and when the buffer is "refreshed", the display is changed to reflect
the logical buffer.

REMEMBER: NOTHING IS DISPLAYED ON THE SCREEN UNTIL YOU PERFORM A "REFRESH"

Now that I have belabored the point about the "refresh" command, I shall
continue. 

The standard curses functions included in this shell script are:

------------------------------------------
function initscr		
------------------------------------------
Initializes the curses screen addressing system.


------------------------------------------
function endwin
------------------------------------------
Deinitializes the curses screen addressing system.


------------------------------------------
function refresh
------------------------------------------
Emptys the logical buffer to the display.
REMEMBER: NOTHING IS DISPLAYED ON THE SCREEN UNTIL YOU PERFORM A "REFRESH"

if you supply a parameter string to this function, it will echo the
commands stored in the environment variable "string" to the screen.


------------------------------------------
function clear
------------------------------------------
Clears the display.


------------------------------------------
function move ROW# COLUMN#
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.


------------------------------------------
function mvcur ROW# COLUMN#
------------------------------------------
Requires row and column number parameters.
Move the phyiscal cursor to the row and column specified.


------------------------------------------
function addch X 
------------------------------------------
Requires a single character parameter.
Prints the character on the screen at the current position.


------------------------------------------
function addstr STRING
------------------------------------------
Prints the string on the screen at the current position.


------------------------------------------
function mvaddch ROW# COLUMN# X
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.
Prints the character on the screen at the row and column specified.


------------------------------------------
function mvaddstr ROW# COLUMN# STRING
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.
Prints the string on the screen at the row and column specified.


------------------------------------------
function clrtoeol
------------------------------------------
Clear the current line from the current column to the end of
the line.


------------------------------------------
function clrtobot
------------------------------------------
Clear the display from the current column to the end of
the display.


------------------------------------------
function getch
------------------------------------------
Retrieve one character from standard input.


------------------------------------------
function getstr
------------------------------------------
Retrieve a string of characters from standard input.


------------------------------------------
function insch
------------------------------------------
Insert a character at the current display position.


------------------------------------------
function mvinsch ROW# COLUMN#
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.
Insert a character at row#,column#.


------------------------------------------
function insertln
------------------------------------------
Insert one line at the current display position.


------------------------------------------
function delch
------------------------------------------
Delete one character at the current display position.


------------------------------------------
function mvdelch
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.
Delete one character at the current position.


------------------------------------------
function deleteln
------------------------------------------
Delete the line at the current row.


------------------------------------------
function attroff
------------------------------------------
Turn off all display attributes.


------------------------------------------
function attron
------------------------------------------
Does nothing.


------------------------------------------
function attrset ATTRIBUTE
------------------------------------------
Requires an attribute string definition.
Sets the display attribute defined by "attribute".

	Valid Attributes:

		rev	reverse video
		blink	Blinking mode
		bold	Bold Video
		dim	Half Bright video
		smul	Start Underscore Mode
		rmul	End Underscore Mode
		sgr0	Exit all Attributes

------------------------------------------
------------------------------------------
------------------------------------------


The following functions are provide additional capabilities to the
curses shell functions.


------------------------------------------
function savescr SCREEN_NAME
------------------------------------------
Requires a screen name string.
Saves the logical screen buffer into an environment variable
defined by "screen_name".


------------------------------------------
function mvclrtoeol
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.


------------------------------------------
function clrtobol
------------------------------------------
Clear the line from the current column to the beginning of
the line.


------------------------------------------
function mvclrtobol
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.
Clear the line from the current column to the beginning of
the line.


------------------------------------------
function mvclrtobot
------------------------------------------
Requires row and column number parameters.
Moves the logical cursor to the row and column specified.
Clear the display from the current column to the end of
the display.


------------------------------------------
function getwd
------------------------------------------
Retrieve one word from standard input.


------------------------------------------
function beep
------------------------------------------
Ring the display bell.


------------------------------------------
function chkparm STRING
------------------------------------------
Determine if "string" is null, if so return false, if not return
true.


------------------------------------------
function chkint NBR
------------------------------------------
Determine if "nbr" is numeric, if so return true, if not return
false.


------------------------------------------
function chklines NBR
------------------------------------------
Determine if "nbr" is less than or equal to the number of lines
on the display.  If so return true, if not return false.


------------------------------------------
function chkcols NBR
------------------------------------------
Determine if "nbr" is less than or equal to the number of lines
on the display.  If so return true, if not return false.




