home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
basic
/
library
/
pb
/
qbox10
/
readme.doc
< prev
next >
Wrap
Text File
|
1992-01-22
|
4KB
|
81 lines
QuickBox: V1.0 Copyright (c) 1992 Business Enhancement Partnership Group
ESC=Exit : PgUp/PgDn=Next/Previous Page : ARROWS=Line Up/Down : Home/End
.h ╒════════════════════════════════════════════╕
.h │ Windows...Windows..... Yup, more Windows! │
.h ╘════════════════════════════════════════════╛
One of the first things most new PowerBasic programmers want to learn is
how to make those fancy 'Pop-Up' windows. A quick browse through the
library reveals many such programs, but most of them have the source code
in pre-assembled .PBU files. So your stuck using them as designed, and
you really can't learn much from them. Don't get me wrong, these programs
are extremely valuable, and the authors have every right to keep their
work protected.
This little SUBroutine is a bit different. First the source code IS
included, and second, it's not as Flash*Bang as the rest. QuickBox uses
the CALL ABSOLUTE command to make a Pop-Up box any place on the screen,
using any color you wish. The default parameters put a single line border
around the box (again, in any color you choose) and places a small drop
shadow along the bottom and right side for a "3-D" effect.
The objective of this routine is KEEP IT SIMPLE. Although you can control
the exact location of the box, you only need to set two parameters, the width
(1 to 78 spaces across) and the depth (1 to 22 lines down), and the box will
be centered on the screen. Upon returning from the CALL, the variables
Box.Top and Box.Left are set so that you can put your text in at the proper
place. For an exact location, you can set the variables Box.Top and Box.Left
before calling the routine, and the box will appear at those locations.
The first parameter in the CALL is a flag used to determine if the box is to
be displayed (Box.Disp% = 0), or removed (Box.Disp% = 1) from the screen.
Again, this is not the most unique method, but it works well for most
applications. When called (either from the QuickBox routine, or directly)
the SUBroutine "Video.Image" saves the current screen display on disk as a
binary file. Each new screen (up to 99 screens) is assigned an index number
as part of the file name. When the Box.Disp% parameter is set to 1, the
LAST binary image file is BLOADed and replaces the current screen display.
If the value is set to -1, the very first screen is restored and all of the
remaining binary screen images are deleted from the disk. If you look closely
at the source code, this method is used to restore the users original screen
when the program ends, a polite little thing to do.
Hopefully, the listing is commented well enough for you to see how everything
works. The routines can be $INCLUDEed in your existing main program or can
be compiled and $LINKed in.
.h╓────────────────────────╖
.h║ Special Thanks...... ║
.h╙────────────────────────╜
.r╒══════════════════════════════════════════════════════════════════════════╕
.r│ I wish to send a special thanks to Llyod Smith from Spectra Technical │
.r│ support for "syntax perfecting" this, and for past and future assistance.│
.r│ │
.r│ Also a quick thanks to Information Management Systems, Inc. and all who │
.r│ contribute to their "Basically Speaking" newsletter. Its a great source │
.r│ for learning and sharing Powerbasic ideas. │
.r╘══════════════════════════════════════════════════════════════════════════╛
.h╓───────────────────────────────╖
.h║ Registration and Other Stuff. ║
.h╙───────────────────────────────╜
QuickBox is FREEware. If it suits your purpose and you wish to be kind,
a few bucks for my time is always appreciated! The only way a good
programmer becomes a great programmer is to learn and improve on ideas of
others. If you change parts of this program for any reason, please share
it with me, and others.
.i Comments may be sent to:
.i Business Enhancement Partnership Group
.i 3410 F. La Sierra Ave. Suite # 181
.i Riverside, Ca. 92503
.h CompuServe ID : 76636,2764
.h America OnLine: B4expert
.r Copyright (c) 1992 - Business Enhancement Partnership Group