home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Education Master 1994 (4th Edition)
/
EDUCATIONS_MASTER_4TH_EDITION.bin
/
files
/
progasic
/
coditqb2
/
ci.doc
next >
Wrap
Text File
|
1991-06-17
|
154KB
|
3,606 lines
CODE-IT Menus & Windows
Copyright (C) 1991, 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(r)
QuickBASIC 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 manual
* The most recent version of the program
* 2 free updates
* 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 - no questions
asked.
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.
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.
You can call us or write us at:
Clear Software
14962 Bear Valley Rd. Ste. G
Victorville, CA 92392
Telephone (619)243-4749 FAX (619)241-3256
Copyright(C) 1991, Clear Software
All Rights Reserved.
About CODE-IT................................................. 1
Getting Started............................................... 3
Installation............................................. 3
Creating Libraries....................................... 4
Using Libraries.......................................... 6
INCLUDE Files............................................ 6
Demo Programs............................................ 7
CITOOLS.LIB................................................... 9
AdapterSet............................................... 9
AdapterType.............................................. 9
AltConvert............................................... 9
AttrChange............................................... 10
DrawBox.................................................. 11
ScreenPaint.............................................. 11
ScreenRestore............................................ 12
ScreenSave............................................... 13
ScrollArea............................................... 13
ShiftStateNow............................................ 14
WindowPut................................................ 15
CIMOUSE.LIB................................................... 17
MouseDriver.............................................. 17
MouseHide................................................ 17
MouseInit................................................ 17
MouseLimit............................................... 18
MousePoll................................................ 18
MouseShow................................................ 19
CIMENU1.LIB................................................... 20
Limits And Considerations................................ 20
PullDownActive........................................... 20
PullDownColors........................................... 20
PullDownDefine........................................... 21
PullDownDescript......................................... 22
PullDownDescriptArea..................................... 23
PullDownInfo............................................. 23
PullDownPaint............................................ 24
PullDownPoll............................................. 24
PullDownSoundSet......................................... 25
PullDownStateSet......................................... 25
PullDownTitleDescript.................................... 26
PullDownTitleOn.......................................... 26
CIMENU2.LIB................................................... 27
Limits and Considerations................................ 27
PopUpActive.............................................. 27
PopUpChoiceDescript...................................... 28
PopUpColors.............................................. 28
PopUpDefine.............................................. 29
PopUpDescriptArea........................................ 30
PopUpExitKeySet.......................................... 31
PopUpGetItem............................................. 31
PopUpPaint............................................... 32
PopUpPlace............................................... 32
PopUpReset............................................... 32
PopUpSoundSet............................................ 33
PopUpStateSet............................................ 33
CIMENU3.LIB................................................... 35
Limits and Considerations................................ 35
PopColors................................................ 35
PopDescript.............................................. 36
PopExitKeySet............................................ 37
PopMenu.................................................. 38
PopPaint................................................. 38
PopReset................................................. 39
CIMENU4.LIB................................................... 40
Limits And Considerations................................ 40
RingActive............................................... 40
RingColors............................................... 41
RingDefine............................................... 41
RingDescript............................................. 42
RingOn................................................... 43
RingSound................................................ 43
CIWIND1.LIB................................................... 44
Limits and Considerations................................ 44
ButtonDefine............................................. 44
ButtonGet................................................ 45
ButtonReset.............................................. 46
ButtonStateSet........................................... 46
uttonToggle.............................................. 46
EditFieldColors.......................................... 47
EditFieldDefine.......................................... 47
EditFieldGet............................................. 49
WindowActive............................................. 49
WindowColors............................................. 50
WindowDefine............................................. 51
WindowDrawBox............................................ 52
WindowDrawLine........................................... 52
WindowEvent.............................................. 53
WindowOff................................................ 54
WindowOn................................................. 54
WindowPaint.............................................. 55
WindowPrint.............................................. 55
WindowSoundSet........................................... 56
CIWIND2.LIB................................................... 57
Limits and Considerations................................ 57
AlertWindow.............................................. 57
ScrollWindow............................................. 58
TagWindow................................................ 59
TextWindow............................................... 61
Page 1
About CODE-IT
CODE-IT Menus & Windows 2.0 is a flexible user interface library
set for use with the Microsoft(r) BASIC language. The libraries
work with QuickBASIC 4.5 and BASIC PDS 7.x and above.
CODE-IT 2.0 includes a combined library (CIALL.LIB and QLB) and 8
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 royaltee 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:
* A printed manual.
* The latest version of the tool box libraries.
* 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.
At Clear Software, your satisfaction is our number one priority.
Page 2
The cost to purchase a registered version is $59.00 (U.S.) for either
the QuickBASIC or the BASIC PDS system. Or you can register both
versions at the same time for $79.00!
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 6.5%
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 mentiond 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(r) 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
your feelings about 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
Installation can be done in two ways. First you can just copy all
the library files to your disk using the DOS copy command.
Second, you can use the install program that comes on the disks
to copy the needed files for you (this is the recommended way).
The install program allows you to specify the directory to put
the files in and will create the directory if needed. The
following will help you in the installation of the CITOOLS set
using the install program.
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:CIINSTAL" 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 the install program and CITOOLS. After
reading the message press any key to continue.
3) Your now at the install control screen. The window at the
top displays the default drive of the source or "from" drive
(the drive that the installation disk is in) and the default
drive and directory to install the library and document
files to, the "to" path. Below that is the control menu. If
the default selections are alright then skip to section 4,
otherwise use the following to make any corrections needed.
To change the "From" drive:
Use the ARROW keys to highlight the menu choice "Change
Install From Drive" (or press the "T" quick access key) and
press ENTER. Use the editing keys (backspace, del, ect...)
to enter the correct drive and press ENTER.
To change the "To" path:
Use the ARROW keys to highlight the menu choice "Change
Install Form Path" (or press the "F" quick access key) and
press ENTER. Use the editing keys (backspace, del, ect...)
to enter the correct path and press ENTER.
4) Once all the path and drive are correct, use the ARROW keys
to highlight the menu choice "Install With Current Options"
(or press the "I" quick access key) and press ENTER. If the
"To" drive you gave does not exist CIINSTAL will prompt you
for a confirmation before creating it. The program prompts
you to make sure the correct disk is in the install "From"
drive. On multiple disk sets other windows will pop up and
tell you which disk to put in the drive next. When the file
installation is complete another window pops up to let you
know. Press any key to continue.
Page 4
5) Once again you are at the control menu. Use the ARROW keys
to highlight the menu choice "Exit" (or press the "x" quick
access key) to end the installation program.
That's It. The files are now installed and ready to use. The next
section will help you build the libraries and decide which files
you will want to include in them.
Creating Libraries
The tools are separated into several individual library files.
This allows you to build custom run time and quick libraries for
use with your programs without having to include unused code.
This is helpfull if memory is a concern, and you need as small a
quick library as posible. 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 contaning 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
CITOOL 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.
Page 5
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 creating 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
TRACK-IT Library Management System use it to create the libraries
for you. The database of TRACK-IT will also help you keep track
of the separate library modules you used to create the combined
libraries.
If you don't have the TRACK-IT 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 TRACK-IT
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:
LIB CINEW.LIB+CITOOLS.LIB+CIMOUSE.LIB+CIMENU1.LIB;
Creates a stand alone or linkable library called CINEW.LIB
which contains the CITOOLS, CIMOUSE, and CIMENU1 libraries.
Quick Library - QuickBASIC
LINK /Q CITOOLS.LIB CIMOUSE.LIB CIMENU1.LIB, CINEW.QLB,,
BQLB45.LIB;
Creates a quick library for use with QuickBASIC 4.5 out of
the CITOOLS, CIMOUSE, and the CIMENU1 libraries.
Page 6
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, 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(r). 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(r)
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. The 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.
Page 7
If you used the install program included with the CODE-IT set,
the files are already installed for you. If you copied the files
from the disk yourself, and did not copy the "BI" files, you must
do so before using the tool box libraries or demo programs. 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.
2) Your quick library is loaded properly. You might have to
exit and reload the quick library if your not sure. Page 8
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.
SUB and FUNCTION Reference
_________________________________________________________________
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
Action:
Returns a string representing the type of video adapter
on the users system.
Example Syntax:
variable$ = AdapterType$
variable% Any BASIC variable of type string.
Remarks:
The following strings are returned....
"MDPA"
"CGA"
"ColorEGA"
"MonoVGA"
"ColorVGA"
"MonoMCGA"
"ColorMCGA"
_________________________________________________________________
AltConvert FUNCTION
Action:
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.
Page 10
Example Syntax:
variable$ = AltConvert(kb$)
variable$ Any BASIC variable of type string.
kb$ The key press character of the "Alt + ascii"
keys pressed.
Remarks:
The AltConvert FUNCTION is an easy way to determine a
specific keypress if an alt key combination could be
used. Simply put, when a key press value is passed, the
value returned is as if the user never pressed the alt
key.
_________________________________________________________________
AttrChange SUB
Action:
Changes the color attributes of a given area of the
screen without altering the contents.
Example Syntax:
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)
Remarks:
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 re-print the screen area.
Page 11
_________________________________________________________________
DrawBox SUB
Action:
Draws a single, double, or solid line box around a
given area of the screen.
Example Syntax:
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.
boxType% The type of box to draw. Use the following
values:
Value Action
_______________________________________________________
1 Draws a single line box.
2 Draws a double line box.
3 Draws a solid border box using the current
background color.
Remarks:
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.
_________________________________________________________________
ScreenPaint SUB
Action:
Paints a given area of the screen with any printable
ascii character.
Page 12
Example Syntax:
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.
Remarks:
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 Cntl
keys while typing the ascii character code 177 then
enclose the resulting character in quotes ("").
_________________________________________________________________
ScreenRestore SUB
Action:
Restores an area of the screen previously saved by the
ScreenSave SUB.
Example Syntax:
ScreenRestore left%, right%, top%, bottom%, scrnNum%
left% Left column of the area to be restored.
right% Right column of the area to be restored.
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).
Page 13
Remarks:
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.
_________________________________________________________________
ScreenSave SUB
Action:
Saves an area of the screen in memory.
Example Syntax:
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.
Remarks:
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.
_________________________________________________________________
ScrollArea SUB
Action:
Scrolls an area of the screen up or down a given number
of columns leaving the remaining area of the screen in
tact.
Example Syntax:
Page 14
ScrollArea left%, right%, top%, bottom%, lines%,
newColorBG%
left% Left column of the scroll area.
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).
Remarks:
When the screen is scrolled blank lines newly created
are given the background color attribute of the
newColorBG% variable.
_________________________________________________________________
ShiftStateNow FUNCTION
Action:
Returns the state of the given extended key at the time
of the call.
Example Syntax:
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 pressed
or 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:
Page 15
Value Action
_______________________________________________________
0 Right Shift key.
1 Left Shift key.
2 Ctrl key.
3 Alt key.
4 Scroll Lock key.
5 Num Lock key.
6 Caps Lock key.
7 Insert key.
Remarks:
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.
_________________________________________________________________
WindowPut SUB
Action:
Puts a window on the screen at a given location.
Example Syntax:
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.
Page 16
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).
Remarks:
Although the CITOOLS set contains several full featured
window routines, this SUB was included to allow you
greater flexability in designing your programs.
Page 17
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(r) 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. See MouseInit, page 17,for more details.
SUB and FUNCTION Reference
_________________________________________________________________
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
Action:
Hides the mouse cursor.
Example Syntax:
MouseHide
Remarks:
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.
_________________________________________________________________
MouseInit SUB
Action:
Initializes the mouse driver so the other SUB's can
access it's functions.
Page 18
Example Syntax:
MouseInit
Remarks:
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.
_________________________________________________________________
MouseLimit SUB
Action:
Limits the area of the screen that the mouse cursor can
move in.
Example Syntax:
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.
Remarks:
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.
_________________________________________________________________
MousePoll SUB
Action:
Polls the mouse driver and returns the current row and
column of the mouse and the states of the mouse
buttons.
Page 19
Example Syntax:
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).
Remarks:
Use the MousePoll SUB in a loop to continually poll for
a mouse event.
_________________________________________________________________
MouseShow SUB
Action:
Makes the mouse cursor visible.
Example Syntax:
MouseShow
Remarks:
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 (see MouseHide, page 17).
Page 20
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.
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)
SUB and FUNCTION Referance
_________________________________________________________________
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 (see PullDownPoll, page 24). This SUB
is handled internally by the CIMENU1.LIB.
_________________________________________________________________
PullDownColors SUB
Action:
Sets or changes the colors for the pull down menus.
Example Syntax:
PullDownColors bordFGClr%, bordBGClr%, textFGClr%,
textBGClr%,
Page 21
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).
Remarks:
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 21.
_________________________________________________________________
PullDownDefine SUB
Action:
Sets the pull down menu titles, choices, access
characters, and initial states of choices or titles.
Page 22
Example Syntax:
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.
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").
Remarks:
For an example of the PullDownDefine SUB see the source
code examples later in this manual or the DEMMENU1.BAS
souce code file on your disks.
_________________________________________________________________
PullDownDescript SUB
Action:
Defines the description or help line for the pull down
menu choices.
Example Syntax:
PullDownDescript menu%, descript$()
menu% An integer number describing the menu title
to link the descriptions to.
Page 23
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.
Remarks:
The description, sometimes called help 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, page 23.
_________________________________________________________________
PullDownDescriptArea SUB
Action:
Defines the screen placement of the pull down menu
title and choice descriptions.
Example Syntax:
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.
Remarks:
The area for the menu descriptions is automaticly saved
and restored on exit from the pull down menus. This
allows you to choose if the description area is to be
on the screen at all times or not. The menu descript
area can contain 1 line up to 80 characters in length.
_________________________________________________________________
PullDownInfo FUNCTION
Action:
Polls the pull down global variables to determine if a
menu was chosen and if
Page 24
so a second call can be made to determine which menu or
item.
Example Syntax:
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.
Remarks:
The PullDownInfo FUNCTION is used whenever you want to
see if a menu has been chosen, which menu, and finally
to see what menu choice the user has selected. 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 (DEMMENU1.BAS).
_________________________________________________________________
PullDownPaint SUB
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
automaticly for you by the toolbox.
_________________________________________________________________
PullDownPoll FUNCTION
Action:
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 (See PullDownActive, page 20). If a key press took
place which was not a menu event the character for the
key press is passed back.
Page 25
Example Syntax:
variable$ = PullDownPoll$
variable$ Any BASIC variable of type string.
Remarks:
The PullDownPoll FUNCTION acts like a BASIC INKEY$
statement but it also checks for menu events.
_________________________________________________________________
PullDownSoundSet SUB
Action:
Sets the pull down menu sound which alerts the user of
a wrong key press.
Example Syntax:
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.
Remarks:
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.
_________________________________________________________________
PullDownStateSet SUB
Action:
Toggles the state of a menu title or pull down menu
choice between active and disabled.
Example Syntax:
PullDownStateSet menu%, item%, state%
menu% The number of the menu title to link the
change to.
Page 26
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.
Remarks:
Use the same values for the menu% and item% variables
as were originally defined with the PullDownDefine SUB
(see PullDownDefine, page 21). Disabled titles will not
display their pull down menu. Disabled items can not be
selected.
_________________________________________________________________
PullDownTitleDescript SUB
Action:
Sets the description (sometimes called help line) for
the menu titles when no pull down menus are being
shown.
Example Syntax:
PullDownTitleDescript descript$
descript$ A string holding the descript line to be
displayed.
Remarks:
The description is displayed using the values set with
the PullDownDescriptArea SUB (see PullDownDescriptArea,
page 23). Use this option to display key descriptions
for your menu title bar (ie: ENTER=Menu, ESC=Cancel,
ect..).
_________________________________________________________________
PullDownTitleOn SUB
Action:
Makes the defined menu title bar visible.
Example Syntax:
PullDownTitleOn
Remarks:
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.
Page 27
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 (see page 20). 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 page 35. As with the
rest of the menus in the toolbox full mouse support is built in.
Limits and Considerations
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)
SUB and FUNCTION Reference
_________________________________________________________________
PopUpActive FUNCTION
Action:
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 ext.
Example Syntax:
variable% = PopUpActive(menu%)
variable% Any BASIC variable of type integer.
Page 28
menu% An integer number which is the menu to be
used (defined in PopUpDefine page 28).
Remarks:
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.
_________________________________________________________________
PopUpChoiceDescript SUB
Action:
Sets the pop up menu description or help line text for
any given menu.
Example Syntax:
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.
Remarks:
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. For
information on the placement and colors of the
description area see PopUpDescriptArea page 30.
_________________________________________________________________
PopUpColors SUB
Action:
Sets the colors for the pop up menus.
Example Syntax:
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.
Page 29
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).
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).
Remarks:
Each individual pop up menu defined with the
PopUpDefine (see page 29) can have its own color
values. These colors stay in effect until you change
them or your program ends.
_________________________________________________________________
PopUpDefine SUB
Action:
Defines the menu titles and choices for your pop up
menus.
Example Syntax:
PopUpDefine menu%, item%, state%, choice$, hiChar%
Page 30
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 is also highlighted (see
PopUpColors page 28).
Remarks:
Use one call for each menu title or choice being
defined. To reset the menu choice state after the menu
has been defined use the PopUpStateSet SUB (see page
33). Pass a dash ("-") for the menu choice to print a
line across the menu.
_________________________________________________________________
PopUpDescriptArea SUB
Action:
Sets the location on the screen that the descriptions
for the pop up menu choices will print.
Example Syntax:
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.
Remarks:
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
Page 31
choice descriptions see PopUpChoiceDescript page 27.
_________________________________________________________________
PopUpExitKeySet SUB
Action:
Defines special keys which cause an exit from the menu
while it's visible.
Example Syntax:
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.
Remarks:
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.
_________________________________________________________________
PopUpGetItem FUNCTION
Action:
Returns the number of the menu choice that the
scrolling highlight bar was on when the exit from the
menu occurred.
Example Syntax:
variable% = PopUpGetItem
Page 32
variable% Any BASIC integer variable.
Remarks:
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 page 31).
_________________________________________________________________
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
Action:
Defines the screen location for your pop up menus.
Example Syntax:
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.
Remarks:
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 (see page 29). 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.
_________________________________________________________________
PopUpReset SUB
Page 33
Action:
Resets the variables defining a menu and erases it from
the menu set defined.
Example Syntax:
PopUpReset menu%
menu% The number of the menu you want to erase.
Remarks:
Use this 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.
_________________________________________________________________
PopUpSoundSet SUB
Action:
Sets the sound that notifies the user if they press a
wrong key or select a disabled menu choice.
Example Syntax:
PopUpSoundSet soundFreq%, soundLength%
soundFreq%The tone of the sound to create (50 to
10000).
soundength%The length that the sound will be played.
Remarks:
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.
_________________________________________________________________
PopUpStateSet SUB
Action:
Resets the state of a menu choice in any given pop up
menu in CIMENU2.LIB.
Example Syntax:
PopUpStateSet menu%, item%, state%
menu% The number of the menu that the item is on.
Page 34
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.
Remarks:
You can reset the state of the menu choices as many
times as you wish. See PopUpDefine, page 29, to
initially set the state of the menu choices.
Page 35
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.
Limits and Considerations
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)
SUB and FUNCTION Reference
_________________________________________________________________
PopColors SUB
Action:
Sets the colors for the pop up menus.
Example Syntax:
PopColors bordFGClr%, bordBGClr%, textFGClr%,
textBGClr%, titleFGClr%, titleBGClr%, hiFGClr%,
hiBGClr%, disableFGCLr%, disableHiFGClr%, hihiFGClr%,
hiCharFGClr%
Page 36
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 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).
Remarks:
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.
_________________________________________________________________
PopDescript SUB
Action:
Sets the pop up menu descriptions or help lines for the
pop up menus in CIMENU3.LIB.
Example Syntax:
PopDescript row%, col%, descript$(), areaLength%,
hlpFG%, hlpBG%
Page 37
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.
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.
Remarks:
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 the PopReset SUB (see page 39) before
defining your new menu.
_________________________________________________________________
PopExitKeySet SUB
Action:
Creates user defined exit keys for the pop up menus.
Example Syntax:
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 (see page 38)
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.
Remarks:
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 (see page 38) as a negative value of
the key number used to define the exit key. Also note
that the ESCAPE key is allways an exit key while using
the pop up menus in this
Page 38
library and does not have to be predefined as one.
_________________________________________________________________
PopMenu FUNCTION
Action:
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.
Example Syntax:
varable% = PopMenu top%, left%, choice$(), hiPos%(), title$,
shad%, boxType%
varable% Any BASIC integer varable.
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.
Remarks:
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 returs a
value of -27. If a predefined exit key is pressed a
negative number of the key handle is passed back (see
PopExitKeySet, page 37).
_________________________________________________________________
PopPaint SUB
Page 39
This SUB is used internally for you by the procedures. There is
no reason for your programs to call it directly.
_________________________________________________________________
PopReset SUB
Action:
Resets the pop up menu variables.
Example Syntax:
PopReset
Remarks:
Use the PopReset SUB to clean up the menu variables in
the CIMENU3.LIB.
Page 40
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.
Limits And Considerations
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)
SUB and FUNCTION Reference
_________________________________________________________________
RingActive FUNCTION
Action:
Takes control of the program waiting for keyboard and
mouse events then passes back the menu choice selected.
Example Syntax:
variable% = RingActive(menu%, item%)
variable% Any BASIC integer variable.
menu% The number of the menu to make active.
Page 41
item% The menu choice to highlight first.
Remarks:
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,
page 43.
_________________________________________________________________
RingColors SUB
Action:
Sets the colors for the menu choices.
Example Syntax:
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).
Remarks:
Once set, the color values for the ring menus stay in
effect until you change them or your program ends.
_________________________________________________________________
RingDefine SUB
Action:
Page 42
Defines the menu information for the ring menus.
Example Syntax:
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 the 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.
Remarks:
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.
_________________________________________________________________
RingDescript SUB
Action:
Defines the menu choice descriptions or help lines.
Example Syntax:
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.
Page 43
FG% Foreground color for the descript area.
BG% Background color for the descript area.
Remarks:
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.
_________________________________________________________________
RingOn SUB
Action:
Displays the menu predefined choices.
Example Syntax:
RingOn menu%
menu% The number of the menu to display.
Remarks:
The RingActive SUB (page 40) automaticly displays 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.
_________________________________________________________________
RingSound SUB
Action:
Sets the sound the user will hear when they press an
invalid key.
Example Syntax:
RingSound soundFreq%, soundLength%
soundFreq% The tone of the sound to create.
soundLength% The length to play the tone.
Remarks:
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.
Page 44
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.
Limits and Considerations
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
SUB and FUNCTION Reference
_________________________________________________________________
ButtonDefine SUB
Action:
Defines the window button type, actions, and text. It
then prints the button and it's prompt on the window.
Example Syntax:
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.
Page 45
prompt$ The text for the button prompt.
btnType% The type of button to use. Use the following
values:
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.
Remarks:
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. To run the demo program
inside the BASIC environment you'll need to create a
quick library including the CITOOLS.LIB, CIMOUSE.LIB,
CIWIND1.LIB and QB.LIB for QuickBASIC or QBX.LIB for
BASIC 7.x library files.
_________________________________________________________________
ButtonGet FUNCTION
Action:
Returns the state of the button requested.
Page 46
Example Syntax:
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).
Remarks:
Use the ButtonGet FUNCTION to get the contents of the
window buttons when the window os closed or before
crating a new window.
_________________________________________________________________
ButtonReset SUB
Action:
Resets the button variables in CIWIND1.LIB to 0's or
null strings.
Example Syntax:
ButtonReset
Remarks:
Use this SUB to clean up the button variables before
creating a new window. Make sure to use the ButtonGet
FUNCTION (see 46) if you need the state of the buttons
before you reset them.
_________________________________________________________________
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
Action:
Toggles the window buttons between 0 off and 1 on.
Example Syntax:
ButtonToggle button%
button% The number of the button to toggle. Use the
same number as
Page 47
used to define the button with the
ButtonDefine SUB (see page 44).
Remarks:
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 (see page 49) 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 page 44.
_________________________________________________________________
EditFieldColors SUB
Action:
Defines the colors used for the edit field.
Example Syntax:
EditFieldColors fldFGClr%, fldBGClr%
fldFGClr% Foreground color for the edit field (1 to
15).
fldBGClr% Background color for the edit field (1 to 7).
Remarks:
The colors defined with SUB effect the edit field only,
not the edit field prompt (see EditFieldDefine page
47).
_________________________________________________________________
EditFieldDefine SUB
Action:
Defines and prints the edit fields and their prompts
for the active window.
Example Syntax:
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
Page 48
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.
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.
Page 49
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.
210 Same as 20 but spaces are not allowed.
Remarks:
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.
_________________________________________________________________
EditFieldGet FUNCTION
Action:
Returns the contents of the edit field requested.
Example Syntax:
variable$ = EditFieldGet(fld%)
variable$ Any BASIC string variable.
fld% The number of the edit field to get.
Remarks:
Use this SUB to get the contents of any edit field on
the active window.
_________________________________________________________________
WindowActive SUB
Action:
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.
Example Syntax:
WindowActive windItem%
Page 50
windItem% An integer number of the edit field or button
to go to and wait for a window event to take
place.
Remarks:
To get the event which caused the exit from the
WindowActive SUB use WindowEvent (see page 53). 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.
_________________________________________________________________
WindowColors SUB
Action:
Sets the colors for the windows created using the
routines in CIWIND1.LIB.
Example Syntax:
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).
Remarks:
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,
page 47.
Page 51
_________________________________________________________________
WindowDefine SUB
Action:
Defines the values for a given window to be displayed
using WindowOn (see page 54).
Example Syntax:
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.
Remarks:
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
Page 52
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.
_________________________________________________________________
WindowDrawBox SUB
Action:
Draws a box anywhere in the active window.
Example Syntax:
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.
Remarks:
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.
_________________________________________________________________
WindowDrawLine SUB
Page 53
Action:
Draws a line horizontally across the window at the
given row.
Example Syntax:
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.
char$ The character to use when drawing the line.
Remarks:
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. The line is printed across the window with the
correct characters automaticly used for the ends of the
line to connect it to the already existing border. If
there is no border then the line prints fully across
the window.
_________________________________________________________________
WindowEvent FUNCTION
Action:
Returns the event which last occurred on the active
window.
Example Syntax:
variable% = WindowEvent(switch%)
variable% Any BASIC integer variable.
switch% An integer number which defines the event to
poll for. Use the following values:
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
Page 54
button was clicked on.
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
Remarks:
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.
_________________________________________________________________
WindowOff SUB
Action:
Erases the given window from the screen restoring the
original background.
Example Syntax:
WindowOff wind%
wind% The number of the active window to erase.
Remarks:
Use this SUB whenever you want to close the current
window displayed with the WindowOn SUB (see page 54).
_________________________________________________________________
WindowOn SUB
Action:
Displays the defined window on the screen.
Page 55
Example Syntax:
WindowOn wind%
wind% The number of the defined window to display.
Remarks:
Use the WindowOn SUB to display the window before
placing buttons, edit fields, text, ect., on it. To
erase the window use the WindowOff SUB (see page 54).
_________________________________________________________________
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
Action:
Prints text at any given place in the active window.
Example Syntax:
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.
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:
Page 56
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.
Remarks:
Use the WindowPrint SUB to print any text in the active
window other than buttons or edit fields.
_________________________________________________________________
WindowSoundSet SUB
Action:
Defines the sound made when the user presses an invalid
key.
Example Syntax:
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.
Remarks:
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.
Page 57
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.
Limits and Considerations
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.
SUB and FUNCTION Reference
_________________________________________________________________
AlertWindow FUNCTION
Action:
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.
Example Syntax:
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.
text$() An array of the text to display in the
window. Text is left
Page 58
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.
Remarks:
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.
_________________________________________________________________
ScrollWindow FUNCTION
Action:
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.
Example Syntax:
variable% = ScrollWindow(left%, right%, top%, bottom%,
list$(), title$, shad%, boxType%, FG%, BG%, HiFG%,
HiBG%)
Page 59
variable% Any BASIC integer variable.
left% The left screen column of the list window.
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.
Remarks:
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.
_________________________________________________________________
TagWindow FUNCTION
Action:
Places a scrolling list window on the screen. The user
scrolls through the list
Page 60
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).
Example Syntax:
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.
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
Page 61
for details on arrays.
tagChar$ The character to display beside a tagged item
in the window. This can be any printable
ascii character.
Remarks:
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.
_________________________________________________________________
TextWindow SUB
Action:
Puts a window displaying text on the screen such as a
help window.
Example Syntax:
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
Page 62
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.
Remarks:
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 (page
13) and ScreenRestore (page 12) SUB's in the
CITOOLS.LIB.
INDEX
CIMENU1.LIB 4, 20
CIMENU2.LIB 5, 27
CIMENU3.LIB 5, 35
CIMENU4.LIB 5, 40
CIMOUSE.LIB 4, 17
CITOOLS.LIB 4, 9
CIWIND1.LIB 5, 44
CIWIND2.LIB 5, 57
Demo Programs 7
Include Files 6
Installation 3
Library
creating 4
descriptions and related files 4
include files used with 6
installing from disk 3
introduction 1
quick libraries 5
quick library, BASIC PDS 6
quick library, QuickBASIC 5
stand alone libraries 5
third party 6
TRACK-IT Library Management System 5
using 6
using with demo programs 7
Quick Libraries
use with demo programs 7
Quick Library
BASIC PDS 6
creating 4, 5
QuickBASIC 5
Shareware
descripton of 1
registration 2
TRACK-IT 5