home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / blanker.fr_ / blanker.bin
Text File  |  1993-04-28  |  23KB  |  720 lines

  1. VERSION 2.00
  2. Begin Form DemoForm 
  3.    BackColor       =   &H00000000&
  4.    Caption         =   "Screen Blanker Demo"
  5.    ClientHeight    =   4425
  6.    ClientLeft      =   960
  7.    ClientTop       =   1965
  8.    ClientWidth     =   7470
  9.    ForeColor       =   &H00000000&
  10.    Height          =   5115
  11.    Icon            =   BLANKER.FRX:0000
  12.    Left            =   900
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form1"
  15.    Picture         =   BLANKER.FRX:0302
  16.    ScaleHeight     =   4425
  17.    ScaleWidth      =   7470
  18.    Top             =   1335
  19.    Width           =   7590
  20.    Begin Timer Timer1 
  21.       Interval        =   1
  22.       Left            =   6960
  23.       Top             =   120
  24.    End
  25.    Begin CommandButton cmdStartStop 
  26.       BackColor       =   &H00000000&
  27.       Caption         =   "Start Demo"
  28.       Default         =   -1  'True
  29.       Height          =   390
  30.       Left            =   240
  31.       TabIndex        =   0
  32.       Top             =   120
  33.       Width           =   1830
  34.    End
  35.    Begin PictureBox picBall 
  36.       AutoSize        =   -1  'True
  37.       BackColor       =   &H00000000&
  38.       BorderStyle     =   0  'None
  39.       ForeColor       =   &H00FFFFFF&
  40.       Height          =   600
  41.       Left            =   1800
  42.       Picture         =   BLANKER.FRX:0740
  43.       ScaleHeight     =   480
  44.       ScaleWidth      =   480
  45.       TabIndex        =   1
  46.       Top             =   720
  47.       Visible         =   0   'False
  48.       Width           =   600
  49.    End
  50.    Begin Image imgMoon 
  51.       Height          =   480
  52.       Index           =   8
  53.       Left            =   6330
  54.       Picture         =   BLANKER.FRX:0A42
  55.       Top             =   3765
  56.       Visible         =   0   'False
  57.       Width           =   480
  58.    End
  59.    Begin Line linLineCtl 
  60.       BorderColor     =   &H00FF0000&
  61.       BorderWidth     =   5
  62.       Visible         =   0   'False
  63.       X1              =   240
  64.       X2              =   4080
  65.       Y1              =   2760
  66.       Y2              =   2760
  67.    End
  68.    Begin Image imgMoon 
  69.       Height          =   480
  70.       Index           =   7
  71.       Left            =   5760
  72.       Picture         =   BLANKER.FRX:0D44
  73.       Top             =   3720
  74.       Visible         =   0   'False
  75.       Width           =   480
  76.    End
  77.    Begin Image imgMoon 
  78.       Height          =   480
  79.       Index           =   6
  80.       Left            =   5160
  81.       Picture         =   BLANKER.FRX:1046
  82.       Top             =   3720
  83.       Visible         =   0   'False
  84.       Width           =   480
  85.    End
  86.    Begin Image imgMoon 
  87.       Height          =   480
  88.       Index           =   5
  89.       Left            =   4560
  90.       Picture         =   BLANKER.FRX:1348
  91.       Top             =   3720
  92.       Visible         =   0   'False
  93.       Width           =   480
  94.    End
  95.    Begin Image imgMoon 
  96.       Height          =   480
  97.       Index           =   4
  98.       Left            =   3960
  99.       Picture         =   BLANKER.FRX:164A
  100.       Top             =   3720
  101.       Visible         =   0   'False
  102.       Width           =   480
  103.    End
  104.    Begin Image imgMoon 
  105.       Height          =   480
  106.       Index           =   3
  107.       Left            =   3360
  108.       Picture         =   BLANKER.FRX:194C
  109.       Top             =   3720
  110.       Visible         =   0   'False
  111.       Width           =   480
  112.    End
  113.    Begin Image imgMoon 
  114.       Height          =   480
  115.       Index           =   2
  116.       Left            =   2760
  117.       Picture         =   BLANKER.FRX:1C4E
  118.       Top             =   3720
  119.       Visible         =   0   'False
  120.       Width           =   480
  121.    End
  122.    Begin Image imgMoon 
  123.       Height          =   480
  124.       Index           =   1
  125.       Left            =   2160
  126.       Picture         =   BLANKER.FRX:1F50
  127.       Top             =   3720
  128.       Visible         =   0   'False
  129.       Width           =   480
  130.    End
  131.    Begin Image imgMoon 
  132.       Height          =   480
  133.       Index           =   0
  134.       Left            =   1560
  135.       Picture         =   BLANKER.FRX:2252
  136.       Top             =   3720
  137.       Visible         =   0   'False
  138.       Width           =   480
  139.    End
  140.    Begin Shape shpClone 
  141.       BackColor       =   &H00000000&
  142.       BackStyle       =   1  'Opaque
  143.       BorderColor     =   &H00FF0000&
  144.       FillColor       =   &H000000FF&
  145.       Height          =   1215
  146.       Index           =   0
  147.       Left            =   240
  148.       Top             =   720
  149.       Visible         =   0   'False
  150.       Width           =   1410
  151.    End
  152.    Begin Shape Shape1 
  153.       Height          =   15
  154.       Left            =   960
  155.       Top             =   1080
  156.       Width           =   15
  157.    End
  158.    Begin Menu mnuOption 
  159.       Caption         =   "&Options"
  160.       Begin Menu mnuLineCtlDemo 
  161.          Caption         =   "&Jumpy Line"
  162.          Checked         =   -1  'True
  163.       End
  164.       Begin Menu mnuCtlMoveDemo 
  165.          Caption         =   "Re&bound"
  166.       End
  167.       Begin Menu mnuImageDemo 
  168.          Caption         =   "&Spinning Moon"
  169.       End
  170.       Begin Menu mnuShapeDemo 
  171.          Caption         =   "&Madhouse"
  172.       End
  173.       Begin Menu mnuPSetDemo 
  174.          Caption         =   "&Confetti"
  175.       End
  176.       Begin Menu mnuLineDemo 
  177.          Caption         =   "C&rossfire"
  178.       End
  179.       Begin Menu mnuCircleDemo 
  180.          Caption         =   "Rainbo&w Rug"
  181.       End
  182.       Begin Menu mnuScaleDemo 
  183.          Caption         =   "Co&lor Bars"
  184.       End
  185.       Begin Menu sep1 
  186.          Caption         =   "-"
  187.       End
  188.       Begin Menu mnuExit 
  189.          Caption         =   "E&xit"
  190.       End
  191.    End
  192. End
  193. Option Explicit
  194. ' Declare variable to track animation frame
  195. Dim Shared FrameNum
  196. ' Declare the X and Y-coordinate variables to track position.
  197. Dim Shared XPos
  198. Dim Shared YPos
  199. ' Declare variable flag to stop graphic routines in Do Loops
  200. Dim Shared DoFlag
  201. ' Declare variable to track moving controls
  202. Dim Shared Motion
  203. ' Declare form variables for color.
  204. Dim R
  205. Dim G
  206. Dim B
  207.  
  208. Sub CircleDemo ()
  209.     ' Declare local variables
  210.     Dim Radius
  211.     ' Create random RGB colors
  212.     R = 255 * Rnd
  213.     G = 255 * Rnd
  214.     B = 255 * Rnd
  215.     ' Position center of circles in form center
  216.     XPos = ScaleWidth / 2
  217.     YPos = ScaleHeight / 2
  218.     ' Generate radius between 0 and almost half form height
  219.     Radius = ((YPos * .9) + 1) * Rnd
  220.     ' Draw circle on form
  221.     Circle (XPos, YPos), Radius, RGB(R, G, B)
  222. End Sub
  223.  
  224. Sub cmdStartStop_Click ()
  225. ' Declare local variables.
  226. Dim UnClone
  227. Dim MakeClone
  228. Dim X1
  229. Dim Y1
  230.     Select Case DoFlag
  231.     Case True
  232.         cmdStartStop.Caption = "Start Demo"
  233.         DoFlag = False
  234.         mnuOption.Enabled = True
  235.         If mnuCtlMoveDemo.Checked = True Then
  236.         ' Hide bouncing graphic again.
  237.         picBall.Visible = False
  238.         ElseIf mnuLineDemo.Checked = True Then
  239.         ' Remove lines from the form.
  240.         Cls
  241.         ElseIf mnuShapeDemo.Checked = True Then
  242.         ' Remove all dynamically loaded Shape controls.
  243.         For UnClone = 1 To 20
  244.             Unload shpClone(UnClone)
  245.         Next UnClone
  246.         ' Reset background color of form to black.
  247.         DemoForm.BackColor = QBColor(0)
  248.         ' Refresh form so color change takes effect.
  249.         Refresh
  250.         ElseIf mnuPSetDemo.Checked = True Then
  251.         ' Remove confetti bits from form.
  252.         Cls
  253.         ElseIf mnuLineCtlDemo.Checked = True Then
  254.         ' Hide Line control again.
  255.         linLineCtl.Visible = False
  256.         ' Remove any stray pixels left after hiding line.
  257.         Cls
  258.         ElseIf mnuImageDemo.Checked = True Then
  259.         ' Hide bouncing graphic again.
  260.         imgMoon(0).Visible = False
  261.         ElseIf mnuScaleDemo.Checked = True Then
  262.         ' Clear form.
  263.         Cls
  264.         ' Return form to the default scale.
  265.         Scale
  266.         ElseIf mnuCircleDemo.Checked = True Then
  267.         ' Remove the circles from form.
  268.         Cls
  269.         End If
  270.     Case False
  271.         cmdStartStop.Caption = "Stop Demo"
  272.         DoFlag = True
  273.         mnuOption.Enabled = False
  274.         If mnuCtlMoveDemo.Checked = True Then
  275.         ' Make the bouncing graphic (Picture box control) visible.
  276.         picBall.Visible = True
  277.         ' Determine initial motion of bouncing graphic at random.
  278.         ' Settings are 1 to 4.  Value of variable Motion determines
  279.         ' what part of the Do Loop routine runs.
  280.         Motion = Int(4 * Rnd + 1)
  281.         ElseIf mnuLineDemo.Checked = True Then
  282.         ' Initialize random-number generator.
  283.         Randomize
  284.         ' Set line width
  285.         DrawWidth = 2
  286.         ' Set initial X and Y-coordinates to a random spot on form
  287.         X1 = Int(DemoForm.Width * Rnd + 1)
  288.         Y1 = Int(DemoForm.Height * Rnd + 1)
  289.         ElseIf mnuShapeDemo.Checked = True Then
  290.         ' Dynamically load a control array of 20 Shape controls on the form.
  291.         For MakeClone = 1 To 20
  292.             Load shpClone(MakeClone)
  293.         Next MakeClone
  294.         ElseIf mnuPSetDemo.Checked = True Then
  295.         ' Set thickness of confetti bits.
  296.         DrawWidth = 5
  297.         ElseIf mnuLineCtlDemo.Checked = True Then
  298.         ' Make Line control visible.
  299.         linLineCtl.Visible = True
  300.         ' Set thickness of line as it will appear.
  301.         DrawWidth = 7
  302.         ElseIf mnuImageDemo.Checked = True Then
  303.         ' Make bouncing graphic (Image control) visible.
  304.         imgMoon(0).Visible = True
  305.         ' Set initial animation frame
  306.         FrameNum = 0
  307.         ' Determine initial motion of bouncing graphic at random.
  308.         ' Settings are 1 to 4.  Value of variable Motion determines
  309.         ' what part of the Do Loop routine runs.
  310.         Motion = Int(4 * Rnd + 1)
  311.         ElseIf mnuScaleDemo.Checked = True Then
  312.         ' Initialize random-number generator.
  313.         Randomize
  314.         ' Set width of box outlines so boxes don't overlap.
  315.         DrawWidth = 1
  316.         ' Set value of X-coordinate of left edge of form. Then the 1st to 1 to easily
  317.         ' box has X-coordinate = 1, 2nd box = 2, etc.
  318.         ScaleLeft = 1
  319.         ' Set Y-coordinate of top edge of form to 10.
  320.         ScaleTop = 10
  321.         ' Set # of units in form width to a random number between
  322.         ' 3 and 12.  This changes # of boxes drawn each time the
  323.         ' routine starts
  324.         ScaleWidth = Int(13 * Rnd + 3)
  325.         ' Set # of units in form height -10.  Then height of all boxes
  326.         ' varies from 0 to 10 and Y-coordinates start at form bottom
  327.         ScaleHeight = -10
  328.         ElseIf mnuCircleDemo.Checked = True Then
  329.         ' Define width of circle outline.
  330.         DrawWidth = 1
  331.         ' Draw circles as dashed lines.
  332.         DrawStyle = 1
  333.         ' Draw lines using the XOR pen, combining colors found in the pen and
  334.         ' in the display but not in both.
  335.         DrawMode = 7
  336.         End If
  337.     End Select
  338. End Sub
  339.  
  340. Sub CtlMoveDemo ()
  341.     Select Case Motion
  342.     Case 1
  343.     ' Move graphic left/up by 20 twips using Move method
  344.     picBall.Move picBall.Left - 20, picBall.Top - 20
  345.     ' If graphic reaches left edge of form, move it right/up
  346.     If picBall.Left <= 0 Then
  347.         Motion = 2
  348.     ' If graphic reaches top edge of form, move it left/down
  349.     ElseIf picBall.Top <= 0 Then
  350.         Motion = 4
  351.     End If
  352.     Case 2
  353.     ' Move graphic right/up by 20 twips
  354.     picBall.Move picBall.Left + 20, picBall.Top - 20
  355.     ' If the graphic reaches right edge of form, move left/up.
  356.     ' Routine determines right edge of form by subtracting graphic
  357.     ' width from form width
  358.     If picBall.Left >= (DemoForm.Width - picBall.Width) Then
  359.         Motion = 1
  360.     ' If graphic reaches top edge of form, move right/down
  361.     ElseIf picBall.Top <= 0 Then
  362.         Motion = 3
  363.     End If
  364.     Case 3
  365.     ' Move graphic right/down by 20 twips
  366.     picBall.Move picBall.Left + 20, picBall.Top + 20
  367.     ' If graphic reaches right edge of form, move left/down
  368.     If picBall.Left >= (DemoForm.Width - picBall.Width) Then
  369.         Motion = 4
  370.     ' If graphic reaches bottom edge of form, move right/up.
  371.     ' Routine determines bottom of form by subtracting
  372.     ' graphic height from form height less 680 twips for height
  373.     ' of title bar and menu bar
  374.     ElseIf picBall.Top >= (DemoForm.Height - picBall.Height) - 680 Then
  375.         Motion = 2
  376.     End If
  377.     Case 4
  378.     ' Move the graphic left/down by 20 twips
  379.     picBall.Move picBall.Left - 20, picBall.Top + 20
  380.     ' If graphic reaches left edge of form, move right/down
  381.     If picBall.Left <= 0 Then
  382.         Motion = 3
  383.     ' If graphic reaches bottom edge of the form, move left/up
  384.     ElseIf picBall.Top >= (DemoForm.Height - picBall.Height) - 680 Then
  385.         Motion = 1
  386.     End If
  387.     End Select
  388. End Sub
  389.  
  390. Sub Delay ()
  391.     Dim Start
  392.     Dim Check
  393.     Start = Timer
  394.     Do Until Check >= Start + .15
  395.     Check = Timer
  396.     Loop
  397. End Sub
  398.  
  399. Sub Form_Load ()
  400.     DoFlag = False
  401. End Sub
  402.  
  403. Sub Form_Resize ()
  404.     If mnuScaleDemo.Checked = True Then
  405.     ' Initialize the random-number generator.
  406.     Randomize
  407.     ' Set the width of the box outlines to narrow so the boxes don't overlap.
  408.     DrawWidth = 1
  409.     ' Set the value of the X-coordinate of the left edge of the form to 1.
  410.     ' This makes it easy to set the position for each box.  The first box has
  411.     ' an X-coordinate of 1, the second has an X-coordinate of 2, etc.
  412.     ScaleLeft = 1
  413.     ' Set the value of the Y-coordinate of the top edge of the form to 10.
  414.     ScaleTop = 10
  415.     ' Set the number of units in the width of the form to a random number between
  416.     ' 3 and 12.  This changes the number of boxes that are drawn each time the user
  417.     ' starts this routine.
  418.     ScaleWidth = Int(13 * Rnd + 3)
  419.     ' Set the number of units in the height of the form to negative 10.  This has
  420.     ' two effects.  First, all the boxes then have a height that varies from 0 to 10.
  421.     ' Second, the negative value causes the Y-coordinates to begin at the bottom
  422.     ' edge of the form instead of at the top.
  423.     ScaleHeight = -10
  424.     End If
  425. End Sub
  426.  
  427. Sub Form_Unload (Cancel As Integer)
  428.     End
  429. End Sub
  430.  
  431. Sub ImageDemo ()
  432.     Select Case Motion
  433.     Case 1
  434.     ' Move graphic left/up by 100 twips using Move method
  435.     imgMoon(0).Move imgMoon(0).Left - 100, imgMoon(0).Top - 100
  436.     ' Increment animation to next frame
  437.     IncrFrame
  438.     ' If graphic reaches left edge of form, move right/up
  439.     If imgMoon(0).Left <= 0 Then
  440.         Motion = 2
  441.     ' If graphic reaches top edge of the form, move left/down
  442.     ElseIf imgMoon(0).Top <= 0 Then
  443.         Motion = 4
  444.     End If
  445.     Case 2
  446.     ' Move graphic right/up by 100 twips
  447.     imgMoon(0).Move imgMoon(0).Left + 100, imgMoon(0).Top - 100
  448.     ' Increment animation to next frame
  449.     IncrFrame
  450.     ' If graphic reaches right edge of form, move left/up.
  451.     ' Routine determines the right edge of form by subtracting
  452.     ' graphic width from control width
  453.     If imgMoon(0).Left >= (DemoForm.Width - imgMoon(0).Width) Then
  454.         Motion = 1
  455.     ' If graphic reaches top edge of the form, move right/down
  456.     ElseIf imgMoon(0).Top <= 0 Then
  457.         Motion = 3
  458.     End If
  459.     Case 3
  460.     ' Move graphic right/down by 100 twips
  461.     imgMoon(0).Move imgMoon(0).Left + 100, imgMoon(0).Top + 100
  462.     ' Increment animation to next frame
  463.     IncrFrame
  464.     ' If graphic reaches right edge of form, move left/down
  465.     If imgMoon(0).Left >= (DemoForm.Width - imgMoon(0).Width) Then
  466.         Motion = 4
  467.     ' If graphic reaches bottom edge of form, move right/up.
  468.     ' Routine determines bottom edge of form by subtracting graphic
  469.     ' height from form height minus 680 twips for height of title
  470.     ' bar and menu bar
  471.     ElseIf imgMoon(0).Top >= (DemoForm.Height - imgMoon(0).Height) - 680 Then
  472.         Motion = 2
  473.     End If
  474.     Case 4
  475.     ' Move graphic left/down by 100 twips
  476.     imgMoon(0).Move imgMoon(0).Left - 100, imgMoon(0).Top + 100
  477.     ' Increment animation to next frame
  478.     IncrFrame
  479.     ' If graphic reaches left edge of form, move right/down
  480.     If imgMoon(0).Left <= 0 Then
  481.         Motion = 3
  482.     ' If graphic reaches bottom edge of form, move left/up
  483.     ElseIf imgMoon(0).Top >= (DemoForm.Height - imgMoon(0).Height) - 680 Then
  484.         Motion = 1
  485.     End If
  486.     End Select
  487. End Sub
  488.  
  489. Sub IncrFrame ()
  490.     ' Increment frame #
  491.     FrameNum = FrameNum + 1
  492.     ' Control array with animation frames has elements 0 to 7. At the 8th
  493.     ' frame, reset the frame # to 0 for endless animation loop
  494.     If FrameNum > 8 Then
  495.     FrameNum = 1
  496.     End If
  497.     ' Set Picture property of image control to Picture property of current
  498.     ' frame
  499.     imgMoon(0).Picture = imgMoon(FrameNum).Picture
  500.     ' Pause display so animation isn't too fast
  501.     Delay
  502. End Sub
  503.  
  504. Sub LineCtlDemo ()
  505.     ' Set X and Y-coordinates (left/right position) of line's start to
  506.     ' random spot on form
  507.     linLineCtl.X1 = Int(DemoForm.Width * Rnd)
  508.     linLineCtl.Y1 = Int(DemoForm.Height * Rnd)
  509.     ' Set X and Y-coordinates (left/right position) of line's end to
  510.     ' random spot on form
  511.     linLineCtl.X2 = Int(DemoForm.Width * Rnd)
  512.     linLineCtl.Y2 = Int(DemoForm.Height * Rnd)
  513.     ' Clear form to remove any stray pixels
  514.     Cls
  515.     ' Pause display before moving line again
  516.     Delay
  517. End Sub
  518.  
  519. Sub LineDemo ()
  520.     ' Declare local variables
  521.     Dim X2
  522.     Dim Y2
  523.     ' Create random RGB colors
  524.     R = 255 * Rnd
  525.     G = 255 * Rnd
  526.     B = 255 * Rnd
  527.     ' Set end point of line to random spot on form
  528.     X2 = Int(DemoForm.Width * Rnd + 1)
  529.     Y2 = Int(DemoForm.Height * Rnd + 1)
  530.     ' Using Line method, draw from current coordinates to current end
  531.     ' point, giving line a random color. Each line starts where last
  532.     ' line ends.
  533.     Line -(X2, Y2), RGB(R, G, B)
  534. End Sub
  535.  
  536. Sub mnuCircleDemo_Click ()
  537.     Cls
  538.     mnuCtlMoveDemo.Checked = False
  539.     mnuLineDemo.Checked = False
  540.     mnuShapeDemo.Checked = False
  541.     mnuPSetDemo.Checked = False
  542.     mnuLineCtlDemo.Checked = False
  543.     mnuImageDemo.Checked = False
  544.     mnuScaleDemo.Checked = False
  545.     mnuCircleDemo.Checked = True
  546. End Sub
  547.  
  548. Sub mnuCtlMoveDemo_Click ()
  549.     Cls
  550.     mnuCtlMoveDemo.Checked = True
  551.     mnuLineDemo.Checked = False
  552.     mnuShapeDemo.Checked = False
  553.     mnuPSetDemo.Checked = False
  554.     mnuLineCtlDemo.Checked = False
  555.     mnuImageDemo.Checked = False
  556.     mnuScaleDemo.Checked = False
  557.     mnuCircleDemo.Checked = False
  558. End Sub
  559.  
  560. Sub mnuExit_Click ()
  561.     End
  562. End Sub
  563.  
  564. Sub mnuImageDemo_Click ()
  565.     Cls
  566.     mnuCtlMoveDemo.Checked = False
  567.     mnuLineDemo.Checked = False
  568.     mnuShapeDemo.Checked = False
  569.     mnuPSetDemo.Checked = False
  570.     mnuLineCtlDemo.Checked = False
  571.     mnuImageDemo.Checked = True
  572.     mnuScaleDemo.Checked = False
  573.     mnuCircleDemo.Checked = False
  574. End Sub
  575.  
  576. Sub mnuLineCtlDemo_Click ()
  577.     Cls
  578.     mnuCtlMoveDemo.Checked = False
  579.     mnuLineDemo.Checked = False
  580.     mnuShapeDemo.Checked = False
  581.     mnuPSetDemo.Checked = False
  582.     mnuLineCtlDemo.Checked = True
  583.     mnuImageDemo.Checked = False
  584.     mnuScaleDemo.Checked = False
  585.     mnuCircleDemo.Checked = False
  586. End Sub
  587.  
  588. Sub mnuLineDemo_Click ()
  589.     Cls
  590.     mnuCtlMoveDemo.Checked = False
  591.     mnuLineDemo.Checked = True
  592.     mnuShapeDemo.Checked = False
  593.     mnuPSetDemo.Checked = False
  594.     mnuLineCtlDemo.Checked = False
  595.     mnuImageDemo.Checked = False
  596.     mnuScaleDemo.Checked = False
  597.     mnuCircleDemo.Checked = False
  598. End Sub
  599.  
  600. Sub mnuPSetDemo_Click ()
  601.     Cls
  602.     mnuCtlMoveDemo.Checked = False
  603.     mnuLineDemo.Checked = False
  604.     mnuShapeDemo.Checked = False
  605.     mnuPSetDemo.Checked = True
  606.     mnuLineCtlDemo.Checked = False
  607.     mnuImageDemo.Checked = False
  608.     mnuScaleDemo.Checked = False
  609.     mnuCircleDemo.Checked = False
  610. End Sub
  611.  
  612. Sub mnuScaleDemo_Click ()
  613.     Cls
  614.     mnuCtlMoveDemo.Checked = False
  615.     mnuLineDemo.Checked = False
  616.     mnuShapeDemo.Checked = False
  617.     mnuPSetDemo.Checked = False
  618.     mnuLineCtlDemo.Checked = False
  619.     mnuImageDemo.Checked = False
  620.     mnuScaleDemo.Checked = True
  621.     mnuCircleDemo.Checked = False
  622. End Sub
  623.  
  624. Sub mnuShapeDemo_Click ()
  625.     Cls
  626.     mnuCtlMoveDemo.Checked = False
  627.     mnuLineDemo.Checked = False
  628.     mnuShapeDemo.Checked = True
  629.     mnuPSetDemo.Checked = False
  630.     mnuLineCtlDemo.Checked = False
  631.     mnuImageDemo.Checked = False
  632.     mnuScaleDemo.Checked = False
  633.     mnuCircleDemo.Checked = False
  634. End Sub
  635.  
  636. Sub PSetDemo ()
  637.     ' Create random RGB colors
  638.     R = 255 * Rnd
  639.     G = 255 * Rnd
  640.     B = 255 * Rnd
  641.     ' Xpos sets horiz position of confetti bit to random spot on form
  642.     XPos = Rnd * ScaleWidth
  643.     ' YPos sets vertical position of confetti bit to random spot on form
  644.     YPos = Rnd * ScaleHeight
  645.     ' Draw confetti bit at XPos, Ypos. Assign confetti bit a random color
  646.     PSet (XPos, YPos), RGB(R, G, B)
  647. End Sub
  648.  
  649. Sub ScaleDemo ()
  650.     ' Declare local variables
  651.     Dim Box
  652.     ' Creates same number of boxes as units in the width of form
  653.     For Box = 1 To ScaleWidth
  654.     ' Create random RGB colors
  655.     R = 255 * Rnd
  656.     G = 255 * Rnd
  657.     B = 255 * Rnd
  658.     ' Draw boxes using te Line method with B (box) F (filled) options.
  659.     ' Boxes start at each X-coordinate determined by ScaleWidth and at
  660.     ' a Y-coordinate of 0 (bottom of form). Each box is 1 unit wide and
  661.     ' has a random height between 0 and 10. Fill box with random color.
  662.     Line (Box, 0)-Step(1, (Int(11 * Rnd))), RGB(R, G, B), BF
  663.     Next Box
  664.     ' Pause to display all boxes before redraw
  665.     Delay
  666. End Sub
  667.  
  668. Sub ShapeDemo ()
  669.     ' Declare local variables
  670.     Dim CloneID
  671.     ' Create random RGB colors
  672.     R = 255 * Rnd
  673.     G = 255 * Rnd
  674.     B = 255 * Rnd
  675.     ' Set form background color to random value
  676.     DemoForm.BackColor = RGB(R, G, B)
  677.     ' Select random Shape control in control array
  678.     CloneID = Int(20 * Rnd + 1)
  679.     ' XPos and Ypos set position of selected Shape control to random
  680.     ' spot on the form.
  681.     XPos = Int(DemoForm.Width * Rnd + 1)
  682.     YPos = Int(DemoForm.Height * Rnd + 1)
  683.     ' Set the shape of the selected Shape control to a random shape.
  684.     shpClone(CloneID).Shape = Int(6 * Rnd)
  685.     ' Set height/width of selected Shape control to random size between
  686.     ' 500 and 2500 twips
  687.     shpClone(CloneID).Height = Int(2501 * Rnd + 500)
  688.     shpClone(CloneID).Width = Int(2501 * Rnd + 500)
  689.     ' Set background color and DrawMode of Shape control to random color
  690.     shpClone(CloneID).BackColor = QBColor(Int(15 * Rnd))
  691.     shpClone(CloneID).DrawMode = Int(16 * Rnd + 1)
  692.     ' Move selected Shape control using Move method to XPos, YPos
  693.     shpClone(CloneID).Move XPos, YPos
  694.     ' Make the selected Shape control visible.
  695.     shpClone(CloneID).Visible = True
  696.     ' Wait briefly before selecting and changing the next Shape control.
  697.     Delay
  698. End Sub
  699.  
  700. Sub Timer1_Timer ()
  701.     If mnuCtlMoveDemo.Checked And DoFlag = True Then
  702.     CtlMoveDemo
  703.     ElseIf mnuLineDemo.Checked And DoFlag = True Then
  704.     LineDemo
  705.     ElseIf mnuShapeDemo.Checked And DoFlag = True Then
  706.     ShapeDemo
  707.     ElseIf mnuPSetDemo.Checked And DoFlag = True Then
  708.     PSetDemo
  709.     ElseIf mnuLineCtlDemo.Checked And DoFlag = True Then
  710.     LineCtlDemo
  711.     ElseIf mnuImageDemo.Checked And DoFlag = True Then
  712.     ImageDemo
  713.     ElseIf mnuScaleDemo.Checked And DoFlag = True Then
  714.     ScaleDemo
  715.     ElseIf mnuCircleDemo.Checked And DoFlag = True Then
  716.     CircleDemo
  717.     End If
  718. End Sub
  719.  
  720.