Category : Dbase (Clipper, FoxBase, etc) Languages Source Code
Archive   : TN9002.ZIP
Filename : EXPLODIN.TXT

 
Output of file : EXPLODIN.TXT contained in archive : TN9002.ZIP

Exploding Windows
Steve Silverwood

Windows in dBASE IV are quite a handy feature indeed. They're perfect
for bringing up a box of help information while in a data entry screen
or at a menu, since they can pop onto the screen without disturbing
the screen contents. When deactivating the window, the underlying
data remains visible.

Just popping a window up on the screen is a little bland, though. To
add a little life to your applications, why not make a window jump out
at the user? Windows can call attention to themselves via some very
simple animation techniques in dBASE IV.

We can define a window while it's already activated, a fact that's not
widely known. So with the use of loop, and variables for the window
coordinates, we can repeatedly DEFINE and ACTIVATE a window, changing
the size of the window in the process.

The reverse is also true, so a window can shrink down to nothing when
it's no longer needed. The accompanying code illustrates the technique
I use for exploding windows. I hope you find it of value.

* Program...: BoomWin.PRG
* Author....: Steve Silverwood
* Date......: 11/17/1989
* Versions..: dBASE IV 1.0
* Notes.....: Illustrates making windows appear to "explode" from a
* position on the screen to the desired dimensions.

PROCEDURE Explode
ON ERROR RETURN
? "Exploding a window..."

PRIVATE tl_v, tl_h, br_v, br_h, counter

tl_v = 11 && Top left vertical start/end position.
tl_h = 39 && Top left horizontal start/end position.
br_v = 13 && Bottom right vertical start/end position.
br_h = 41 && Bottom right horizontal start/end position.

DO WHILE (tl_v >= 3) .AND. (tl_h >= 23) .AND. (br_v <= 21) .AND. (br_h <= 57)
DEFINE WINDOW Boom FROM tl_v,tl_h TO br_v,br_h
ACTIVATE WINDOW Boom
tl v = tl v - 1
tl h = tl h - 2
br v = br v + 1
br h = br h + 2
ENDDO

? "Press a key to "
WAIT "shrink the window..."

DO WHILE (tl_v <= 11) .AND. (tl_h <= 39) .AND. (br_v >= 13) .AND. (br_h >= 41)
ACTIVATE WINDOW Boom
tl_v = tl_v + 1
tl_h = tl_h + 2
br_v = br_v - 1
br_h = br_h - 2
ENDDO

DEACTIVATE WINDOW Boom
CLEAR
RETURN