home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 November / pcwk_11_98a.iso / Wtestowe / SOFTSRC / vtrial15.exe / DATA.1 / Zoom.frm < prev    next >
Text File  |  1997-02-14  |  4KB  |  165 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "The Zoomer"
  4.    ClientHeight    =   1620
  5.    ClientLeft      =   8940
  6.    ClientTop       =   1470
  7.    ClientWidth     =   3225
  8.    ControlBox      =   0   'False
  9.    Height          =   2025
  10.    Icon            =   "Zoom.frx":0000
  11.    Left            =   8880
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1620
  16.    ScaleWidth      =   3225
  17.    ShowInTaskbar   =   0   'False
  18.    Top             =   1125
  19.    WhatsThisHelp   =   -1  'True
  20.    Width           =   3345
  21.    Begin VB.CommandButton Command1 
  22.       Caption         =   "Zoom Extents"
  23.       Height          =   375
  24.       Left            =   1800
  25.       TabIndex        =   6
  26.       Top             =   120
  27.       Width           =   1215
  28.    End
  29.    Begin VB.Frame Frame1 
  30.       Height          =   1455
  31.       Left            =   120
  32.       TabIndex        =   2
  33.       Top             =   0
  34.       Width           =   1455
  35.       Begin VB.CommandButton ZoomCmd 
  36.          Caption         =   "Zoom !"
  37.          BeginProperty Font 
  38.             name            =   "MS Sans Serif"
  39.             charset         =   0
  40.             weight          =   700
  41.             size            =   9.75
  42.             underline       =   0   'False
  43.             italic          =   0   'False
  44.             strikethrough   =   0   'False
  45.          EndProperty
  46.          Height          =   375
  47.          Left            =   240
  48.          TabIndex        =   4
  49.          Top             =   960
  50.          Width           =   975
  51.       End
  52.       Begin VB.TextBox ZoomFactor 
  53.          Height          =   285
  54.          Left            =   240
  55.          TabIndex        =   3
  56.          Text            =   "0.9"
  57.          Top             =   480
  58.          Width           =   975
  59.       End
  60.       Begin VB.Label Label1 
  61.          Alignment       =   2  'Center
  62.          Caption         =   "Zoom Factor"
  63.          BeginProperty Font 
  64.             name            =   "MS Sans Serif"
  65.             charset         =   0
  66.             weight          =   700
  67.             size            =   8.25
  68.             underline       =   0   'False
  69.             italic          =   0   'False
  70.             strikethrough   =   0   'False
  71.          EndProperty
  72.          Height          =   255
  73.          Left            =   120
  74.          TabIndex        =   5
  75.          Top             =   240
  76.          Width           =   1215
  77.       End
  78.    End
  79.    Begin VB.CommandButton AboutCmd 
  80.       Caption         =   "About"
  81.       Height          =   375
  82.       Left            =   1800
  83.       TabIndex        =   1
  84.       Top             =   600
  85.       Width           =   1215
  86.    End
  87.    Begin VB.CommandButton QuitCmd 
  88.       Caption         =   "&Quit"
  89.       Height          =   375
  90.       Left            =   1800
  91.       TabIndex        =   0
  92.       Top             =   1080
  93.       Width           =   1215
  94.    End
  95. End
  96. Attribute VB_Name = "Form1"
  97. Attribute VB_Creatable = False
  98. Attribute VB_Exposed = False
  99. ' (C) Copyright 1997 by SoftSource.  All rights reserved.
  100. ' Sample Visual Basic code for working with Vdraft
  101. '
  102. ' This code demonstrates changing the view
  103. '   in a drawing
  104.  
  105.  
  106. Option Explicit
  107.  
  108. Dim Vdraft As Object
  109.  
  110. Private Sub AboutCmd_Click()
  111. '
  112. '   show the about box
  113. '
  114.     AboutForm.Show
  115. End Sub
  116.  
  117. Private Sub Command1_Click()
  118. '
  119. '   zoom extents
  120. '
  121.     If Not Vdraft.Documents.Count = 0 Then
  122.         Vdraft.ActiveDocument.Views.ActiveView.Extents
  123.     End If
  124. End Sub
  125.  
  126. Private Sub Form_Load()
  127. '
  128. '   main form inits
  129. '
  130.     WindowOnTop hWnd
  131.  
  132.     Form1.Left = (Screen.Width - Form1.Width) / 2
  133.     Form1.Top = (Screen.Height - Form1.Height) / 2
  134.     
  135.     Set Vdraft = CreateObject("Vdraft.Application")
  136. End Sub
  137.  
  138.  
  139. Private Sub QuitCmd_Click()
  140.     End
  141. End Sub
  142.  
  143.  
  144. Private Sub ZoomCmd_Click()
  145. '
  146. '   do the requested zoom
  147. '
  148.     Dim ZoomFactor As Double
  149.     
  150.     If Vdraft.Documents.Count = 0 Then
  151.         Exit Sub
  152.     End If
  153.     
  154.     ZoomFactor = Val(Form1.ZoomFactor.Text)
  155.     
  156. '
  157. '   be sure the requested zoom factor is valid
  158.     If (ZoomFactor = 0) Then Exit Sub   ' doesn't make sense
  159.     If (ZoomFactor = 1) Then Exit Sub   ' same as what's already there
  160.  
  161.     Vdraft.ActiveDocument.Views.ActiveView.ZoomFactor ZoomFactor
  162. End Sub
  163.  
  164.  
  165.