home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Boston 2
/
boston-2.iso
/
DOS
/
PROGRAM
/
BASIC
/
CDITQ
/
CODEIT.E_
/
CI.DOC
next >
Wrap
Text File
|
1992-05-27
|
110KB
|
2,965 lines
CODE-IT Menus & Windows
Copyright■ 1991-1992, Clear Software. All Rights Reserved
Clear Software 14962 Bear Valley Rd. Ste. G, Victorville Ca. 92392
Telephone (619)243-4749 FAX (619)241-3256
WARRANTIES
This software is provided as-is. There are no warranties, expressed or
implied.
CLEAR SOFTWARE DISCLAIMS ALL WARRANTIES RELATING TO THIS SOFTWARE, WHETHER
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND ALL SUCH WARRANTIES
ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. NEITHER CLEAR SOFTWARE NOR ANYONE
ELSE WHO HAS BEEN INVOLVED IN THE CREATION, PRODUCTION, OR DELIVERY OF THIS
SOFTWARE SHALL BE LIABLE FOR ANY INDIRECT, CONSEQUENTIAL, OR INCIDENTAL
DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE SUCH SOFTWARE EVEN IF CLEAR
SOFTWARE AS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR CLAIMS. IN NO
EVENT SHALL CLEAR SOFTWARE's LIABILITY FOR ANY DAMAGES EVER EXCEED THE PRICE
PAID FOR THE LICENSE TO USE THE SOFTWARE, REGARDLESS OF THE FORM OF CLAIM.
THE PERSON USING THE SOFTWARE BEARS ALL RISK AS TO THE QUALITY AND PERFORMANCE
OF THE SOFTWARE. Some states do not allow the exclusion of the limit of
liability for consequential or incidental damages, so the above limitation may
not apply to you.
This agreement shall be governed by the laws of the State of California and
shall inure to the benefit of Clear Software and any successors,
administrators, heirs and assigns. Any action or proceeding brought by either
party against the other arising out of or related to this agreement shall be
brought only in a STATE or FEDERAL COURT of competent jurisdiction located in
San Bernadino County, California. The parties hereby consent to in personam
jurisdiction of said courts.
This software and the disk(s) in which it is contained are licensed to you,
for your own use. This is copyrighted software. You are not obtaining title to
the software or any copyright rights. You may not sublicense, rent, lease,
convey, modify, translate, convert to another programming language, decompile,
or disassemble the software for any purpose.
You may use this software on more than one computer, provided there is no
chance it will be used simultaneously on more than one computer. If you need
to use this software on more than one computer simultaneously, a multi site
license must be obtained from Clear Software.
Clear Software grants permission for this program disk(s) to be copied and
distributed, if no fee is charged. UNDER NO CIRCUMSTANCES MAY THIS SOFTWARE BE
DISTRIBUTED IF A FEE OF ANY KIND, INCLUDING FEES TO COVER SHIPPING, HANDLING
AND DUPLICATING COSTS IS CHARGED, WITHOUT PRIOR WRITTEN PERMISSION FROM CLEAR
SOFTWARE. This software may not be distributed via electronic information
services or BBSs with express written permission from Clear Software.
If written permission to distribute this program and or files has been
obtained from Clear Software, the maximum amount which can be charged is
$10.00.
If you use this software for more than 90 days you are required to purchase a
registered copy from Clear Software.
MULTI SITE LICENSE AGREEMENT
If you would like to use this software on more than one computer a site
license is required. A site license is also required to use this software on a
network. A site license allows you to copy and use this software within your
organization on as many computers as you have contracted for. An unlimited
site license allows unlimited copying of the software for internal use only.
This is copyrighted software and any distribution or reselling of the software
to third parties is prohibited. Use the MULTI SITE LICENSE AGREEMENT form,
printed in this manual (also included in the REGFORM.DOC file included with
the CITOOLS disk(s)), for registering multi site software.The MULTI SITE
LICENSE AGREEMENT is a perpetual license for the use of the software within
your organization, and is not transferable.
The MULTI SITE LICENSE AGREEMENT is distinct from shareware use. It does not
authorize the continued use of shareware. If, in addition to the software used
under this license, shareware is in use, that shareware must be registered
with Clear Software. In addition Clear Software will provide technical support
for one year from the date of this agreement to one person, designated as the
key contact within your company or organization.
Clear Software warrants that it is the sole owner of the software and has full
power and authority to grant the site license without the consent of any other
party.
SYSTEM REQUIREMENTS
IBM XT, AT, PS2 or compatible computer running DOS 2.1 or higher. The CODE-IT
tool box set is designed to work with Microsoft■ QuickBASIC 4.5 and BASIC PDS
7.x software on MS-DOS operating systems 2.1 and higher.
Optional equipment include a Microsoft■ or 100% compatible mouse and a color
monitor.
MISC. COPYRIGHTS AND TRADEMARKS
All Clear Software products are trademarks or registered trademarks of Clear
Software. All other brand and product names are registered trademarks of their
respective companies.
REGISTERING THIS SOFTWARE
Clear Software distributes this software through shareware marketing, giving
you the user a chance to try the software before you buy it. If you use the
software for more than 90 days, or you wish to sell a program developed with
the CODE-IT tool box, you are required to purchase a registered version from
Clear Software. The cost to register is $59.00 for either the QuickBASIC or
BASIC PDS versions, or $79.00 to register both at the same time. There are
several benefits of becoming a registered user such as:
∙ A printed programmers referance manual.
∙ The most recent version of the program.
∙ 1 year free tech support
∙ Additional 90 day money back guarantee. If your not completely
satisfied with the Registered version of the CODE-IT Tool Box Set,
return it to us within 90 days and we'll refund the purchase price.
The above guarantee applies to registered versions only.
To become a registered user, fill out the REGISTRATION FORM from the
REGFORM.DOC file included with the CITOOLS disk(s) set and send it in to Clear
Software with a check or money order for $59.00 (California resedents add
sales tax on the registration form).
If you have any questions about this agreement or our products please call or
write us. Our hours are Monday - Friday 9 to 5 pacific time. Our answering
service and FAX is on all the time.
Copyright■ 1991-1992, Clear Software
All Rights Reserved.
Copyright■ 1991-1992, Clear Software. All Rights Reserved.
Printed in the United States of America
About CODE-IT...........................................................Page 1
Getting Started.........................................................Page 3
Installation......................................................Page 3
Creating Libraries................................................Page 4
Using Libraries...................................................Page 6
INCLUDE Files.....................................................Page 6
Demo Programs.....................................................Page 7
CITOOLS.LIB.............................................................Page 9
AdapterSet FUNCTION...............................................Page 9
AdapterType FUNCTION..............................................Page 9
AltConvert FUNCTION...............................................Page 9
AttrChange SUB...................................................Page 10
DrawBox SUB......................................................Page 10
ScreenPaint SUB..................................................Page 11
ScreenRestore SUB................................................Page 11
ScreenSave SUB...................................................Page 12
ScrollArea SUB...................................................Page 12
ShiftStateNow FUNCTION...........................................Page 13
WindowPut SUB....................................................Page 14
CIMOUSE.LIB............................................................Page 15
MouseDriver SUB..................................................Page 15
MouseHide SUB....................................................Page 15
MouseInit SUB....................................................Page 15
MouseLimit SUB...................................................Page 16
MousePoll SUB....................................................Page 16
MouseShow SUB....................................................Page 17
CIMENU1.LIB............................................................Page 18
PullDownActive SUB...............................................Page 18
PullDownColors SUB...............................................Page 18
PullDownDefine SUB...............................................Page 19
PullDownDescript SUB.............................................Page 20
PullDownDescriptArea SUB.........................................Page 20
PullDownInfo FUNCTION............................................Page 21
PullDownPaint SUB................................................Page 21
PullDownPoll FUNCTION............................................Page 22
PullDownSoundSet SUB.............................................Page 22
PullDownStateSet SUB.............................................Page 22
PullDownTitleDescript SUB........................................Page 23
PullDownTitleOn SUB..............................................Page 23
CIMENU2.LIB............................................................Page 24
PopUpActive FUNCTION.............................................Page 24
PopUpChoiceDescript SUB..........................................Page 25
PopUpColors SUB..................................................Page 25
PopUpDefine SUB..................................................Page 26
PopUpDescriptArea SUB............................................Page 26
PopUpExitKeySet SUB..............................................Page 27
PopUpGetItem FUNCTION............................................Page 27
PopUpPaint SUB...................................................Page 28
PopUpPlace SUB...................................................Page 28
PopUpReset SUB...................................................Page 28
PopUpSoundSet SUB................................................Page 29
PopUpStateSet SUB................................................Page 29
CIMENU3.LIB............................................................Page 30
PopColors SUB....................................................Page 30
PopDescript SUB..................................................Page 31
PopExitKeySet SUB................................................Page 32
PopMenu FUNCTION.................................................Page 32
PopPaint SUB.....................................................Page 33
PopReset SUB.....................................................Page 33
CIMENU4.LIB............................................................Page 34
RingActive FUNCTION..............................................Page 34
RingColors SUB...................................................Page 35
RingDefine SUB...................................................Page 35
RingDescript SUB.................................................Page 36
RingOn SUB.......................................................Page 36
RingSound SUB....................................................Page 37
CIWIND1.LIB............................................................Page 38
ButtonDefine SUB.................................................Page 38
ButtonGet FUNCTION...............................................Page 39
ButtonReset SUB..................................................Page 40
ButtonStateSet SUB...............................................Page 40
ButtonToggle SUB.................................................Page 40
EditFieldColors SUB..............................................Page 40
EditFieldDefine SUB..............................................Page 41
EditFieldGet FUNCTION............................................Page 42
WindowActive SUB.................................................Page 43
WindowColors SUB.................................................Page 43
WindowDefine SUB.................................................Page 44
WindowDrawBox SUB................................................Page 45
WindowDrawLine SUB...............................................Page 45
WindowEvent FUNCTION.............................................Page 46
WindowOff SUB....................................................Page 47
WindowOn SUB.....................................................Page 47
WindowPaint SUB..................................................Page 47
WindowPrint SUB..................................................Page 47
WindowSoundSet SUB...............................................Page 48
WindowToPull SUB.................................................Page 48
CIWIND2.LIB............................................................Page 49
AlertWindow FUNCTION.............................................Page 49
ScrollWindow FUNCTION............................................Page 50
TagWindow FUNCTION...............................................Page 51
TextWindow SUB...................................................Page 52
Page 1
About CODE-IT
CODE-IT Menus & Windows 2.1 is a flexible user interface library set for use
with the Microsoft■ BASIC language. The libraries work with QuickBASIC 4.5 and
BASIC PDS 7.x and above.
CODE-IT 2.1 includes a combined library (CIALL.LIB and QLB) as well as
separate library modules for building menus and windows. Menus can be pull
down menus, pop up menus held in memory, stand alone pop up menus, even ring
or vertical menus. Windows can have text, boxes, lines, edit fields with
controlled keyboard input and output, and several types of buttons. All the
menus and windows have complete mouse support built in. There's even a
separate mouse routine library included for developing your own mouse
supported programs.
Also included is a library of specialty windows. Windows like auto sized text
windows, scrolling windows, tag windows, and alert windows are complete and
ready to use. A multi purpose library included with the set features screen
saving and restoring, box and background drawing, video hardware detection and
more.
You can use the combined libraries for building your programs or the separate
libraries can be mixed and matched in just about any way to create your own
custom libraries. Since the compiler will only pull in the code from the
library which your program needs, the size of your programs will be the same
either way.
No royalty fees are charged for programs developed with the registered version
of the CODE-IT Menus & Windows.
The CODE-IT tool box set, or CITOOLS for short, is distributed through
shareware marketing. Simply put, shareware is user supported software.
Software which gives you the chance to try before you buy. Clear Software
gives you permission to use the CODE-IT software for 90 days. If your still
using the software after 90 days, or you wish to sell a program you have
developed with the CODE-IT tool box set, you are required to purchase a
registered copy from Clear Software. You may not sell a program developed with
an unregistered version of CODE-IT. The benefits of becoming a registered user
far outweigh the nominal cost. The benefits include:
∙ Printed programmers reference manual.
∙ The latest version of the tool box libraries.
∙ Additional up to the date routines not included in shareware
versions(we are constantly adding routines).
∙ 1 year FREE tech support.
∙ 2 FREE updates.
∙ A 90 day unconditional money back guarantee. If your not happy
with the registered version of the program, return it to us within
90 days and we'll refund your money in full, no questions asked.Page 2
At Clear Software, your satisfaction is our number one priority.
The cost to purchase a registered version is $59.00 (U.S.).
Shipping and handling are free anywhere in the U.S.A., air service is
available at an additional cost. To register, print a copy of the registration
form file (REGFORM.DOC) which comes with the shareware version disk(s). Fill
in the form and send it and a check or money order for $59.00 (California
residents add 7.25% sales tax) to:
Clear Software
14962 Bear Valley Rd. Ste. G
Victorville, Ca. 92392
The CODE-IT tool box set is designed to leverage the programmers time. We feel
that once you study and begin using the tools you will find them a useful and
invaluable source for your programs.
As we mentioned before Clear Software charges no royalty fees for registered
users of the CODE-IT set developing end user executable programs. Once your a
registered user, all executable files developed with the CITOOLS set are yours
to distribute as you wish. However, You may not develop libraries or object
files which contain any part of the CITOOLS set for any form of distribution
without compiling them into a running executable file. For more information on
the license agreement for this software see the License Agreement section at
the beginning of this document or manual.
The tool box routines used are called like any other SUB or FUNCTION in the
Microsoft■ BASIC language. Depending on your level of programming knowledge
and third party libraries, learning to use them could take some time. Usually
we recommend sitting down with them for a session or two before you begin
serious programming with them. Studying the sample source code files
(DEMO*.BAS) included with the disk(s) also speed the understanding of the
procedures. Also, use the tool box reference in this manual for detailed
explanations of the routines in the CITOOLS set.
At Clear Software it's extremely important to us that we know what you think
of our software. If you have any suggestions or comments about our software
products please write to us and let us know.
Page 3
Getting Started
Installation
The INSTALL.EXE program on the CODE-IT disk will install the files for you in
any directory you want. If the directory you choose does not exist it will be
created for you if you tell the program to do so.
First, make backup copies of the original disk or disks and use the copies to
install the files. Consult your DOS manual for the disk copy procedure.
1) Put the disk (disk 1 if you have a multiple disk set) in drive A: or B:
and at the "C:>" prompt type "A:INSTALL" or "B:INSTALL" and press the
ENTER key. After a few seconds a menu will appear asking if you have a
color or monochrome monitor. Use the ARROW keys to highlight the correct
mode and press ENTER to select it.
2) The next screen to appear is the opening screen displaying information
about CODE-IT. After reading the message press any key to continue.
3) The next screen will enplane the install program and how to use it. When
your finished reading it press any key to continue.
4) You are now at the install screen and menu. The menu choices across the
top of the screen are selected by using the left and right arrow keys to
highlight the choices and pressing the enter key to activate the
selection. The window showing displays the current default settings for
the installation.
To change the "From" drive:
Use the ARROW keys to highlight the menu choice "Install-From" and press
ENTER. Use the editing keys (backspace, del, etc...) to enter the
correct drive and press ENTER.
To change the "To" path:
Use the ARROW keys to highlight the menu choice "Install-To" and press
ENTER. Use the editing keys (backspace, del, etc...) to enter the
correct path and press ENTER.
5) Once all the path and drive are correct, use the ARROW keys to highlight
the menu choice "Install" and press ENTER. If the "To" path you gave
does not exist the program will ask you if you want to create it. When
the file installation is complete window pops up to let you know. Press
any key to continue.
5) Once again you are at the control menu. Use the ARROW keys to highlight
the menu choice "Exit" to end the installation program.
That's It. The files are now installed and ready to use. The next section will
help you build thePage 4
libraries and decide which files you will want to include in them.
Creating Libraries
The tools are separated into several individual library files allowing you to
build custom run time and quick libraries for use with your programs without
having to include unused code. This is helpful if memory is a concern, and you
need as small a quick library as possible. The following is a brief
description of the tool box files and the necessary LIB files to include when
building your libraries. For a more detailed description of the libraries see
the toolbox references.
Library File Description and Related Files
_________________________________________________________________
CIALLQB.LIB -or-
CIALLB7.LIB A combined library of all the CODE-IT tool box
libraries. (CIALLQB.LIB for QuickBASIC, CIALLB7.LIB
for BASIC PDS).
CIALLQB.QLB -or-
CIALLB7.QLB The quick library containing all the CODE-IT library
routines. (CIALLQB.QLB for QuickBASIC, CIALLB7.QLB for
BASIC PDS). Load them into the QB or QBX environment
using the /L command followed by the quick library
name (QB /L CIALLQB).
CITOOLS.LIB The main tool box file. All the other tool box files
use the routines in this library. You must include
this file when using any of the libraries in the
CITOOLS set. You can however use this file alone if
your program only uses the routines in this library.
CIMOUSE.LIB The mouse routines for all the menu and window tool
box files. It must be included in any combined
libraries you create with the CITOOLS set, even if you
don't plan to use mouse routines with your program.
This file is separate from the CITOOLS.LIB incase you
want to use it to build mouse routines into your
programs without using any of the other tool box
files.
CIMENU1.LIB Routines for pull down menus. When creating a combined
or quick library the CITOOLS.LIB and the CIMOUSE.LIB
must be included also.
CIMENU2.LIB The library for using in memory pop up menus. When
creating a combined or quick library the CITOOLS.LIB
and the CIMOUSE.LIB must be included also.
CIMENU3.LIB Routines for pop up menus (not held in memory). When
creatingPage 5
a combined or quick library the CITOOLS.LIB and the
CIMOUSE.LIB must be included also.
CIMENU4.LIB Routines for using ring or vertical menus. When
creating a combined or quick library the CITOOLS.LIB
and the CIMOUSE.LIB must be included also.
CIWIND1.LIB Routines for creating text, button, and data entry
windows. When creating a combined or quick library the
CITOOLS.LIB and the CIMOUSE.LIB must be included also.
CIWIND2.LIB Routines for specialty windows such as alert and tag
windows. When creating a combined or quick library the
CITOOLS.LIB and the CIMOUSE.LIB must be included also.
Creating combined or quick libraries with the CITOOLS set is just like
creating any other library. If you have Clear Software's TRACKIT Library
Management System use it to create the libraries for you. The database of
TRACKIT will also help you keep track of the separate library modules you used
to create the combined libraries.
If you don't have the TRACKIT system, the following section is an example of
creating stand alone and quick libraries from the DOS command line. (If you
would like a copy of the TRACKIT Library Management System, ask for it from
your favorite shareware dealer. If unavailable you can also order it directly
from Clear Software).
Stand Alone Library - QuickBASIC:
LIB CINEW.LIB+CITOOLS.LIB+CIMOUSE.LIB+CIMENU1.LIB+QB.LIB;
Creates a stand alone or linkable library called CINEW.LIB which
contains the CITOOLS, CIMOUSE, CIMENU1 and QB.LIB libraries.
NOTE: QB.LIB is supplied with your QuickBASIC program and must be
included when building custom libraries built with CODE-IT exept when
using the CIALLQB.LIB.
Stand Alone Library - BASIC 7.x:
LIB CINEW.LIB+CITOOLS.LIB+CIMOUSE.LIB+CIMENU1.LIB+QBX.LIB;
Creates a stand alone or linkable library called CINEW.LIB which
contains the CITOOLS, CIMOUSE, CIMENU1 QBX.LIB libraries.
NOTE: QBX.LIB is supplied with your BASIC 7.x program and must be
included when building custom libraries built with CODE-IT exept when
using the CIALLB7.LIB.
Page 6
Quick Library - QuickBASIC
LINK /Q CITOOLS.LIB CIMOUSE.LIB CIMENU1.LIB QB.LIB, CINEW.QLB,,
BQLB45.LIB;
Creates a quick library for use with QuickBASIC 4.5 out of the CITOOLS,
CIMOUSE, and the CIMENU1 libraries.
NOTE: BQLB45.LIB is for the QuickBASIC 4.5 system. If you have a
different version of QuickBASIC use the correct library.
Quick Library - BASIC 7.x
LINK /Q CITOOLS.LIB CIMOUSE.LIB CIMENU1.LIB QBX.LIB, CINEW.QLB,,
QBXQLB.LIB;
Creates a quick library for use with the BASIC 7.x professional
development system. The library contains the CITOOLS, CIMOUSE, and
CIMENU1 libraries.
For more information on stand alone and quick libraries see your BASIC
reference manual.
Using Libraries
This section gives a brief overview of third party libraries and their uses.
If your familiar with these types of libraries you might just want to skim
through this section to pick up hints on the CITOOLS set. For others who might
be new to third party libraries this section will help you see how you can use
the libraries to improve your program development.
The term "Third party libraries" refers to computer language library files put
out by companies other than the originator of the programming environment. In
this case Microsoft■. Their uses in computer programming have become very
popular due to the great amount of time you save by using code already wrote
and tested.
There are different types of library sets. CODE-IT is a set of user interface
libraries, libraries which allow you to design menus and windows to
communicate with the end user of your programs. To write the code for these
routines yourself could take you months or even years. But by registering with
Clear Software and using the CODE-IT set, you'll spend that time on developing
new projects and profiting from your finished ones.
Using the libraries is the same as calling any other Microsoft■ BASIC SUB or
FUNCTION procedure. In fact, that's exactly what they are. Some of the
procedures use languages such as C and Assembler to improve their speed and
functionability. Others are written in BASIC. Your program does not need to
know the language, just the correct calling procedure.
INCLUDE Files
Included on the CITOOLS disk is a group of include files. If your not familiar
with include files, they contain the definitions for the SUB's and FUNCTION's
in the CITOOLS libraries. ThePage 7
include file name is the same as it's library file name except for the "BI"
extension. The appropriate include file must be placed at the beginning of the
main module in your program with an INCLUDE$ meta command such as:
'INCLUDE$:'CIMENU1.BI'
See your BASIC reference manual for more details.Make sure the include files
are in the same directory as your program file, or that the path to them is
included in the QB or QBX environment paths.
Demo Programs
At Clear Software, we believe the best way to learn the CODE-IT set is to use
it. For this reason we have included two things with the set, a tool box
reference and demo programs. Later in this manual you will find the tool box
reference, and the demo files are located on the CODE-IT disk. All the demo
programs are source code files with an extension of "BAS".
Each individual program demonstrates one of the menu or window tool box
libraries in the CITOOLS set. The demo is broken up to make it easier to learn
about any part of the tool box without having to wade through unwanted code.
NOTE: The demo programs are wrote for use with a color monitor. If your using
them on a monochrome or black and white monitor you will need to change the
color values in the SUB and FUNCTION calls as well as the COLOR statement
values. After loading the programs into the QB or QBX environment, use the
tool box reference section to locate the color parameters in the SUB's and
FUNCTION's.
To use the demo programs you first need to load the combined quick library
CIALLQB.QLB into the QB environment or CIALLB7.QLB into the QBX environment
using the /L command followed by the library name. An example would be QB /L
CIALLQB for QuickBASIC or QBX /L CIALLB7 for BASIC PDS. If you need help, see
Quick Libraries in your BASIC reference manual. Once you've loaded the quick
library and are in QB or QBX, load any one of the demo programs with the "Load
New" command from the QB or QBX "File" menu, just as you would any other BASIC
source code file.
Viewing the source code you'll notice plenty of comments. By reading the
comments and using the tool box reference in this manual, you should get a
feel for how the tool box works. Also, the programs are now ready to run by
pressing F5. Run the programs and watch how they work. Change the program
parameters of the SUB and FUNCTION calls to test new values and their actions.
Keep your tool box reference section handy to review the parameter types.
If you have problems running the demo programs, and get errors such as "File
not found" or "Procedure not defined", check to see if:
1) Your "BI" or include files are in the same directory as the "BAS" or
source code files.Page 8
2) Your quick library is loaded properly. You might have to exit and
reload the quick library if your not sure.
Study and play with the demo programs.When you feel comfortable with using the
libraries, develop an application of your own. The CITOOLS set provides a
great deal of flexibility and power to the programmer. After you learn it,
you'll be surprised at the development time it will save you over writing the
code yourself.Page 9
CITOOLS.LIB
The CITOOLS library is the heart of the toolbox. All of the other libraries
included with the CITOOLS set use it's SUB's and FUNCTION's to accomplish
their work. The routines can also be used to create your own custom
applications.
AdapterSet FUNCTION
This FUNCTION is used internally by CITOOLS to set the video mode for the
screen save and restore routines. There is no need to use this FUNCTION from
your programs.
AdapterType FUNCTION
Returns a string representing the type of video adapter on the users
system. The following strings are returned, "MDPA", "CGA", "ColorEGA",
"MonoVGA", "ColorVGA", "MonoMCGA", and "ColorMCGA".
variable$ = AdapterType$
variable$ Any BASIC variable of type string.
AltConvert FUNCTION
Strips the "Alt" from an "Alt + ascii" key press leaving the ascii key
as if it were the only key pressed and returns it to the calling
procedure in the form of a string. The AltConvert FUNCTION is an easy
way to determine a specific keypress if an alt key combination could be
used. When a key press value is passed, the value returned is as if the
user never pressed the alt key.
variable$ = AltConvert(kb$)
variable$ Any BASIC variable of type string.
kb$ The key press character of the "Alt + ascii" keys pressed.
Page 10
AttrChange SUB
Changes the color attributes of a given area of the screen without
altering the contents. The AttrChange SUB is used by the windows and
menus of the CITOOLS package to place a shadow behind them. The
appearance of a shadow is accomplished by changing the color of the
screen area to gray on black (8,0). Another use of this SUB is to place
and update the scrolling highlight on the menus. It's much faster to
change the attributes then to reprint the screen area.
CALL AttrChange(left%, right%, top%, bottom%, FG%, BG%)
left% The left column of the area to change.
right% The right column of the area to change.
top% The top row of the area to change.
bottom% The bottom row of the area to change.
FG% Foreground color to change to.(1 to 15)
BG% Background color to change to. (1 to 7)
DrawBox SUB
Draws a single, double, or solid line box around a given area of the
screen. Use a COLOR statement before calling DrawBox to set the colors
for the box. On a single (1) and double (2) line box the foreground
color is the color of the box itself. On a solid (3) box the color of
the background will be the color of the solid border drawn. The contents
between the box area drawn is not changed.
CALL DrawBox(left%, right%, top%, bottom%, boxType%)
left% The left column of the box.
right% The right column of the box.
top% The top row of the box.
bottom% The bottom row of the box.Page 11
boxType% The type of box to draw. 1 = A single line box, 2 = a double
line box, 3 = a solid border box.
ScreenPaint SUB
Paints a given area of the screen with any printable ascii character.
Use a COLOR statement before calling the ScreenPaint SUB to set the
colors for the area to be painted. There are two ways to pass the Ascii$
variable to the SUB. One way is to use a CHR$ string like CHR$(177) for
a hatch character, or you can hold down the ALT and CTRL keys while
typing the ascii character code 177 then enclose the resulting character
in quotes. Passing a null string ("") will paint a solid background
using the current background color.
CALL ScreenPaint(left%, right%, top%, bottom%, Ascii$)
left% The left column of the area to paint.
right% The right column of the area to paint.
top% The top row of the area to paint.
bottom% The bottom area of the area to paint.
Ascii$ Any printable ascii character string (IE: CHR$(42) or "*"
for the star character). See remarks below.
ScreenRestore SUB
Restores an area of the screen previously saved by the ScreenSave SUB.
Up to 10 areas of the screen can be stored in memory at one time or as
much as memory will allow. A full screen takes about 4000 bytes of
memory. The ScreenSave and ScreenRestore SUB's use an assembly language
routine to do their work which makes the save and restore extremely
fast.
CALL ScreenRestore(left%, right%, top%, bottom%, scrnNum%)
left% Left column of the area to be restored.
right% Right column of the area to be restored.Page 12
top% Top row of the area to be restored.
bottom% Bottom row of the area to be restored.
scrnNum% An integer number between 1 and 10 which is unique to each
area saved at one time. This number must be the same used to
save the screen. (See the ScreenSave SUB description).
ScreenSave SUB
Saves an area of the screen in memory. Use the ScreenRestore SUB to
restore the area of screen saved. Make sure to use the same number to
restore the screen as was used to save it. The ScreenSave and
ScreenRestore SUB's us an assembly language routine to do their work
making them extremely fast.
CALL ScreenSave(left%, right%, top%, bottom%, scrnNum%)
left% Left column of the area to be saved.
right% Right column of the area to be saved.
top% Top row of the area to be saved.
bottom% Bottom row of the area to be saved.
scrnNum% An integer number between 1 and 10 used to identify the area
of the screen saved. This number must be unique to each area
of screen saved at one time.
ScrollArea SUB
Scrolls an area of the screen up or down a given number of columns
leaving the remaining area of the screen in tact. When the screen is
scrolled blank lines newly created are given the background color
attribute of the newColorBG% variable.
CALL ScrollArea(left%, right%, top%, bottom%, lines%, newColorBG%)
left% Left column of the scroll area.
Page 13
right% Right column of the scroll area.
top% Top row of the scroll area.
bottom% Bottom row of the scroll area.
lines% The number of columns to scroll up or down. Use a
positive number to scroll the area up and a negative
number to scroll the area down.
newColorBG% The background color of the new area. (See the Remarks
below).
ShiftStateNow FUNCTION
Returns the state of the given extended key at the time of the call. Use
the ShiftStateNow FUNCTION in a loop to continually check for the state
of a certain key. This FUNCTION is used by the MENU1.LIB to poll for the
Alt key which activates the pull down menu title bar.
variable% = ShiftStateNow(extKey%)
variable% Any variable of type integer. A value is passed back in the
following form:
Value Action
_______________________________________________________
0 The key polled is inactive (not pressedor not on).
-1 The key polled is active (pressed or on).
extKey% An integer number between 0 and 7 which defines the extended
key to be polled. Use the following values:
Value Action
_______________________________________________________
0 Right Shift key.
1 Left Shift key.
2 Ctrl key.Page 14
3 Alt key.
4 Scroll Lock key.
5 Num Lock key.
6 Caps Lock key.
7 Insert key.
WindowPut SUB
Puts a window on the screen at a given location. Although the CITOOLS
set contains several full featured window routines, this SUB was
included to allow you greater flexibility in designing your programs.
CALL WindowPut(left%, right%, top%, bottom%, shad%, boxType%, FG%, BG%)
left% Left column of the window.
right% Right column of the window.
top% Top row of the window.
bottom% Bottom row of the window.
shad% An integer number telling the SUB to use a shadow for the
window or not. 0 = no shadow, 1 = use a shadow.
boxType% An integer number which determines the type of border box
the window will have. 0 = no box, 1 = a single line box, 2 =
a double line box, 3 = a solid border box.
FG% Foreground color for the window (1 to 15).
BG% Background color for the window (1 to 7).Page 15
CIMOUSE.LIB
The CIMOUSE toolbox contains the mouse routines used by all the libraries that
come with the CODE-IT set except the CITOOLS.LIB itself. For this reason it
must be included with your program if you plan to use any of the other
libraries. The library senses if the users computer has a mouse driver
installed or not. If not your programs run as usual. The CIMOUSE library works
with the Microsoft Mouse and compatibles. The library is left separate from
the CITOOLS.LIB to allow you to use it with other programs you might have
already developed and give them mouse support. To use the mouse routines place
MouseInit at the beginning of your program.
MouseDriver SUB
This SUB is used by the other SUB's in CIMOUSE.LIB. There is no reason for you
to call this SUB because all the features needed to call the mouse driver are
handled internally for you by the other procedures.
MouseHide SUB
Hides the mouse cursor. The CIMENUn and CIWINDn toolboxes automaticly
handle the mouse for you. If you decide to create custom windows using
CITOOLS.LIB or other procedures which do not control the mouse, you will
need to hide the mouse before printing text or characters to the screen.
This will keep the mouse cursor from blocking the character attributes
your program is attempting to put on the screen.
CALL MouseHide
MouseInit SUB
Initializes the mouse driver so the other SUB's can access it's
functions. Place the MouseInit call at the beginning of your program.
Along with initializing the mouse driver the MousInit SUB also tests for
a mouse driver being present on the users system. If there is not a
mouse present it sets an internal variable switch letting the mouse
routines exit without trying to call the mouse driver. This allows your
programs to run on systems with or without a mouse using the same code.
Page 16
CALL MouseInit
MouseLimit SUB
Limits the area of the screen that the mouse cursor can move in. Use the
MouseLimit SUB whenever you want to restrict the movement of the mouse
cursor to a given area such as a window or menu. Another use is to place
the mouse cursor anywhere on the screen. To free the mouse call the SUB
set to the full screen area.
CALL MouseLimit(left%, right%, top%, bottom%)
left% The left column of the limit area.
right% The right column of the limit area.
top% The top row of the limit area.
bottom% The bottom row of the limit area.
MousePoll SUB
Polls the mouse driver and returns the current row and column of the
mouse and the states of the mouse buttons. Use the MousePoll SUB in a
loop to continually poll for a mouse event.
CALL MousePoll(mRow%, mCol%, lButton%, rButton%)
mRow% Current row of the mouse cursor.
mCol% Current column of the mouse cursor.
lButton% Current state of the left mouse button. 0 = not active (not
pressed), -1 = active (pressed).
rButton% Current state of the right mouse button. 0 = not active (not
pressed), -1 = active (pressed).
Page 17
MouseShow SUB
Makes the mouse cursor visible. Use the MouseShow SUB at the beginning
of your program after you have finished painting opening screens and
backgrounds. If it is necessary to hide the mouse at any time use it to
restore the mouse cursor to the screen.
CALL MouseShowPage 18
CIMENU1.LIB
This tool box allows you to build pull down menus into your program similar to
QB or QBX pull down menus. Up to 10 menu titles can be defined and each title
can hold up to 20 pull down menu choices. The menus need only to be defined
once by your program and from that point on are held in memory. This makes
reusing the menus quick and easy. These menus can also interact with the data
windows created with CIWIND1.LIB.
Limits And Considerations
Maximum number of menu titles with sub menus 10
Maximum number of menu choices on sub menus 20
All arrays passed to any SUB or FUNCTION in the CITOOLS set use a base
of 1. An example would be DIM text$(1 TO n), where n is either the
required boundary limit of the array or any number which meets your
programs needs. The following is a description of the arrays with
required boundaries for the CIMENU1.LIB tool box. The required DIM is
the statement your program must have to pass the array to the SUB or
FUNCTION.
Array SUB or FUNCTION Required DIM
________________________________________________________________________
descript$() PullDownDescript (1 TO 20)
PullDownActive SUB
Once a menu event takes place (ie: Alt + access key or left mouse button on
row 1) control of the program is passed to this SUB from the PullDownPoll SUB.
This SUB is handled internally by the CIMENU1.LIB and does not need to be
called directly.
PullDownColors SUB
Sets or changes the colors for the pull down menus. The menu colors ar
passed in the form of integers, 1 to 15 for foreground colors and 1 to 7
for background colors. The background colors for the access keys are the
same as the text and highlight colors. For a description of the disabled
menu choice see PullDownDefine.Page 19
CALL PullDownColors(bordFGClr%, bordBGClr%, textFGClr%, textBGClr%,
titleFGClr%, titleBGClr%, hiFGClr%, hiBGClr%, disableFGClr%,
disableHiFGClr%, hihiFGClr%, hiFGClr%)
bordFGCLr% Border foreground color for the menu (1 TO 15).
bordBGCLr% Border background color for the menu (1 TO 7).
textFGClr% Text foreground color for the menu (1 TO 15).
textBGClr% Text background color for the menu (1 TO 7).
titleFGClr% Title foreground color for the menu (1 TO 15).
titleBGClr% Title background color for the menu (1 TO 7).
hiFGClr% Foreground color for the menu highlight bar (1 TO 15).
hiBGClr% Foreground color for the menu highlight bar (1 TO 7).
disableFGClr% Foreground color for the disabled menu choice (1 TO
15).
disableHiFGClr% Foreground color for the disabled menu choice when the
highlight bar is on it (1 TO 15).
hihiFGCLr% Foreground color for the menu choice access key when
the menu highlight bar is on it (1 TO 15).
hihcarFGclr% Foreground color for the menu access key (1 TO 15).
PullDownDefine SUB
Sets the pull down menu titles, choices, access characters, and initial
states of choices or titles. For an example of the PullDownDefine SUB
see the source code examples later in this manual or the DEMOM1.BAS
source code file.
CALL PullDownDefine(menu%, item%, state%, choice$, hichar%)
menu% An integer number describing the menu title being defined or
the number of the menu title the choice should be attached
to.Page 20
item% An integer number defining the item being passed. Use the
following values:
Value Action
__________________________________________________________________
0 The item being defined is a menu title. Titles are the text
in the menu bar visible across the top of the screen.
1 - 10 The item being passed is a pull down menu choice and is to
be attached to the menu title of this number (left to right
on the menu title bar).
state% The initial state of the menu item or title. 0 = disabled, 1
= active.
choice$ A BASIC string of the menu title or choice to be printed on
the screen.
hichar% An integer number of the of the highlighted access key
character in the choice$ string. (ie: 1 to highlight the "F"
in "File").
PullDownDescript SUB
Defines the description or help line for the pull down menu choices. The
description line is a way to simplify your menu structure for the end
user. It allows you to put a long description for each of your menu
choices. A maximum of 1 line and 80 characters are allowed for the
description. For information on the placement of the description area
see PullDownDescriptArea.
CALL PullDownDescript(menu%, descript$())
menu% An integer number describing the menu title to link the
descriptions to.
descript$() A text array holding the descriptions for the individual
menu choices of the pull down menu. Make sure the array is
dimensioned in your program as DIM arrayname$(1 TO 20) where
arrayname$ is any BASIC variable name of type string.
PullDownDescriptArea SUB
Defines the screen placement of the pull down menu title and choice
descriptions. The area for the menu descriptions is saved and restored
on exit from the pull down menusPage 21
and can contain 1 line up to 80 characters in length.
CALL PullDownDescriptArea(row%, col%, areaLength%, FG%, BG%)
row% Screen row of the description area.
col% Left column of the description area.
areaLength% The length of the description area.
FG% Foreground color for the description area and text.
BG% Background color for the description area and text.
PullDownInfo FUNCTION
Polls the pull down global variables to determine if a menu was chosen
and if so a second call can be made to determine which menu or item.
Using this format makes it very easy to put this in a LOOP followed by a
SELECT CASE block to poll for menu events while your program is running.
See program examples later in this manual or the demo source code files
included with your disks (DEMOM1.BAS).
variable% = PullDownInfo(switch%)
variable% Any BASIC variable of type integer.
switch% An integer number between 0 and 2 with the following
actions:
Value Action
__________________________________________________________________
0 Returns the value of 0 in variable% if no menu has been
chosen or -1 if one has.
1 Returns number of the menu chosen.
2 Returns the menu item number chosen.
PullDownPaint SUBPage 22
This SUB is used internally by the CIMENU1 toolbox to paint and display the
pull down menus. It is not necessary for your programs to call this SUB
directly because it is handled for you by the toolbox.
PullDownPoll FUNCTION
Processes mouse or keyboard events. If a menu event took place, Alt +
title access key or a left mouse button press while the mouse cursor is
on row 1, then it passes control of the program to the PullDownActive
SUB. If a key press took place which was not a menu event the character
for the key press is passed back. The PullDownPoll FUNCTION acts like
the BASIC INKEY$ statement but it also checks for menu events.
variable$ = PullDownPoll$
variable$ Any BASIC variable of type string.
PullDownSoundSet SUB
Sets the pull down menu sound which alerts the user of a wrong key
press. Sound frequency values of 50 or less usually are not heard. When
determining the sound length make sure you allow for slower machines.
What may seem to be a short tone on your computer may be a long an
annoying sound on a slower machine.
CALL PullDownSoundSet(soundFreq%, soundLength%)
soundFreq% An integer between 1 and 10000 which is the frequency
or tone of the sound to make. If 0 is passed then the
sound feature is turned off.
soundLength% The length of the tone, a higher number creates a
longer tone.
PullDownStateSet SUB
Toggles the state of a menu title or pull down menu choice between
active and disabled. Use the same values for the menu% and item%
variables as were originally defined with the PullDownDefine SUB.
Disabled titles will not display their pull down menu and canPage 23
not be selected.
CALL PullDownStateSet(menu%, item%, state%)
menu% The number of the menu title to link the change to.
item% The number of the menu choice to link the change to. If the
item is a menu title use 0 for this value.
state% An integer number determining the state of the item. 0 =
disabled, 1 = active.
PullDownTitleDescript SUB
Sets the description (sometimes called help line) for the menu titles
when no pull down menus are being shown. The description is displayed
using the values set with the PullDownDescriptArea SUB. Use this option
to display key descriptions for your menu title bar (ie: ENTER=Menu,
ESC=Cancel, etc.).
CALL PullDownTitleDescript(descript$)
descript$ A string holding the descript line to be displayed.
PullDownTitleOn SUB
Makes the defined menu title bar visible. Use this SUB any time you need
to display or re-display your menu title bar. The menu bar is always
printed in row 1 of the screen.
CALL PullDownTitleOnPage 24
CIMENU2.LIB
This library contains the procedures for using in memory pop up menus. In
memory pop up menus are defined similar to the pull down menus in CIMENU1.LIB.
Once defined they stay in memory until your program ends.This allows you to
define them once and then show them on the screen at any time in your program
with very little code. If you want to use pop up menus but don't want to keep
them in memory see CIMENU3.LIB. As with the rest of the menus in the toolbox
full mouse support is built in.
Maximum number of menus in memory 20
Maximum number of menu choices on each menu 20
Maximum number of user defined exit keys per menu 5
All arrays passed to any SUB or FUNCTION in the CITOOLS set use a base
of 1. An example would be DIM text$(1 TO n), where n is either the
required boundary limit of the array or any number which meets your
programs needs. The following is a description of the arrays with
required boundaries for the CIMENU2.LIB tool box. The required DIM is
the statement your program must have to pass the array to the SUB or
FUNCTION.
Array SUB or FUNCTION Required DIM
________________________________________________________________________
descript$() PopUpChoiceDescrpt (1 TO 20)
PopUpActive FUNCTION
Takes control of the program and processes the menu events. When the
menu is exited it passes back the menu choice selected or the key which
caused the exit. This is the only call needed to activate the menus once
they have been defined. For a complete example see the source code for
DEMOM2.BAS.
variable% = PopUpActive(menu%)
variable% Any BASIC variable of type integer.
menu% An integer number which is the menu to be used (defined with
PopUpDefine).Page 25
PopUpChoiceDescript SUB
Sets the pop up menu description or help line text for any given menu.
Note that the array your program is passing to this SUB must be defined
as (1 TO 20). Each description member of the array given should
correspond with the menu choice. For example the 3rd member of the
descript$() array will be displayed when the menu highlight is on the
3rd menu choice. If descriptions are not needed in your program, it is
not necessary to use this SUB.
CALL PopUpChoiceDescript(menu%, descript$())
menu% An integer number of the menu to link the descriptions to.
descript$() A string array which should be defined as DIM descript$(1 TO
20) in your program which holds the descriptions.
PopUpColors SUB
Sets the colors for the pop up menus. Each individual pop up menu
defined with the PopUpDefine can have its own color values. These colors
stay in effect until you change them or your program ends.
CALL PopUpColors(menu%, bordFGClr%, bordBGClr%, textFGClr%, textBGClr%,
titleFGClr%, titleBGClr%, hiFGClr%, hiBGClr%, disableFGClr%,
disableHiFGClr%, hihiFGClr%,hiCharFGClr%)
menu% The number of the menu to link the color definitions
to.
bordFGClr% Foreground color for the menu border (0 to 15).
bordBGClr% Background color for the menu border (0 to 7).
textFGClr% Foreground color for the menu choices (0 to 15).
textBGClr% Background color for the menu choices (0 to 7).
titleFGClr% Foreground color for the menu title (0 to 15).
titleBGClr% Background color for the menu title (0 to 7).Page 26
hiFGClr% Foreground color for the scrolling highlight bar (0 to
15).
hiBGClr% Background color for the scrolling highlight bar (0 to
7).
disableFGClr% Foreground color for the disabled menu choices (1 to
15).
disableHiFgClr% Foreground color for the disabled menu choice when the
scrolling highlight bar is on it (1 to 15).
hihiFGClr% Foreground color for the menu choice quick access
character when the highlight bar is on it (1 to 15).
hiCHarFGClr% Foreground color for the menu choice quick access
character (1 to 15).
PopUpDefine SUB
Defines the menu titles and choices for your pop up menus. Use one call
for each menu title or choice being defined. Pass a dash ("-") for the
menu choice to print a line across the menu.
CALL PopUpDefine(menu%, item%, state%, choice$, hiChar%)
menu% The number of the menu being defined (1 to 20).
item% The number of the menu item being defined. 0 = menu title, 1
to 20 = menu choices.
state% The initial state of the menu choice being defined. 0 =
disabled, 1 = active.
choice$ The text for the menu title or choice.
hiCHar% The number of the character in the choice$ string to use as
the quick access character. This character uses the
highlight color.
PopUpDescriptArea SUB
Sets the location on the screen that the descriptions for the pop up
menu choices willPage 27
print. The description area is only visible if the menu is. The
background is restored after the menu is taken off the screen. For
information on how to set the menu choice descriptions see
PopUpChoiceDescript.
CALL PopUpDescriptArea(row%, col%, areaLength%, hlpFG%, hlpBG%)
row% The row to print the menu choice descriptions in.
col% The left column to print the menu choice descriptions in.
areaLength% The length of the description area.
hlpFG% Foreground color of the description area.
hlpBG% Background color of the description area.
PopUpExitKeySet SUB
Defines special keys which cause an exit from the menu while it's
visible. The keyString$ can be any ascii string such as CHR$(27) for the
ESCAPE key, or CHR$(0) + CHR$(59) for the F1 key. See your BASIC
reference manual for more details. The return key can be positive or
negative (such as -1 for the F1 key), it makes no difference. It is only
a value to let your calling program know that the key was pressed. Up to
5 exit keys can be set for each menu.
CALL PopUpExitKeySet(menu%, keyHandle%, exitKey$, returnedKey%)
menu% The number of the menu to link the exit key to. Use
the menu number defined in PopUpDefine (see Page 29).
keyHandle% A number between 1 and 5 unique to each exit key being
defined.
exitKey$ An ascii string of the key to exit on. See the remarks
below for more information.
returnedKey% Any integer number you would like the PopUpActive
FUNCTION to return when the exit key is pressed.
PopUpGetItem FUNCTIONPage 28
Returns the number of the menu choice that the scrolling highlight bar
was on when the exit from the menu occurred. Use this FUNCTION when you
need to get the menu choice that the highlight was on when an exit from
the menu was caused by anything other then the user choosing a menu
choice normally (when the user presses an exit key you defined with
PopUpExitKeySet).
variable% = PopUpGetItem
variable% Any BASIC integer variable.
PopUpPaint SUB
This SUB is used internally by the CIMENU2.LIB procedures. There is no reason
for your programs to call it directly.
PopUpPlace SUB
Defines the screen location for your pop up menus. Each menu can be set
at any location on the screen. Make sure you allow enough room for your
menu to be placed on the screen. The menus are automaticly sized using
the length of your titles and choices set in the PopUpDefine SUB. You
must use one call to this SUB for each menu you define. You can then
make as many calls to it as you need if you want to place the menu at
different locations on the screen at different times in your program.
CALL PopUpPlace(menu%, top%, left%)
menu% The number of the menu to link the screen location to.
top% The top row of the menu location.
left% The left column of the menu location.
PopUpReset SUB
Resets the variables defining a menu and erases it from the menu set
defined. Use thisPage 29
SUB if you want to redefine any of the menus at some time during your
program execution. This cleans up the variables so there is no extra
text showing up on your menus that you don't want.
CALL PopUpReset(menu%)
menu% The number of the menu you want to erase.
PopUpSoundSet SUB
Sets the sound that notifies the user if they press a wrong key or
select a disabled menu choice. If your using an AT computer make sure
you test the sound length on slower computers as well. A sound length
that works well on your computer might be a long drawn out sound on a
user of an XT.
CALL PopUpSoundSet(soundFreq%, soundLength%)
soundFreq% The tone of the sound to create (50 to 10000).
soundLength% The length that the sound will be played.
PopUpStateSet SUB
Resets the state of a menu choice in any given pop up menu in
CIMENU2.LIB. You can reset the state of the menu choices as many times
as you wish. See PopUpDefine, to initially set the state of the menu
choices.
CALL PopUpStateSet(menu%, item%, state%)
menu% The number of the menu that the item is on.
item% The number of the choice of which the state is being reset.
state% What state to set the item to. 0 = disabled, 1 = active.Page 30
CIMENU3.LIB
This library contains procedures for pop up menus. Unlike the CIMENU2.LIB pop
up menus each of these menus are defined at the time of the call and therefore
most of the menu variable definitions are not stored in memory. The exception
to this is the colors for the menus, they only have to be set once if your
using the same colors for all your menus. If your program requires a lot of
data variable space these routines allow you a menu with full mouse support
and low overhead.
Maximum number of menus Unlimited - Not held in
memory.
Maximum number of menu choices on each menu 20
All arrays passed to any SUB or FUNCTION in the CITOOLS set use a base
of 1. An example would be DIM text$(1 TO n), where n is either the
required boundary limit of the array or any number which meets your
programs needs. The following is a description of the arrays with
required boundaries for the CIMENU3.LIB tool box. The required DIM is
the statement your program must have to pass the array to the SUB or
FUNCTION.
Array SUB or FUNCTION Required DIM
________________________________________________________________________
choice$() PopMenu (1 TO 20)
descript%() PopDescript (1 TO 20)
hiPos%() PopMenu (1 TO 20)
PopColors SUB
Sets the colors for the pop up menus. Once defined the colors for the
pop up menus stay in effect until you change them with another call to
PopColors or the your program ends.
CALL PopColors(bordFGClr%, bordBGClr%, textFGClr%, textBGClr%,
titleFGClr%, titleBGClr%, hiFGClr%, hiBGClr%, disableFGCLr%,
disableHiFGClr%, hihiFGClr%, hiCharFGClr%)
bordFGClr% Foreground color for the menu border (0 to 15).
Page 31
bordBGClr% Background color for the menu border (0 to 7).
textFGClr% Foreground color for the menu text (0 to 15).
textBGClr% Background color for the menu text (0 to 7).
titleFGClr% Foreground color for the menu title (0 to 15).
titleBGClr% Background color for the menu title (0 to 7).
hiFGClr% Foreground color for the scrolling highlight bar (0 to
15).
hiBGClr% Background color for the scrolling highlight bar (0 to
7).
disableFGClr% Foreground color for the disabled menu choices (1 to
15).
disableHiFGClr% Foreground color for the disabled menu choices when
the highlight bar is on them (1 to 15).
hihiFGClr% Foreground color for the menu choice quick access
character when the highlight bar is on it.
hiCharFGClr% Foreground color for the menu choice quick access
character (1 to 15).
PopDescript SUB
Sets the pop up menu descriptions or help lines for the pop up menus in
CIMENU3.LIB. Define the menu descriptions before calling your menu to
the screen. It's not necessary to have menu descriptions if you don't
want them. The program senses if there are none defined. If you have
already used them and define another menu which you dong want menu
descriptions, use PopReset before defining your new menu.
CALL PopDescript(row%, col%, descript$(), areaLength%, hlpFG%, hlpBG%)
row% The screen row to place the description line.
col% The screen column to place the description line.
descript$() A string array of the menu descriptions.
Page 32
areaLength%The length of the area to print the menu descriptions.
hlpFG% Foreground color of the description area.
hlpBG% Background color of the description area.
PopExitKeySet SUB
Creates user defined exit keys for the pop up menus. Up to 5 different
exit keys can be set for each menu. An example ascii string would be
CHR$(27) for the ESCAPE key, or CHR$(0) + CHR$(59) for the F1 key. See
your BASIC reference manual for more details. The return values for the
exit keys are returned by the PopMenu FUNCTION as a negative value of
the key number used to define the exit key. Also note that the ESCAPE
key is always an exit key while using the pop up menus in this library
and does not have to be predefined as one.
CALL PopExitKeySet(keyHandle%, exitKey$)
keyHandle% A number between 1 and 5 which is the handle for the exit
key being defined. If the defined exit key is pressed while
the menu is active the PopMenu FUNCTION will return a
negative number of this key handle.
exitKey$ A CHR$ ascii string defining the key code of the exit key.
See remarks below for more information.
PopMenu FUNCTION
Defines and displays the pop up menu. It then takes control of the
program polling for key and mouse events. Once one takes place it passes
back the menu choice selected or the value for the exit key hit. Make
sure you allow enough room on the screen for your menu to be printed.
The width is automaticly set using the title and menu choice text you
define. If the ESCAPE key is pressed the menu is exited and returns a
value of -27. If a predefined exit key is pressed a negative number of
the key handle is passed back (see PopExitKeySet).
variable% = PopMenu(top%, left%, choice$(), hiPos%(), title$, shad%,
boxType%)
varable% Any BASIC integer varable.
Page 33
top% The top row of the menu screen location.
left% The left column of the menu screen location.
choice$() A text array holding the menu choices. Pass a dash ("-") to
print a line across the menu.
hiPos%() An integer number array holding the character positions of
the menu choice quick access characters in the choice$()
text.
title$ The menu title. Pass a null string("") if no title is
needed.
shad% A number to tell the SUB to print a drop shadow behind the
menu or not. 0 = no shadow, 1 = shadow.
boxType% An integer number which defines the type of border box to
use. 0 = no border, 1 = single line border.
PopPaint SUB
This SUB is used internally for you by the procedures. There is no reason for
your programs to call it directly.
PopReset SUB
Resets the pop up menu variables. Use the PopReset SUB to clean up the
menu variables in the CIMENU3.LIB.
CALL PopReset
Page 34
CIMENU4.LIB
This library contains the routines for creating ring or vertical menus. These
menus are great for programs which need most of the screen clear at all times
but still require a multi level menu system which the user will easily learn.
The menu choices and description or help lines can be printed on any screen
row which suits your programs needs. As with the other toolbox modules in this
CODE-IT set there is complete mouse support built in.
Maximum number of menu choices for each
menu level 10
Maximum number of menu levels 20
All arrays passed to any SUB or FUNCTION in the CITOOLS set use a base
of 1. An example would be DIM text$(1 TO n), where n is either the
required boundary limit of the array or any number which meets your
programs needs. The following is a description of the arrays with
required boundaries for the CIMENU4.LIB tool box. The required DIM is
the statement your program must have to pass the array to the SUB or
FUNCTION.
Array SUB or FUNCTION Required
DIM
________________________________________________________________________
descript$() RingDescript (1 TO 10)
RingActive FUNCTION
Takes control of the program waiting for keyboard and mouse events then
passes back the menu choice selected. Most times you will want to
highlight the first menu choice when making the menu active but the
item% parameter allows you to specify any menu choice you would like. Up
to 10 menu levels can be held in memory and ready to use at one time
with up to 10 menu choices on each menu. To first display the menu use
RingOn.
variable% = RingActive(menu%, item%)
variable% Any BASIC integer variable.
menu% The number of the menu to make active.
Page 35
item% The menu choice to highlight first.
RingColors SUB
Sets the colors for the menu choices. Once set, the color values for the
ring menus stay in effect until you change them or your program ends.
CALL RingColors(choiceFG%, choiceBG%, ringHiFG%, ringHiBG%,
ringHiCharFG%, ringHiHiCharFG%)
choiceFG% Foreground color for the menu choices (1 to 15).
choiceBG% Background color for the menu choices (1 to 7).
ringHIFG% Foreground color for the highlighted or selected menu
choice (1 to 15).
ringHiBG% Background color for the highlighted or selected menu
choice (1 to 7).
ringHiCharFG% Foreground color for the menu choice quick access
character (1 to 15).
ringHiHiCharFG% Foreground color for the menu choice quick access
character (1 to 15).
RingDefine SUB
Defines the menu information for the ring menus. Use one definition for
each menu choice in the menu level being defined. Once defined these
menus stay in memory making it easy to use them at any time during your
program. The first menu choice begins printing at column 3 on the row
you specified and each choice is spaced 2 columns apart. If your menu
choices will not fit on one row the list is truncated.
CALL RingDefine(menu%, item%, row%, choice$, hiChar%)
menu% A number between 1 and 10 which is unique for each menu
level.
item% The number of the menu choice being defined (1 to 10, left
to right on thePage 36
menu line).
row% The row to print the menu choices on.
choice$ The menu choice text.
hiChar% The number of the character inside the menu choice text of
the quick access character.
RingDescript SUB
Defines the menu choice descriptions or help lines. The menu
descriptions display anytime the menu choice is highlighted. It is not
necessary to use the menu descriptions if you don't want to, the menus
will operate without them.
CALL RingDescript(menu%, row%, col%, areaLength%, descript$(), FG%, BG%)
menu% The menu number to link the descriptions to.
row% The row to print the descriptions in.
col% The column to print the descriptions in.
areaLength% The length of the area to print the descriptions in.
descript$() A text array containing the descriptions.
FG% Foreground color for the descript area.
BG% Background color for the descript area.
RingOn SUB
Displays the menu predefined choices. The RingActive SUB will display
the menu for you so there is no need for you to use this SUB unless you
want to display a menu before you plan to call the RingActive SUB.
CALL RingOn(menu%)
Page 37
menu% The number of the menu to display.
RingSound SUB
Sets the sound the user will hear when they press an invalid key. As
with all the sound routines in the CITOOLS set, be aware that the length
of tones developed on an AT computer can seem a lot longer on an XT or
slower machine. It's wise to test your programs on a slower machine
before release.
CALL RingSound(soundFreq%, soundLength%)
soundFreq% The tone of the sound to create.
soundLength% The length to play the tone.
Page 38
CIWIND1.LIB
The CIWIND1 toolbox is a collection of routines to create data entry (edit
field) and button windows. You can combine buttons and edit fields together on
the same window if you like. Data entry can be restricted to certain keys in
the edit fields and a variety of window buttons are available.
Maximum number of windows in memory 10
NOTE: Only windows are kept in memory,
not the window buttons and edit fields.
See the SUB and FUNCTION Reference
section for more details.
Maximum number of buttons per window 60
Maximum number of edit fields per window 40
ButtonDefine SUB
Defines the window button type, actions, and text. It then prints the
button and it's prompt on the window. The best way to get a feel for
using the window buttons is to experiment with them yourself and to
examine the source code file DEMOW1.BAS.
CALL ButtonDefine(wind%, button%, state%, row%, col%, prompt$, btnType%)
wind% The number of the window to put the button on.
button% The unique number of the button being defined.
state% The initial state of the button. 0 = off, 1 = on.
row% The row relative to the top row of the window that the
button will be put at.
col% The column relative to the left column of the window that
the button will be put at.
prompt$ The text for the button prompt.
btnType% The type of button to use. Use the following values:Page 39
Number Button Type
__________________________________________________________________
1 An alert window style toggle button. The buttons are
surrounded by braces (example..<OK>) which are
highlighted if the button is on. The TAB key toggles
between the buttons.
2 A dot marker button with the dot encased in
parenthesis (example..(*) Prompt). The space button
toggles the button dot on and off.
3, 4, 5 These buttons are identical. They produce a button
which appears like a highlighted pop up menu choice
which can be used vertical or horizontally. The reason
for three sets of the same button is that the length
of the highlight. On each set it is calculated by the
length of the last prompt passed to the SUB. All
button prompts need to be padded with spaces to be the
same length (example.."Blue ", "Bright Blue").
Having different sets allow you to place vertical and
horizontal buttons on the same window. See the source
code file DEMOW1.BAS included in the CITOOLS disk set.
6 An invisible button which can be used to make any part
of the active window a "hot spot". When the left mouse
button is clicked and the mouse cursor is on this area
the window is exited as if any other button was
pressed.
ButtonGet FUNCTION
Returns the state of the button requested. Use the ButtonGet FUNCTION to
get the contents of the window buttons when the window os closed or
before crating a new window.
variable% = ButtonGet(button%)
variable% Any BASIC integer variable. Will hold a value of 0 if the
button is off and 1 if the button is on.
button% The number of the button to get the information on
(originally defined with ButtonDefine, see Page 44).
Page 40
ButtonReset SUB
Resets the button variables in CIWIND1.LIB to 0's or null strings. Use
this SUB to clean up the button variables before creating a new window.
Make sure to use the ButtonGet FUNCTION if you need the state of the
buttons before you reset them.
CALL ButtonReset
ButtonStateSet SUB
This SUB is handled automaticly for you by the other routines in the
CIWIND1.LIB. There is no reason to call it directly.
ButtonToggle SUB
Toggles the window buttons between 0 off and 1 on. Use the ButtonToggle
SUB to change the state of the buttons on the current window. The type
1, 3 and 4 buttons are automaticly handled for you in the WindowActive
SUB so it's not necessary to use this SUB for those buttons unless you
want to apply a special toggle point. For a description of the button
types see ButtonDefine.
CALL ButtonToggle(button%)
button% The number of the button to toggle. Use the same number as
used to define the button with the ButtonDefine SUB (see
Page 44).
EditFieldColors SUB
Defines the colors used for the edit field. The colors defined with SUB
effect the edit field only, not the edit field prompt.
CALL EditFieldColors(fldFGClr%, fldBGClr%)
fldFGClr% Foreground color for the edit field (1 to 15).
Page 41
fldBGClr% Background color for the edit field (1 to 7).
EditFieldDefine SUB
Defines and prints the edit fields and their prompts for the active
window. A maximum of 255 characters can be entered for each edit field.
If the length of the string defined in maxchar% is longer than the
length of the vischar% variable the edit field will scroll until it
reaches the value in maxchar%, allowing you to put large amounts of data
in a small area.
CALL EditFieldDefine(wind%, fld%, text$, row%, col%, vischar%, maxchar%,
prompt$, format%)
wind% The number of the active window to print the edit field on.
fld% The number of the edit field. Each field needs a unique
number.
text$ The initial contents for the edit field. Needs to be a
string. This text will be first printed in the edit field
area and then can be edited by selecting the field.
row% The row relative to the upper row of the window to print the
edit field and prompt on.
col% The column relative to the left column of the window to
print the edit field and prompt on.
vischar% The number of visible characters to display in the edit
field. See the remarks below for more information.
maxchar% The maximum number of characters to allow in the edit field.
See the remarks below for more information.
prompt$ The edit field prompt text.
format% A number macro which tells the data entry restrictions for
the edit field. Use the following values:
Value Entries Allowed
__________________________________________________________________
1 All printable characters.Page 42
2 Alphabetical characters only.
3 Numerical characters only (positive and negative). The
negative sign("-") can be entered anywhere in the
string and is automaticly moved to the beginning.
4 Numerical with decimal points (positive and negative).
The negative sign("-") can be entered anywhere in the
string and is automaticly moved to the beginning.
5 Same as 3 with the "-" character allowed anywhere in
the string.
6 Same as 3 with the "/" character allowed anywhere in
the string.
7 Same as 3 with the "-" and "()" characters allowed
anywhere in the string.
10 Same as 1 but outputs in all upper case.
20 Same as 2 but outputs in all upper case.
100 Same as 1 but spaces are not allowed.
110 Same as 10 but spaces are not allowed.
200 Same as 2 but spaces are not allowed.
220 Same as 20 but spaces are not allowed.
EditFieldGet FUNCTION
Returns the contents of the edit field requested. Use this SUB to get
the contents of any edit field on the active window.
variable$ = EditFieldGet(fld%)
variable$ Any BASIC string variable.
fld% The number of the edit field to get.
Page 43
WindowActive SUB
Takes control of the program processing key and mouse events on the
active window at the button or edit field given in the windItem%
variable. To get the event which caused the exit from the WindowActive
SUB use WindowEvent. The source code file DEMOW1.BAS included with the
CITOOLS set shows a full example of how to use this SUB to control your
windows.
CALL WindowActive(windItem%)
windItem% An integer number of the edit field or button to go to and
wait for a window event to take place.
WindowColors SUB
Sets the colors for the windows created using the routines in
CIWIND1.LIB. The colors set with this SUB only effect the windows for
the CIWIND1.LIB. To set the colors for the edit field data entry areas
use the EditFieldColors SUB.
CALL WindowColors(bordFGClr%, bordBGClr%, textFGClr%, textBGClr%,
titleFGCr%, titleBGClr%, hiFGClr%, hiBGClr%)
bordFGClr% Foreground color for the window border (1 to 15)
bordBGClr% Background color for the window border (1 to 7).
textFGClr% Foreground color for the window text (1 to 15).
textBGClr% Background color for the window text (1 to 7).
titleFGClr% Foreground color for the window title (1 to 15).
titleBGClr% Background color for the window title (1 to 7).
hiFGClr% Foreground color for the window buttons which use a
highlight (1 to 15).
hiBGClr% Background color for the window buttons which use a
highlighted background (1 to 7).
Page 44
WindowDefine SUB
Defines the values for a given window to be displayed using WindowOn.
Using a window number allows you to store a commonly sized and/or styled
window in memory then pull it up for many different uses without having
to redefine it. Only the window definitions defined with this SUB remain
in memory, not the buttons and edit fields. Up to 10 window definitions
can be held in memory at one time.
CALL WindowDefine(wind%, left%, right%, top%, bottom%, title$, shad%,
borderType%)
wind% A number between 1 and 10 for the window being defined.
left% The left screen column of the window.
right% The right screen column of the window.
top% The top screen row of the window.
bottom% The bottom screen row of the window.
title$ The title text for the window.If none pass a null string
(""). The title is printed in the center of the top row on
the window.
shad% A number telling the SUB to put a drop shadow behind the
window or not. 0 = no shadow, 1 = use a shadow.
borderType% A number telling the SUB the type of border to use for the
window. Use the following values:
Value Border
_______________________________________________________
0 No border.
1 A single line border.
2 A double line border.
3 A solid border.
Page 45
WindowDrawBox SUB
Draws a box anywhere in the active window. All the dimensions of the box
are defined relative to the window the box is being put on. If you
specified the top row as 2 the box will begin at the second row down
from the top of the window not the second row of the screen.
CALL WindowDrawBox(wind%, left%, right%, top%, bottom%, boxType%)
wind% The number of the active window to draw the box in.
left% The left column of the box relative to the window area not
the screen.
right% The right column of the box relative to the window not the
screen.
top% The top row of the box relative to the window not the
screen.
bottom% The bottom row of the box relative to the window not the
screen.
boxType% The type of box to print. Use the following values:
Value Box Type
__________________________________________________________________
1 A single line box.
2 A double line box.
3 A solid border box.
WindowDrawLine SUB
Draws a line horizontally across the window at the given row. The
character used to print the line can be any printable ascii character
including extended characters. To make it easier to print single or
double lines across the window the SUB will also accept two macros, "s"
for a single line and "d" for a double line.
CALL WindowDrawLine(wind%, row%, char$)
wind% The number of the window to print the line on.
row% The row relative to the top row of the window to print the
line on.Page 46
char$ The character to use when drawing the line.
WindowEvent FUNCTION
Returns the event which last occurred on the active window. It is
suggested that you look at the source code for DEMOW1.BAS included with
the CITOOLS set to get an idea of how to use this SUB to poll for window
events.
variable% = WindowEvent(switch%)
variable% Any BASIC integer variable.
switch% An integer number which defines the event to poll for.
Value Returns
________________________________________________________________________
0 The event which occurred in the window. 0 = No event
took place 1 = A mouse event took place. 2 = A
keyboard event took place.
1 The number of the button or edit field that the left
mouse button was clicked on or 100 if the mouse was
clicked on the pull down menu bar (see WindowToPull,
Page 56)
2 A macro for the key which was pressed.
1 = ENTER
2 = ESCAPE
3 = TAB
4 = SHIFT TAB
5 = UP ARROW
6 = DOWN ARROW
7 = SPACE BAR
8 = LEFT ARROW
9 = RIGHT ARROW
11 through 20 = F1 through F10
21 = HOME
22 = END
100= ALT KEY (See WindowToPull, Page 56)
Page 47
WindowOff SUB
Erases the given window from the screen restoring the original
background. Use this SUB whenever you want to close the current window
displayed with WindowOn.
CALL WindowOff(wind%)
wind% The number of the active window to erase.
WindowOn SUB
Displays the defined window on the screen. Use the WindowOn SUB to
display the window before placing buttons, edit fields, text, etc., on
it. To erase the window use WindowOff.
CALL WindowOn(wind%)
wind% The number of the defined window to display.
WindowPaint SUB
This SUB is used internally for you by the other routines in the CIWIND1.LIB.
There is no reason for you to call it directly.
WindowPrint SUB
Prints text at any given place in the active window. Use the WindowPrint
SUB to print any text in the active window other than buttons or edit
fields.
CALL WindowPrint(wind%, row%, col%, text$, style%)
wind% The number of the active window to print the text on.
row% The row relative to the top row of the window to print the
text at.
Page 48
col% The column relative to the left column of the window to
print the text at.
text$ The text to print.
style% The style format to use to print the text. Use the following
values:
Value Style
__________________________________________________________________
1 Prints the text at the given row and column. Text is
truncated if it's longer than the window.
2 Centers the text left to right in the window.
WindowSoundSet SUB
Defines the sound made when the user presses an invalid key. As with all
the sound routines included with the CITOOLS set make sure to check the
sound length on slower computers if your developing on an AT. Sometimes
a sound which works well on an AT will be very long and annoying on an
XT.
CALL WindowSoundSet(soundFreq%, soundLength%)
soundFreq% An integer number between 50 and 10,000 which defines
the tone to sound.
soundLength% The length to play the tone.
WindowToPull SUB
Allows windows to call pull down menus form CIMENU1.LIB. Setting this
switch to 1 causes a detectable exit from the data window when the ALT
key is pressed or the left mouse button is pressed while the mouse
cursor is on column 1. The calling of the pull down menu can be done
while still leaving the data window active (see the demo program
DEMOMW.BAS on the distribution disks).
CALL WindowToPull(OnOff%)
OnOff% Set to 1 to activate the calling of pull down menus,
and to 0 to turn it off.Page 49
CIWIND2.LIB
This is really a specialty window toolbox. The windows in this set allow a
great user interface for getting information from the user at very minimal
code. They include alert windows, scrolling list windows, scrolling tag
windows, and text windows.
All arrays passed to any SUB or FUNCTION in the CITOOLS set use a base
of 1. An example would be DIM text$(1 TO n), where n is either the
required boundary limit of the array or any number which meets your
programs needs. The following is a description of the arrays with
required boundaries for the CIMENU2.LIB tool box. The required DIM is
the statement your program must have to pass the array to the SUB or
FUNCTION.
Array SUB or FUNCTION Required DIM
________________________________________________________________________
The arrays in the CIWIND2.LIB take on the same upper dimensions as the
arrays you pass to them. The only requirement is that they have a base
of 1. See above paragraph for details.
AlertWindow FUNCTION
Puts an alert window on the screen and waits for the user to select a
button. It then erases the window and passes back the number of the
button that was pressed. The alert window is automaticly sized for you
using the length of the longest member in the text$() array. Up to three
buttons can be defined. The buttons are toggle buttons printed at the
bottom of the window and the chosen button is indicated by it's braces
("< OK >") being highlighted. The TAB key toggles the buttons and the
ENTER key accepts the currently highlighted button. If the user has a
mouse they can also select any of the buttons by clicking the left
button while the mouse cursor is on it.
variable% = AlertWindow(top%, left%, text$(), title$, shad%, boxType%,
btn1$, btn2$, btn3$, FG%, BG%, HiFG%)
variable% Any BASIC integer variable name.
top% The top screen row to print the window at.
left% The left screen column to print the window at.
Page 50
text$() An array of the text to display in the window. Text is left
justified in the window. To center the text in the window
place a "|" character at the end of the text string in the
array.
title$ The title string to print on the window. Use a null string
("") if you don't want a title.
shad% A number telling if a drop shadow is to be printed behind
the window. 0 = no shadow, 1 = use a shadow.
boxType% A number which defines the type of border box to put on the
window. 0 = no border box, 1 = a single line box, 2 = a
double line box.
btn1$, btn2$, btn3$Text for the buttons.
FG% Foreground color for the window.
BG% Background color for the window.
HiFG% Foreground color for the button highlights.
ScrollWindow FUNCTION
Places a scrolling list window on the screen. By using the arrows the
user can scroll through the text in the window and select a choice. The
number of the selected array member is passed back. The scrolling list
window acts similar to a pop up menu in that you use the arrow keys to
scroll through the choices of text lines. Unlike pop up menus though you
can use choice or text lists longer than will fit in the window and
scroll the list down or up in the window accordingly. When ENTER is
pressed the number of the highlighted array member (from the list$()
array) os passed back to the program. If ESCAPE is pressed a value of 0
is passed back.
variable% = ScrollWindow(left%, right%, top%, bottom%, list$(), title$,
shad%, boxType%, FG%, BG%, HiFG%, HiBG%)
variable% Any BASIC integer variable.
left% The left screen column of the list window.
right% The right screen column of the list window.
Page 51
top% The top screen row of the list window.
bottom% The bottom screen row of the list window.
list$() A text array with the strings to display in the list window.
Each member is printed on a separate line.
title$ The title string for the window. It will print in the center
of the top row.
shad% A number telling the FUNCTION to print a drop shadow behind
the window or not. 0 = no shadow, 1 = use a shadow.
boxType% A number describing the type of border box to use. 0 = none,
1 = a single line border box, 2 = a double line border box.
FG% Foreground color of the list window.
BG% Background color of the list window.
HiFG% Foreground color for the scrolling highlight bar.
HiBG% Background color for the scrolling highlight bar.
TagWindow FUNCTION
Places a scrolling list window on the screen. The user scrolls through
the list using the arrow keys and can tag the items in the window using
the space bar. It returns the key which was pressed to exit from the tag
window (1 = ENTER, 2 = ESCAPE). The list$() and tagList%() arrays need
to be dimentiond the same and use a base of 1 (ie: list$(1 TO n) where n
is any number your program needs). The tagList%() array members hold
either a 0 or a 1 indicating if the item is tagged or not (0 = not
tagged, 1 = tagged) and the member corresponds to the same member in the
list$() array. Example: if tagList%(10) = 1 then list$(10) has been
tagged by the user. See the DEMOW2.BAS source code file for an example
of the TagWindow FUNCTION.
variable% = TagWindow(left%, right%, top%, bottom%, list$(), title$,
shad%, boxType%, FG%, BG%, HiFG%, HiBG%, tagList%(), tagChar$)
variable% Any BASIC integer variable.
left% The left screen column of the list window.
Page 52
right% The right screen column of the list window.
top% The top screen row of the list window.
bottom% The bottom screen row of the list window.
list$() A text array with the strings to display in the list window.
Each member is printed on a separate line.
title$ The title string for the window. It will print in the center
of the top row.
shad% A number telling the FUNCTION to print a drop shadow behind
the window or not. 0 = no shadow, 1 = use a shadow.
boxType% A number describing the type of border box to use. 0 = none,
1 = a single line border box, 2 = a double line border box.
FG% Foreground color of the list window.
BG% Background color of the list window.
HiFG% Foreground color for the scrolling highlight bar.
HiBG% Background color for the scrolling highlight bar.
tagList%() An integer array that serves two purposes. First, when the
FUNCTION is called this can contain the array members to
initially display tagged. Second, when the window is exited
this array will contain the updated tag members. See Remarks
below for details on arrays.
tagChar$ The character to display beside a tagged item in the window.
This can be any printable ascii character.
TextWindow SUB
Puts a window displaying text on the screen such as a help window. The
text window is automaticly sized using title or the longest member in
the text$() array. If the saveSwitch% has a value of 1 the window pauses
and waits for the user to press a key or mouse button. Pressing any key
or the left mouse button causes an exit from the window. Using the
saveSwitch% you can determine when and if the window is to be visible.
To manually save and restore the screen area use the ScreenSave andPage 53
ScreenRestore SUB's in the CITOOLS.LIB.
CALL TextWindow(top%, left%, text$(), title$, shad%, boxType%,
saveSwitch%, FG%, BG%)
top% The top screen row of the window.
left% The left screen column of the window.
text$() An array of the text to display in the window. By default
the text is left justified. Use a "|" character as the last
character in the array member string to center the line left
to right in the window.
title$ A string of the title to display centered on the top row.
Pass a null string ("") if no title is needed.
shad% A number telling the SUB if a drop shadow is to be printed
behind the window or not. 0 = no shadow, 1 = use a shadow.
boxType% The type of border box to use. 0 = none, 1 = a single line,
2 = a double line.
saveSwitch% An number telling the SUB if you want the window area to be
saved before the window is displayed and restored when the
SUB is exited. 0 = don't save and restore, 1 = save and
restore.
FG% Foreground color for the text window.
BG% Background color for the text window.