home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / ch_code / ch06 / spiral1 / spiral1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-02-20  |  14.6 KB  |  485 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Spiral"
  4.    ClientHeight    =   6645
  5.    ClientLeft      =   2100
  6.    ClientTop       =   945
  7.    ClientWidth     =   7440
  8.    LinkTopic       =   "Form1"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   6645
  11.    ScaleWidth      =   7440
  12.    Begin VB.PictureBox Picture2 
  13.       AutoRedraw      =   -1  'True
  14.       BackColor       =   &H00808080&
  15.       ForeColor       =   &H000000FF&
  16.       Height          =   5295
  17.       Left            =   120
  18.       ScaleHeight     =   349
  19.       ScaleMode       =   3  'Pixel
  20.       ScaleWidth      =   349
  21.       TabIndex        =   33
  22.       Top             =   120
  23.       Visible         =   0   'False
  24.       Width           =   5295
  25.    End
  26.    Begin VB.Frame Frame1 
  27.       Caption         =   "Pen Width"
  28.       BeginProperty Font 
  29.          Name            =   "Times New Roman"
  30.          Size            =   9.75
  31.          Charset         =   0
  32.          Weight          =   400
  33.          Underline       =   0   'False
  34.          Italic          =   0   'False
  35.          Strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   1140
  38.       Left            =   5625
  39.       TabIndex        =   28
  40.       Top             =   5295
  41.       Width           =   1635
  42.       Begin VB.OptionButton WOption 
  43.          Height          =   195
  44.          Index           =   1
  45.          Left            =   150
  46.          Style           =   1  'Graphical
  47.          TabIndex        =   31
  48.          Top             =   300
  49.          Value           =   -1  'True
  50.          Width           =   210
  51.       End
  52.       Begin VB.OptionButton WOption 
  53.          Height          =   195
  54.          Index           =   2
  55.          Left            =   150
  56.          Style           =   1  'Graphical
  57.          TabIndex        =   30
  58.          Top             =   570
  59.          Width           =   210
  60.       End
  61.       Begin VB.OptionButton WOption 
  62.          Height          =   195
  63.          Index           =   3
  64.          Left            =   150
  65.          Style           =   1  'Graphical
  66.          TabIndex        =   29
  67.          Top             =   840
  68.          Width           =   225
  69.       End
  70.       Begin VB.Line Line1 
  71.          X1              =   540
  72.          X2              =   1455
  73.          Y1              =   390
  74.          Y2              =   390
  75.       End
  76.       Begin VB.Line Line2 
  77.          BorderWidth     =   2
  78.          X1              =   1455
  79.          X2              =   540
  80.          Y1              =   660
  81.          Y2              =   675
  82.       End
  83.       Begin VB.Line Line3 
  84.          BorderWidth     =   3
  85.          X1              =   1425
  86.          X2              =   540
  87.          Y1              =   930
  88.          Y2              =   930
  89.       End
  90.    End
  91.    Begin VB.PictureBox CPicture 
  92.       BackColor       =   &H000000FF&
  93.       Height          =   225
  94.       Index           =   0
  95.       Left            =   6000
  96.       ScaleHeight     =   165
  97.       ScaleWidth      =   1080
  98.       TabIndex        =   27
  99.       Top             =   1590
  100.       Width           =   1140
  101.    End
  102.    Begin VB.OptionButton Option 
  103.       Height          =   255
  104.       Index           =   0
  105.       Left            =   5745
  106.       Style           =   1  'Graphical
  107.       TabIndex        =   26
  108.       Top             =   1575
  109.       Width           =   225
  110.    End
  111.    Begin VB.PictureBox CPicture 
  112.       BackColor       =   &H000000C0&
  113.       Height          =   225
  114.       Index           =   1
  115.       Left            =   6000
  116.       ScaleHeight     =   165
  117.       ScaleWidth      =   1080
  118.       TabIndex        =   25
  119.       Top             =   1995
  120.       Width           =   1140
  121.    End
  122.    Begin VB.OptionButton Option 
  123.       Height          =   255
  124.       Index           =   1
  125.       Left            =   5745
  126.       Style           =   1  'Graphical
  127.       TabIndex        =   24
  128.       Top             =   1935
  129.       Width           =   225
  130.    End
  131.    Begin VB.PictureBox CPicture 
  132.       BackColor       =   &H0000FFFF&
  133.       Height          =   225
  134.       Index           =   2
  135.       Left            =   6000
  136.       ScaleHeight     =   165
  137.       ScaleWidth      =   1080
  138.       TabIndex        =   23
  139.       Top             =   2385
  140.       Width           =   1140
  141.    End
  142.    Begin VB.OptionButton Option 
  143.       Height          =   255
  144.       Index           =   2
  145.       Left            =   5745
  146.       Style           =   1  'Graphical
  147.       TabIndex        =   22
  148.       Top             =   2370
  149.       Width           =   225
  150.    End
  151.    Begin VB.PictureBox CPicture 
  152.       BackColor       =   &H0000FF00&
  153.       Height          =   225
  154.       Index           =   3
  155.       Left            =   6000
  156.       ScaleHeight     =   165
  157.       ScaleWidth      =   1080
  158.       TabIndex        =   21
  159.       Top             =   2790
  160.       Width           =   1140
  161.    End
  162.    Begin VB.OptionButton Option 
  163.       Height          =   255
  164.       Index           =   3
  165.       Left            =   5745
  166.       Style           =   1  'Graphical
  167.       TabIndex        =   20
  168.       Top             =   2775
  169.       Width           =   225
  170.    End
  171.    Begin VB.PictureBox CPicture 
  172.       BackColor       =   &H00FFFF00&
  173.       Height          =   225
  174.       Index           =   4
  175.       Left            =   6000
  176.       ScaleHeight     =   165
  177.       ScaleWidth      =   1080
  178.       TabIndex        =   19
  179.       Top             =   3180
  180.       Width           =   1140
  181.    End
  182.    Begin VB.OptionButton Option 
  183.       Height          =   255
  184.       Index           =   4
  185.       Left            =   5745
  186.       Style           =   1  'Graphical
  187.       TabIndex        =   18
  188.       Top             =   3165
  189.       Width           =   225
  190.    End
  191.    Begin VB.PictureBox CPicture 
  192.       BackColor       =   &H00FF0000&
  193.       Height          =   225
  194.       Index           =   5
  195.       Left            =   6000
  196.       ScaleHeight     =   165
  197.       ScaleWidth      =   1080
  198.       TabIndex        =   17
  199.       Top             =   3585
  200.       Width           =   1140
  201.    End
  202.    Begin VB.OptionButton Option 
  203.       Height          =   255
  204.       Index           =   5
  205.       Left            =   5745
  206.       Style           =   1  'Graphical
  207.       TabIndex        =   16
  208.       Top             =   3570
  209.       Width           =   225
  210.    End
  211.    Begin VB.PictureBox CPicture 
  212.       BackColor       =   &H00FF00FF&
  213.       Height          =   225
  214.       Index           =   6
  215.       Left            =   6015
  216.       ScaleHeight     =   165
  217.       ScaleWidth      =   1080
  218.       TabIndex        =   15
  219.       Top             =   3990
  220.       Width           =   1140
  221.    End
  222.    Begin VB.OptionButton Option 
  223.       Height          =   255
  224.       Index           =   6
  225.       Left            =   5745
  226.       Style           =   1  'Graphical
  227.       TabIndex        =   14
  228.       Top             =   3975
  229.       Width           =   225
  230.    End
  231.    Begin VB.PictureBox CPicture 
  232.       BackColor       =   &H00000000&
  233.       Height          =   225
  234.       Index           =   7
  235.       Left            =   6030
  236.       ScaleHeight     =   165
  237.       ScaleWidth      =   1080
  238.       TabIndex        =   13
  239.       Top             =   4380
  240.       Width           =   1140
  241.    End
  242.    Begin VB.OptionButton Option 
  243.       Height          =   255
  244.       Index           =   7
  245.       Left            =   5745
  246.       Style           =   1  'Graphical
  247.       TabIndex        =   12
  248.       Top             =   4365
  249.       Value           =   -1  'True
  250.       Width           =   225
  251.    End
  252.    Begin VB.PictureBox CPicture 
  253.       BackColor       =   &H00FFFFFF&
  254.       Height          =   225
  255.       Index           =   8
  256.       Left            =   6015
  257.       ScaleHeight     =   165
  258.       ScaleWidth      =   1080
  259.       TabIndex        =   11
  260.       Top             =   4785
  261.       Width           =   1140
  262.    End
  263.    Begin VB.OptionButton Option 
  264.       Height          =   255
  265.       Index           =   8
  266.       Left            =   5745
  267.       Style           =   1  'Graphical
  268.       TabIndex        =   10
  269.       Top             =   4770
  270.       Width           =   225
  271.    End
  272.    Begin VB.HScrollBar HScroll4 
  273.       Height          =   210
  274.       LargeChange     =   10
  275.       Left            =   2070
  276.       Max             =   40
  277.       TabIndex        =   9
  278.       Top             =   6255
  279.       Width           =   3345
  280.    End
  281.    Begin VB.CommandButton Command2 
  282.       Caption         =   "Clear Graph"
  283.       BeginProperty Font 
  284.          Name            =   "Times New Roman"
  285.          Size            =   12
  286.          Charset         =   0
  287.          Weight          =   400
  288.          Underline       =   0   'False
  289.          Italic          =   0   'False
  290.          Strikethrough   =   0   'False
  291.       EndProperty
  292.       Height          =   405
  293.       Left            =   5655
  294.       TabIndex        =   7
  295.       Top             =   675
  296.       Width           =   1575
  297.    End
  298.    Begin VB.HScrollBar HScroll3 
  299.       Height          =   240
  300.       Left            =   255
  301.       Max             =   20
  302.       Min             =   10
  303.       MousePointer    =   1  'Arrow
  304.       TabIndex        =   4
  305.       Top             =   8760
  306.       Value           =   20
  307.       Width           =   6210
  308.    End
  309.    Begin VB.HScrollBar HScroll2 
  310.       Height          =   210
  311.       LargeChange     =   10
  312.       Left            =   2070
  313.       Max             =   150
  314.       MousePointer    =   1  'Arrow
  315.       SmallChange     =   10
  316.       TabIndex        =   3
  317.       Top             =   5955
  318.       Value           =   100
  319.       Width           =   3345
  320.    End
  321.    Begin VB.HScrollBar HScroll1 
  322.       Height          =   210
  323.       LargeChange     =   10
  324.       Left            =   2070
  325.       Max             =   150
  326.       Min             =   50
  327.       SmallChange     =   10
  328.       TabIndex        =   2
  329.       Top             =   5625
  330.       Value           =   110
  331.       Width           =   3345
  332.    End
  333.    Begin VB.CommandButton Command1 
  334.       Caption         =   "Start"
  335.       BeginProperty Font 
  336.          Name            =   "Times New Roman"
  337.          Size            =   12
  338.          Charset         =   0
  339.          Weight          =   400
  340.          Underline       =   0   'False
  341.          Italic          =   0   'False
  342.          Strikethrough   =   0   'False
  343.       EndProperty
  344.       Height          =   405
  345.       Left            =   5655
  346.       TabIndex        =   1
  347.       Top             =   120
  348.       Width           =   1575
  349.    End
  350.    Begin VB.PictureBox Picture1 
  351.       BackColor       =   &H00808080&
  352.       FillStyle       =   0  'Solid
  353.       ForeColor       =   &H000000FF&
  354.       Height          =   5310
  355.       Left            =   100
  356.       ScaleHeight     =   350
  357.       ScaleMode       =   3  'Pixel
  358.       ScaleWidth      =   350
  359.       TabIndex        =   0
  360.       Top             =   135
  361.       Width           =   5310
  362.    End
  363.    Begin VB.Frame Frame2 
  364.       Caption         =   "Pen Color"
  365.       BeginProperty Font 
  366.          Name            =   "Times New Roman"
  367.          Size            =   9.75
  368.          Charset         =   0
  369.          Weight          =   400
  370.          Underline       =   0   'False
  371.          Italic          =   0   'False
  372.          Strikethrough   =   0   'False
  373.       EndProperty
  374.       Height          =   3960
  375.       Left            =   5610
  376.       TabIndex        =   32
  377.       Top             =   1200
  378.       Width           =   1620
  379.    End
  380.    Begin VB.Label Label3 
  381.       Caption         =   "Inner Offset"
  382.       BeginProperty Font 
  383.          Name            =   "Times New Roman"
  384.          Size            =   9.75
  385.          Charset         =   0
  386.          Weight          =   400
  387.          Underline       =   0   'False
  388.          Italic          =   0   'False
  389.          Strikethrough   =   0   'False
  390.       EndProperty
  391.       Height          =   225
  392.       Left            =   195
  393.       TabIndex        =   8
  394.       Top             =   6255
  395.       Width           =   1755
  396.    End
  397.    Begin VB.Label Label2 
  398.       Caption         =   "Inner Radius"
  399.       BeginProperty Font 
  400.          Name            =   "Times New Roman"
  401.          Size            =   9.75
  402.          Charset         =   0
  403.          Weight          =   400
  404.          Underline       =   0   'False
  405.          Italic          =   0   'False
  406.          Strikethrough   =   0   'False
  407.       EndProperty
  408.       Height          =   270
  409.       Left            =   195
  410.       TabIndex        =   6
  411.       Top             =   5925
  412.       Width           =   1785
  413.    End
  414.    Begin VB.Label Label1 
  415.       Caption         =   "Outer Radius"
  416.       BeginProperty Font 
  417.          Name            =   "Times New Roman"
  418.          Size            =   9.75
  419.          Charset         =   0
  420.          Weight          =   400
  421.          Underline       =   0   'False
  422.          Italic          =   0   'False
  423.          Strikethrough   =   0   'False
  424.       EndProperty
  425.       Height          =   270
  426.       Left            =   195
  427.       TabIndex        =   5
  428.       Top             =   5595
  429.       Width           =   1785
  430.    End
  431. Attribute VB_Name = "Form1"
  432. Attribute VB_GlobalNameSpace = False
  433. Attribute VB_Creatable = False
  434. Attribute VB_PredeclaredId = True
  435. Attribute VB_Exposed = False
  436. Private Sub Command1_Click()
  437. If Command1.Caption = "Stop" Then
  438.     BreakNow = True
  439.     Exit Sub
  440.     BreakNow = False
  441.     Command1.Caption = "Stop"
  442. End If
  443. DrawRoullette
  444. End Sub
  445. Private Sub Command2_Click()
  446.     Form1.Picture1.Cls
  447.     Form1.Picture2.Cls
  448. End Sub
  449. Private Sub Form_Load()
  450.     PenColor = RGB(0, 0, 0)
  451.     HScroll1_Change
  452.     HScroll2_Change
  453.     HScroll4_Change
  454.     Picture2.Width = Picture1.Width
  455.     Picture2.Height = Picture1.Height
  456. End Sub
  457. Private Sub Form_Paint()
  458.     Picture1.Refresh
  459.     Picture1.PaintPicture Picture2.Image, 0, 0, Picture2.Width, Picture2.Height, 0, 0, Picture2.Width, Picture2.Height, &HCC0020
  460. End Sub
  461. Private Sub HScroll1_Change()
  462.     Label1.Caption = "Outer Radius  " & HScroll1.Value
  463. End Sub
  464. Private Sub HScroll1_Scroll()
  465.     Label1.Caption = "Outer Radius  " & HScroll1.Value
  466. End Sub
  467. Private Sub HScroll2_Change()
  468.     Label2.Caption = "Inner Radius   " & HScroll2.Value - 80
  469.         
  470. End Sub
  471. Private Sub HScroll2_Scroll()
  472.     Label2.Caption = "Inner Radius   " & HScroll2.Value - 80
  473. End Sub
  474. Private Sub HScroll4_Change()
  475.     Label3.Caption = "Inner Offset     " & HScroll4.Value
  476. End Sub
  477. Private Sub Option_Click(Index As Integer)
  478.     PenColor = CPicture(Index).BackColor
  479. End Sub
  480. Private Sub WOption_Click(Index As Integer)
  481.     Picture1.DrawWidth = Index
  482.     Picture2.DrawWidth = Index
  483.         
  484. End Sub
  485.