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 / samples5 / ch07 / viewset.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1997-02-16  |  10.6 KB  |  335 lines

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