Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Have fun
Message
From
21/05/2003 15:57:42
 
 
To
21/05/2003 15:21:33
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00791118
Message ID:
00791302
Views:
26
>Here's what a few minutes of tweaking can do ;) Try it!
>
>
>SET ESCAPE ON
>ON ESCAPE DO iquit
>
>DEFINE WINDOW Superwnd FROM 10,10 TO 30, 30 NAME mywnd
>WITH mywnd
>  .WIDTH=300
>  .HEIGHT=300
>  .AUTOCENTER=.T.
>  SHOW WINDOW Superwnd
>  SET CURSOR OFF
>  ACTIVATE WINDOW Superwnd
>  ACTIVATE SCREEN
>  Angle=0
>  WAIT WINDOW NOWA "Hit ESC to terminate..."
>
>  *Add some variables to allow the circles to bounce.
>  xdir = 1
>  ydir = 1
>  x=150
>  y=70
>
>  DO WHILE .T.
>
>    .FORECOLOR=65535
>    .CIRCLE(50, m.x+m.y*COS(DTOR(m.Angle)), m.x+m.y*SIN(DTOR(m.Angle)))
>    .FORECOLOR=65408
>    .CIRCLE(50, m.x-m.y*COS(DTOR(m.Angle)), m.x-m.y*SIN(DTOR(m.Angle)))
>    .FORECOLOR=16711680
>    .CIRCLE(50, m.x+m.y*COS(DTOR(m.Angle+90)), m.x+m.y*SIN(DTOR(m.Angle+90)))
>    .FORECOLOR=255
>    .CIRCLE(50, m.x+m.y*COS(DTOR(m.Angle+270)), m.x+m.y*SIN(DTOR(m.Angle+270)))
>
>    IF m.Angle=359
>      Angle=0
>    ELSE
>      Angle=m.Angle+1
>    ENDIF
>
>    *Bounce the circles off the sides of the form
>    *by moving the center around.
>    IF m.x > 200 OR m.x < 100
>      xdir = -1 * m.xdir
>    ENDIF
>    x = m.x + m.xdir
>
>    IF m.y > 100 OR m.y < 25
>      ydir = -1 * m.ydir
>    ENDIF
>    y = m.y + m.ydir
>
>  ENDDO
>ENDWITH
>
>DO iquit
>
>*-------------
>  PROCEDURE iquit
>  mywnd.CLS
>  RELEASE mywnd
>  RELEASE WINDOWS Superwnd
>  SET CURSOR ON
>  ON ESCAPE
>  WAIT CLEAR
>  CANCEL
>
Very nice indeed! But it worked so fast and took so many cycles that ESC didn't respond.
Had to kill the process :)


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform