home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / ole / acdual / vbctrl / autodriv.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-03-27  |  8.4 KB  |  294 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "AutoClik Test Driver"
  6.    ClientHeight    =   3510
  7.    ClientLeft      =   1845
  8.    ClientTop       =   1620
  9.    ClientWidth     =   5100
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   0
  13.       weight          =   700
  14.       size            =   8.25
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   3930
  21.    Left            =   1785
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   3510
  24.    ScaleWidth      =   5100
  25.    Top             =   1260
  26.    Width           =   5220
  27.    Begin VB.CommandButton cmdTestError 
  28.       Caption         =   "Test&Error"
  29.       Height          =   375
  30.       Left            =   2160
  31.       TabIndex        =   19
  32.       Top             =   3000
  33.       Width           =   1455
  34.    End
  35.    Begin VB.TextBox txtWCode 
  36.       Appearance      =   0  'Flat
  37.       Height          =   375
  38.       Left            =   1080
  39.       TabIndex        =   18
  40.       Top             =   3000
  41.       Width           =   855
  42.    End
  43.    Begin VB.CommandButton SetPosition 
  44.       Appearance      =   0  'Flat
  45.       BackColor       =   &H80000005&
  46.       Caption         =   "Set P&osition"
  47.       Height          =   375
  48.       Left            =   240
  49.       TabIndex        =   9
  50.       Top             =   1560
  51.       Width           =   1335
  52.    End
  53.    Begin VB.CommandButton GetPosition 
  54.       Appearance      =   0  'Flat
  55.       BackColor       =   &H80000005&
  56.       Caption         =   "Get &Position"
  57.       Height          =   375
  58.       Left            =   240
  59.       TabIndex        =   10
  60.       Top             =   2280
  61.       Width           =   1335
  62.    End
  63.    Begin VB.CommandButton AnimateXY 
  64.       Appearance      =   0  'Flat
  65.       BackColor       =   &H80000005&
  66.       Caption         =   "&Animate X && Y"
  67.       Height          =   375
  68.       Left            =   3360
  69.       TabIndex        =   14
  70.       Top             =   1800
  71.       Width           =   1575
  72.    End
  73.    Begin VB.CommandButton AnimatePosition 
  74.       Appearance      =   0  'Flat
  75.       BackColor       =   &H80000005&
  76.       Caption         =   "A&nimate Position"
  77.       Height          =   375
  78.       Left            =   3360
  79.       TabIndex        =   15
  80.       Top             =   2280
  81.       Width           =   1575
  82.    End
  83.    Begin VB.CommandButton RefreshDisplay 
  84.       Appearance      =   0  'Flat
  85.       BackColor       =   &H80000005&
  86.       Caption         =   "&Refresh Display"
  87.       Height          =   375
  88.       Left            =   3360
  89.       TabIndex        =   13
  90.       Top             =   1320
  91.       Width           =   1575
  92.    End
  93.    Begin VB.CommandButton SetAll 
  94.       Appearance      =   0  'Flat
  95.       BackColor       =   &H80000005&
  96.       Caption         =   "&Set All"
  97.       Height          =   375
  98.       Left            =   1680
  99.       TabIndex        =   11
  100.       Top             =   1560
  101.       Width           =   1335
  102.    End
  103.    Begin VB.CommandButton GetAll 
  104.       Appearance      =   0  'Flat
  105.       BackColor       =   &H80000005&
  106.       Caption         =   "&Get All"
  107.       Default         =   -1  'True
  108.       Height          =   375
  109.       Left            =   1680
  110.       TabIndex        =   12
  111.       Top             =   2280
  112.       Width           =   1335
  113.    End
  114.    Begin VB.CommandButton SetText 
  115.       Appearance      =   0  'Flat
  116.       BackColor       =   &H80000005&
  117.       Caption         =   "Set &Text"
  118.       Height          =   375
  119.       Left            =   1680
  120.       TabIndex        =   8
  121.       Top             =   1080
  122.       Width           =   1335
  123.    End
  124.    Begin VB.CommandButton SetY 
  125.       Appearance      =   0  'Flat
  126.       BackColor       =   &H80000005&
  127.       Caption         =   "Set &Y"
  128.       Height          =   375
  129.       Left            =   960
  130.       TabIndex        =   7
  131.       Top             =   1080
  132.       Width           =   615
  133.    End
  134.    Begin VB.CommandButton SetX 
  135.       Appearance      =   0  'Flat
  136.       BackColor       =   &H80000005&
  137.       Caption         =   "&Set &X"
  138.       Height          =   375
  139.       Left            =   240
  140.       TabIndex        =   6
  141.       Top             =   1080
  142.       Width           =   615
  143.    End
  144.    Begin VB.TextBox Text 
  145.       Appearance      =   0  'Flat
  146.       Height          =   375
  147.       Left            =   1680
  148.       TabIndex        =   5
  149.       Top             =   480
  150.       Width           =   1335
  151.    End
  152.    Begin VB.TextBox Y 
  153.       Appearance      =   0  'Flat
  154.       Height          =   375
  155.       Left            =   960
  156.       TabIndex        =   4
  157.       Top             =   480
  158.       Width           =   615
  159.    End
  160.    Begin VB.TextBox X 
  161.       Appearance      =   0  'Flat
  162.       Height          =   375
  163.       Left            =   240
  164.       TabIndex        =   3
  165.       Top             =   480
  166.       Width           =   615
  167.    End
  168.    Begin VB.CommandButton Close 
  169.       Appearance      =   0  'Flat
  170.       BackColor       =   &H80000005&
  171.       Caption         =   "&Close"
  172.       Height          =   375
  173.       Left            =   3360
  174.       TabIndex        =   16
  175.       Top             =   480
  176.       Width           =   1575
  177.    End
  178.    Begin VB.Label Label4 
  179.       Appearance      =   0  'Flat
  180.       BackColor       =   &H80000005&
  181.       Caption         =   "&WCode:"
  182.       ForeColor       =   &H80000008&
  183.       Height          =   375
  184.       Left            =   240
  185.       TabIndex        =   17
  186.       Top             =   3000
  187.       Width           =   735
  188.    End
  189.    Begin VB.Label Label3 
  190.       Appearance      =   0  'Flat
  191.       BackColor       =   &H80000005&
  192.       Caption         =   "&Text"
  193.       ForeColor       =   &H80000008&
  194.       Height          =   255
  195.       Left            =   1680
  196.       TabIndex        =   2
  197.       Top             =   240
  198.       Width           =   1335
  199.    End
  200.    Begin VB.Label Label2 
  201.       Appearance      =   0  'Flat
  202.       BackColor       =   &H80000005&
  203.       Caption         =   "&Y"
  204.       ForeColor       =   &H80000008&
  205.       Height          =   255
  206.       Left            =   960
  207.       TabIndex        =   1
  208.       Top             =   240
  209.       Width           =   615
  210.    End
  211.    Begin VB.Label Label1 
  212.       Appearance      =   0  'Flat
  213.       BackColor       =   &H80000005&
  214.       Caption         =   "&X"
  215.       ForeColor       =   &H80000008&
  216.       Height          =   255
  217.       Left            =   240
  218.       TabIndex        =   0
  219.       Top             =   240
  220.       Width           =   1215
  221.    End
  222. Attribute VB_Name = "Form1"
  223. Attribute VB_Creatable = False
  224. Attribute VB_Exposed = False
  225. Dim clik As ACDual.Document
  226. Dim pos As ACDual.Point
  227. Private Sub AnimatePosition_Click()
  228.     Set pos = clik.Position
  229.     For i = 10 To 100 Step 5
  230.         pos.x = i
  231.         pos.y = i
  232.         Set clik.Position = pos
  233.         DoEvents
  234.     Next i
  235. End Sub
  236. Private Sub AnimateXY_Click()
  237.     For i = 10 To 100 Step 5
  238.         clik.x = i
  239.         clik.y = i
  240.         DoEvents
  241.     Next i
  242. End Sub
  243. Private Sub Close_Click()
  244.     End
  245. End Sub
  246. Private Sub cmdTestError_Click()
  247.     On Error Resume Next    ' Defer error handling.
  248.     clik.TestError (txtWCode.Text)
  249.     ' Check for error, then show message.
  250.     If Err.Number <> 0 Then
  251.         Msg = "Error # " & Hex(Err.Number) & " was generated by " _
  252.               & Err.Source & Chr(13) & Err.Description
  253.         MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext
  254.     End If
  255. End Sub
  256. Private Sub Form_Load()
  257.     Set clik = New ACDual.Document
  258.     clik.ShowWindow
  259. End Sub
  260. Private Sub Form_Unload(Cancel As Integer)
  261.     Set clik = Nothing
  262. End Sub
  263. Private Sub GetAll_Click()
  264.     x.Text = clik.x
  265.     y.Text = clik.y
  266.     Text.Text = clik.Text
  267. End Sub
  268. Private Sub GetPosition_Click()
  269.     Set pos = clik.Position
  270.     x.Text = pos.x
  271.     y.Text = pos.y
  272. End Sub
  273. Private Sub RefreshDisplay_Click()
  274.     clik.RefreshWindow
  275. End Sub
  276. Private Sub SetAll_Click()
  277.     clik.SetAllProps x.Text, y.Text, Text.Text
  278. End Sub
  279. Private Sub SetPosition_Click()
  280.     Set pos = clik.Position
  281.     pos.x = x.Text
  282.     pos.y = y.Text
  283.     Set clik.Position = pos
  284. End Sub
  285. Private Sub SetText_Click()
  286.     clik.Text = Text.Text
  287. End Sub
  288. Private Sub SetX_Click()
  289.     clik.x = x.Text
  290. End Sub
  291. Private Sub SetY_Click()
  292.     clik.y = y.Text
  293. End Sub
  294.