home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples4 / ch07 / viewset.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1997-02-16  |  10.6 KB  |  336 lines

  1. VERSION 4.00
  2. Begin VB.Form frmSettings 
  3.    Caption         =   "Viewport & Window Settings"
  4.    ClientHeight    =   2955
  5.    ClientLeft      =   1815
  6.    ClientTop       =   2220
  7.    ClientWidth     =   6240
  8.    Height          =   3360
  9.    Left            =   1755
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2955
  12.    ScaleWidth      =   6240
  13.    Top             =   1875
  14.    Width           =   6360
  15.    Begin VB.Frame Frame3 
  16.       Caption         =   "Rectangle && Circle:"
  17.       Height          =   1335
  18.       Left            =   60
  19.       TabIndex        =   0
  20.       Top             =   60
  21.       Width           =   3495
  22.       Begin VB.TextBox txtRectY2 
  23.          Height          =   315
  24.          Left            =   2400
  25.          TabIndex        =   4
  26.          Text            =   "100"
  27.          Top             =   840
  28.          Width           =   675
  29.       End
  30.       Begin VB.TextBox txtRectX2 
  31.          Height          =   285
  32.          Left            =   1320
  33.          TabIndex        =   3
  34.          Text            =   "100"
  35.          Top             =   840
  36.          Width           =   675
  37.       End
  38.       Begin VB.TextBox txtRectY1 
  39.          Height          =   315
  40.          Left            =   2400
  41.          TabIndex        =   2
  42.          Text            =   "0"
  43.          Top             =   240
  44.          Width           =   675
  45.       End
  46.       Begin VB.TextBox txtRectX1 
  47.          Height          =   285
  48.          Left            =   1320
  49.          TabIndex        =   1
  50.          Text            =   "0"
  51.          Top             =   240
  52.          Width           =   675
  53.       End
  54.       Begin VB.Label Label7 
  55.          Caption         =   "Y: "
  56.          Height          =   255
  57.          Left            =   2160
  58.          TabIndex        =   28
  59.          Top             =   900
  60.          Width           =   135
  61.       End
  62.       Begin VB.Label Label6 
  63.          Caption         =   "Y: "
  64.          Height          =   255
  65.          Left            =   2160
  66.          TabIndex        =   27
  67.          Top             =   300
  68.          Width           =   135
  69.       End
  70.       Begin VB.Label Label1 
  71.          Caption         =   "Bottom Right:  X:"
  72.          Height          =   195
  73.          Index           =   5
  74.          Left            =   60
  75.          TabIndex        =   26
  76.          Top             =   900
  77.          Width           =   1275
  78.       End
  79.       Begin VB.Label Label1 
  80.          Caption         =   "Top Left:        X:"
  81.          Height          =   195
  82.          Index           =   4
  83.          Left            =   120
  84.          TabIndex        =   25
  85.          Top             =   300
  86.          Width           =   1155
  87.       End
  88.    End
  89.    Begin VB.CommandButton cmdCancel 
  90.       Cancel          =   -1  'True
  91.       Caption         =   "&Cancel"
  92.       Height          =   555
  93.       Left            =   4860
  94.       TabIndex        =   14
  95.       Top             =   840
  96.       Width           =   1215
  97.    End
  98.    Begin VB.CommandButton cmdOK 
  99.       Caption         =   "&OK"
  100.       Default         =   -1  'True
  101.       Height          =   555
  102.       Left            =   4860
  103.       TabIndex        =   13
  104.       Top             =   180
  105.       Width           =   1215
  106.    End
  107.    Begin VB.Frame Frame2 
  108.       Caption         =   "Viewport (Pixels):"
  109.       Height          =   1335
  110.       Left            =   60
  111.       TabIndex        =   20
  112.       Top             =   1500
  113.       Width           =   2955
  114.       Begin VB.TextBox txtViewOrgX 
  115.          Height          =   285
  116.          Left            =   1020
  117.          TabIndex        =   5
  118.          Text            =   "200"
  119.          Top             =   240
  120.          Width           =   675
  121.       End
  122.       Begin VB.TextBox txtViewOrgY 
  123.          Height          =   315
  124.          Left            =   2100
  125.          TabIndex        =   6
  126.          Text            =   "75"
  127.          Top             =   240
  128.          Width           =   675
  129.       End
  130.       Begin VB.TextBox txtViewExtX 
  131.          Height          =   285
  132.          Left            =   1020
  133.          TabIndex        =   7
  134.          Text            =   "100"
  135.          Top             =   840
  136.          Width           =   675
  137.       End
  138.       Begin VB.TextBox txtViewExtY 
  139.          Height          =   315
  140.          Left            =   2100
  141.          TabIndex        =   8
  142.          Text            =   "100"
  143.          Top             =   840
  144.          Width           =   675
  145.       End
  146.       Begin VB.Label Label1 
  147.          Caption         =   "Origin:   X: "
  148.          Height          =   195
  149.          Index           =   3
  150.          Left            =   120
  151.          TabIndex        =   24
  152.          Top             =   300
  153.          Width           =   855
  154.       End
  155.       Begin VB.Label Label1 
  156.          Caption         =   "Extents:   X:"
  157.          Height          =   195
  158.          Index           =   2
  159.          Left            =   60
  160.          TabIndex        =   23
  161.          Top             =   900
  162.          Width           =   915
  163.       End
  164.       Begin VB.Label Label5 
  165.          Caption         =   "Y: "
  166.          Height          =   255
  167.          Left            =   1860
  168.          TabIndex        =   22
  169.          Top             =   300
  170.          Width           =   135
  171.       End
  172.       Begin VB.Label Label4 
  173.          Caption         =   "Y: "
  174.          Height          =   255
  175.          Left            =   1860
  176.          TabIndex        =   21
  177.          Top             =   900
  178.          Width           =   135
  179.       End
  180.    End
  181.    Begin VB.Frame Frame1 
  182.       Caption         =   "Logical Window:"
  183.       Height          =   1335
  184.       Left            =   3180
  185.       TabIndex        =   15
  186.       Top             =   1500
  187.       Width           =   2955
  188.       Begin VB.TextBox txtWinExtY 
  189.          Height          =   315
  190.          Left            =   2100
  191.          TabIndex        =   12
  192.          Text            =   "100"
  193.          Top             =   840
  194.          Width           =   675
  195.       End
  196.       Begin VB.TextBox txtWinExtX 
  197.          Height          =   285
  198.          Left            =   1020
  199.          TabIndex        =   11
  200.          Text            =   "100"
  201.          Top             =   840
  202.          Width           =   675
  203.       End
  204.       Begin VB.TextBox txtWinOrgY 
  205.          Height          =   315
  206.          Left            =   2100
  207.          TabIndex        =   10
  208.          Text            =   "0"
  209.          Top             =   240
  210.          Width           =   675
  211.       End
  212.       Begin VB.TextBox txtWinOrgX 
  213.          Height          =   285
  214.          Left            =   1020
  215.          TabIndex        =   9
  216.          Text            =   "0"
  217.          Top             =   240
  218.          Width           =   675
  219.       End
  220.       Begin VB.Label Label3 
  221.          Caption         =   "Y: "
  222.          Height          =   255
  223.          Left            =   1860
  224.          TabIndex        =   19
  225.          Top             =   900
  226.          Width           =   135
  227.       End
  228.       Begin VB.Label Label2 
  229.          Caption         =   "Y: "
  230.          Height          =   255
  231.          Left            =   1860
  232.          TabIndex        =   18
  233.          Top             =   300
  234.          Width           =   135
  235.       End
  236.       Begin VB.Label Label1 
  237.          Caption         =   "Extents:   X:"
  238.          Height          =   195
  239.          Index           =   1
  240.          Left            =   60
  241.          TabIndex        =   17
  242.          Top             =   900
  243.          Width           =   915
  244.       End
  245.       Begin VB.Label Label1 
  246.          Caption         =   "Origin:   X: "
  247.          Height          =   195
  248.          Index           =   0
  249.          Left            =   120
  250.          TabIndex        =   16
  251.          Top             =   300
  252.          Width           =   855
  253.       End
  254.    End
  255. Attribute VB_Name = "frmSettings"
  256. Attribute VB_Creatable = False
  257. Attribute VB_Exposed = False
  258. Option Explicit
  259. ' Copyright 
  260.  1997 by Desaware Inc. All Rights Reserved
  261. Private Sub cmdCancel_Click()
  262.     Unload Me
  263. End Sub
  264. Private Sub cmdOK_Click()
  265.     frmViewport.viewOrgX& = CLng(txtViewOrgX)
  266.     frmViewport.viewOrgY& = CLng(txtViewOrgY)
  267.     frmViewport.viewExtX& = CLng(txtViewExtX)
  268.     frmViewport.viewExtY& = CLng(txtViewExtY)
  269.     frmViewport.WinOrgX& = CLng(txtWinOrgX)
  270.     frmViewport.WinOrgY& = CLng(txtWinOrgY)
  271.     frmViewport.WinExtX& = CLng(txtWinExtX)
  272.     frmViewport.WinExtY& = CLng(txtWinExtY)
  273.     frmViewport.RectX1& = CLng(txtRectX1)
  274.     frmViewport.RectY1& = CLng(txtRectY1)
  275.     frmViewport.RectX2& = CLng(txtRectX2)
  276.     frmViewport.RectY2& = CLng(txtRectY2)
  277.     frmViewport!pctScreen.Refresh
  278.     Unload Me
  279. End Sub
  280. Private Sub Text2_Change()
  281. End Sub
  282. Private Sub Form_Load()
  283.     txtViewOrgX = CStr(frmViewport.viewOrgX&)
  284.     txtViewOrgY = CStr(frmViewport.viewOrgY&)
  285.     txtViewExtX = CStr(frmViewport.viewExtX&)
  286.     txtViewExtY = CStr(frmViewport.viewExtY&)
  287.     txtWinOrgX = CStr(frmViewport.WinOrgX&)
  288.     txtWinOrgY = CStr(frmViewport.WinOrgY&)
  289.     txtWinExtX = CStr(frmViewport.WinExtX&)
  290.     txtWinExtY = CStr(frmViewport.WinExtY&)
  291.     txtRectX1 = CStr(frmViewport.RectX1&)
  292.     txtRectY1 = CStr(frmViewport.RectY1&)
  293.     txtRectX2 = CStr(frmViewport.RectX2&)
  294.     txtRectY2 = CStr(frmViewport.RectY2&)
  295. End Sub
  296. Private Sub txtViewExtX_KeyPress(KeyAscii As Integer)
  297.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  298.         KeyAscii = 0
  299.     End If
  300. End Sub
  301. Private Sub txtViewExtY_KeyPress(KeyAscii As Integer)
  302.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  303.         KeyAscii = 0
  304.     End If
  305. End Sub
  306. Private Sub txtViewOrgX_KeyPress(KeyAscii As Integer)
  307.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  308.         KeyAscii = 0
  309.     End If
  310. End Sub
  311. Private Sub txtViewOrgY_KeyPress(KeyAscii As Integer)
  312.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  313.         KeyAscii = 0
  314.     End If
  315. End Sub
  316. Private Sub txtWinExtX_KeyPress(KeyAscii As Integer)
  317.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  318.         KeyAscii = 0
  319.     End If
  320. End Sub
  321. Private Sub txtWinExtY_KeyPress(KeyAscii As Integer)
  322.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  323.         KeyAscii = 0
  324.     End If
  325. End Sub
  326. Private Sub txtWinOrgX_KeyPress(KeyAscii As Integer)
  327.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  328.         KeyAscii = 0
  329.     End If
  330. End Sub
  331. Private Sub txtWinOrgY_KeyPress(KeyAscii As Integer)
  332.     If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 Then
  333.         KeyAscii = 0
  334.     End If
  335. End Sub
  336.