Dynamic List Window Manager-Instructions NOT Included
Posted in 1992
Dear Net,
I am posting the code below knowing that it is bound to help someone.
Similar coding examples have helped me many times over. I am sending
this code in its initial development state. It has some stubs and some
comments regarding some features. Also if I add more stuff the concept
will be more difficult to demonstrate.
There has been discussion in the past regarding Dynamic Help Windows
as described in the Summer 89 Tech Notes. Using that code as a model
I have attempted to build a method that is more generic and provides
access to expanding features.
Routine show_list is a simple "state machine" that does all of the
work that pop_up, shflup and shfldown did in the Tech Notes example
with the addition of paging through the list.
A major improvement is that it can be put in a library and linked in.
For any function that needs list services you need to create a routine
like state_list that does the application specific code.
show_list communicates with "list servers" by returning a "state" which
is predefined for a specific purpose. READ THE CODE IT's easier then
explaining it.
I also wanted to have more standard forms to show lists. So that all
fields would all be just one big string that was preformatted by a
list server. The memory array list is a fixed structure that should
be useable by any list that you construct.
It is also possible to select a form based on the number of list
items selected or the actual window size of the required list. State 2
(open window) could expand into a large function. I left in an
example of the intent.
Anyone is free to use this code, with the following exceptions:
1. Paul Mahler must sign an affidavit agreeing not to complain
about the pukey code.
P.S. Please notice the comments in show_list are around column 40,
this happens to be where they were on IBM 360 Assembler
Coding sheets (circa 60ish). Sure is tough trying to teach
these old dogs eh Paul. :-).
I can remember the ecstasy when I first had access to
lowercase characters. Thoseoooo were dayszzzzz.....
2. Informix personnel must provide a coupon for one free Version Level
upgrade for each time code is used; as I am afraid some new
policy may "break the bank".
My grateful thanks to anyone who has ever posted anything in the
Informix newsgroup or mail list.
Michael J. Kuhn Consultant phone:410-254-7060
Email: rhlab!kuhn@uunet.uu.net or uunet!rhlab!kuhn
c/o Baltimore Rh Typing Laboratory, Inc. phone:410-225-9595
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: f_list.per f_list1.per f_test.per intro liblist.4gl
# statecd.sql
# Wrapped by kuhn@rhlab on Sat Mar 14 00:08:38 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATHif test -f 'f_list.per' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \\"'f_list.per'\\"
else
echo shar: Extracting \\"'f_list.per'\\" \\(462 characters\\)
sed "s/^X//" >'f_list.per' <<'END_OF_FILE'
Xdatabase formonly
Xscreen size 24 by 80
X{
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X}
Xend
Xattributes
Xa = formonly.checkbox type char, autonext;
Xb = formonly.checkbox1 type char, autonext;
Xc = formonly.liststr type char, noentry;
Xinstructions
Xscreen record list_array[5] (formonly.checkbox, formonly.checkbox1,
X formonly.liststr);
Xdelimiters " ";
Xend
END_OF_FILE
if test 462 -ne `wc -c <'f_list.per'`; then
echo shar: \\"'f_list.per'\\" unpacked with wrong size!
fi
# end of 'f_list.per'
fi
if test -f 'f_list1.per' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \\"'f_list1.per'\\"
else
echo shar: Extracting \\"'f_list1.per'\\" \\(613 characters\\)
sed "s/^X//" >'f_list1.per' <<'END_OF_FILE'
Xdatabase formonly
Xscreen size 24 by 80
X{
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X[a|b|c ]
X}
Xend
Xattributes
Xa = formonly.checkbox type char, autonext;
Xb = formonly.checkbox1 type char, autonext;
Xc = formonly.liststr type char, noentry;
Xinstructions
Xscreen record list_array[11] (formonly.checkbox, formonly.checkbox1,
X formonly.liststr);
Xdelimiters " ";
Xend
END_OF_FILE
if test 613 -ne `wc -c <'f_list1.per'`; then
echo shar: \\"'f_list1.per'\\" unpacked with wrong size!
fi
# end of 'f_list1.per'
fi
if test -f 'f_test.per' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \\"'f_test.per'\\"
else
echo shar: Extracting \\"'f_test.per'\\" \\(112 characters\\)
sed "s/^X//" >'f_test.per' <<'END_OF_FILE'
Xdatabase formonly
Xscreen size 24 by 80
X{
X[b ]
X}
Xend
Xattributes
Xb = formonly.xfield type char;
Xend
END_OF_FILE
if test 112 -ne `wc -c <'f_test.per'`; then
echo shar: \\"'f_test.per'\\" unpacked with wrong size!
fi
# end of 'f_test.per'
fi
if test -f 'intro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \\"'intro'\\"
else
echo shar: Extracting \\"'intro'\\" \\(2634 characters\\)
sed "s/^X//" >'intro' <<'END_OF_FILE'
XDear Net,
X
X I am posting the code below knowing that it is bound to help someone.
X Similar coding examples have helped me many times over. I am sending
X this code in its initial development state. It has some stubs and some
X comments regarding some features. Also if I add more stuff the concept
X will be more difficult to demonstrate.
X
X There has been discussion in the past regarding Dynamic Help Windows
X as described in the Summer 89 Tech Notes. Using that code as a model
X I have attempted to build a method that is more generic and provides
X access to expanding features.
X
X Routine show_list is a simple "state machine" that does all of the
X work that pop_up, shflup and shfldown did in the Tech Notes example
X with the addition of paging through the list.
X
X A major improvement is that it can be put in a library and linked in.
X For any function that needs list services you need to create a routine
X like state_list