home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / PRINT.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-01-01  |  7.4 KB  |  240 lines

  1. VERSION 4.00
  2. Begin VB.Form PrintForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Print"
  5.    ClientHeight    =   5295
  6.    ClientLeft      =   1995
  7.    ClientTop       =   2610
  8.    ClientWidth     =   6015
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   1
  12.       weight          =   700
  13.       size            =   8.25
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   5700
  19.    Left            =   1935
  20.    LinkTopic       =   "Form1"
  21.    LockControls    =   -1  'True
  22.    MaxButton       =   0   'False
  23.    MinButton       =   0   'False
  24.    ScaleHeight     =   5295
  25.    ScaleWidth      =   6015
  26.    ShowInTaskbar   =   0   'False
  27.    Top             =   2265
  28.    Width           =   6135
  29.    Begin VB.Frame Frame1 
  30.       Caption         =   "Placement (in DPI)"
  31.       Height          =   2265
  32.       Left            =   3840
  33.       TabIndex        =   4
  34.       Top             =   240
  35.       Width           =   1905
  36.       Begin VB.TextBox DimDPI 
  37.          Height          =   285
  38.          Left            =   930
  39.          TabIndex        =   13
  40.          Text            =   "300"
  41.          Top             =   1815
  42.          Width           =   690
  43.       End
  44.       Begin VB.TextBox DimHeight 
  45.          Height          =   285
  46.          Left            =   930
  47.          TabIndex        =   12
  48.          Text            =   "300"
  49.          Top             =   1425
  50.          Width           =   690
  51.       End
  52.       Begin VB.TextBox DimWidth 
  53.          Height          =   285
  54.          Left            =   930
  55.          TabIndex        =   11
  56.          Text            =   "300"
  57.          Top             =   1035
  58.          Width           =   690
  59.       End
  60.       Begin VB.TextBox DimTop 
  61.          Height          =   285
  62.          Left            =   930
  63.          TabIndex        =   10
  64.          Text            =   "300"
  65.          Top             =   660
  66.          Width           =   690
  67.       End
  68.       Begin VB.TextBox DimLeft 
  69.          Height          =   285
  70.          Left            =   930
  71.          TabIndex        =   9
  72.          Text            =   "300"
  73.          Top             =   270
  74.          Width           =   690
  75.       End
  76.       Begin VB.Label Label5 
  77.          Caption         =   "DPI:"
  78.          Height          =   255
  79.          Left            =   195
  80.          TabIndex        =   14
  81.          Top             =   1845
  82.          Width           =   540
  83.       End
  84.       Begin VB.Label Label4 
  85.          Caption         =   "Height:"
  86.          Height          =   255
  87.          Left            =   195
  88.          TabIndex        =   8
  89.          Top             =   1470
  90.          Width           =   705
  91.       End
  92.       Begin VB.Label Label3 
  93.          Caption         =   "Width:"
  94.          Height          =   240
  95.          Left            =   195
  96.          TabIndex        =   7
  97.          Top             =   1095
  98.          Width           =   645
  99.       End
  100.       Begin VB.Label Label2 
  101.          Caption         =   "Left:"
  102.          Height          =   240
  103.          Left            =   195
  104.          TabIndex        =   6
  105.          Top             =   315
  106.          Width           =   450
  107.       End
  108.       Begin VB.Label Label1 
  109.          Caption         =   "Top:"
  110.          Height          =   240
  111.          Left            =   195
  112.          TabIndex        =   5
  113.          Top             =   705
  114.          Width           =   525
  115.       End
  116.    End
  117.    Begin VB.CommandButton Cancel 
  118.       Cancel          =   -1  'True
  119.       Caption         =   "Cancel"
  120.       Height          =   375
  121.       Left            =   4215
  122.       TabIndex        =   3
  123.       Top             =   4680
  124.       Width           =   1200
  125.    End
  126.    Begin VB.CommandButton OK 
  127.       Caption         =   "OK"
  128.       Default         =   -1  'True
  129.       Height          =   375
  130.       Left            =   600
  131.       TabIndex        =   1
  132.       Top             =   4680
  133.       Width           =   1200
  134.    End
  135.    Begin VB.CommandButton Preview 
  136.       Caption         =   "&Preview"
  137.       Height          =   375
  138.       Left            =   2460
  139.       TabIndex        =   2
  140.       Top             =   4680
  141.       Width           =   1200
  142.    End
  143.    Begin VB.PictureBox PageToPrint 
  144.       Appearance      =   0  'Flat
  145.       BackColor       =   &H80000005&
  146.       BeginProperty Font 
  147.          name            =   "MS Sans Serif"
  148.          charset         =   1
  149.          weight          =   400
  150.          size            =   8.25
  151.          underline       =   0   'False
  152.          italic          =   0   'False
  153.          strikethrough   =   0   'False
  154.       EndProperty
  155.       ForeColor       =   &H80000008&
  156.       Height          =   3990
  157.       Left            =   240
  158.       ScaleHeight     =   264
  159.       ScaleMode       =   3  'Pixel
  160.       ScaleWidth      =   204
  161.       TabIndex        =   0
  162.       TabStop         =   0   'False
  163.       Top             =   480
  164.       Width           =   3090
  165.       Begin LeadLib.Lead Lead1 
  166.          Height          =   1185
  167.          Left            =   135
  168.          Top             =   120
  169.          Width           =   1395
  170.          _version        =   327681
  171.          _extentx        =   2461
  172.          _extenty        =   2090
  173.          _stockprops     =   97
  174.          backcolor       =   12583104
  175.       End
  176.    End
  177.    Begin VB.Shape Shape1 
  178.       FillColor       =   &H00FFFFFF&
  179.       FillStyle       =   0  'Solid
  180.       Height          =   3975
  181.       Left            =   375
  182.       Top             =   360
  183.       Width           =   3105
  184.    End
  185.    Begin VB.Shape Shape2 
  186.       FillColor       =   &H00FFFFFF&
  187.       FillStyle       =   0  'Solid
  188.       Height          =   3975
  189.       Left            =   540
  190.       Top             =   240
  191.       Width           =   3075
  192.    End
  193. Attribute VB_Name = "PrintForm"
  194. Attribute VB_Creatable = False
  195. Attribute VB_Exposed = False
  196. Dim fPrintGo As Boolean
  197. Private Sub ResetAllRects(DispWidth%, DispHeight%)
  198. LEAD1.SetSrcRect 0, 0, LEAD1.BitmapWidth, LEAD1.BitmapHeight
  199. LEAD1.SetSrcClipRect 0, 0, LEAD1.BitmapWidth, LEAD1.BitmapHeight
  200. LEAD1.SetDstRect 0, 0, DispWidth, DispHeight
  201. LEAD1.SetDstClipRect 0, 0, DispWidth, DispHeight
  202. End Sub
  203. Public Function UserResult() As Boolean
  204. UserResult = fPrintGo
  205. End Function
  206. Public Sub GetDimensions(PrintLeft%, PrintTop%, PrintWidth%, PrintHeight%)
  207. PrintLeft = DimLeft
  208. PrintTop = DimTop
  209. PrintWidth = DimWidth
  210. PrintHeight = DimHeight
  211. End Sub
  212. Private Sub Cancel_Click()
  213. End Sub
  214. Private Sub Form_Load()
  215. fPrintGo = False
  216. LEAD1.AutoScroll = False
  217. LEAD1.AutoRepaint = False
  218. LEAD1.BackErase = True
  219. LEAD1.Bitmap = Main.ActiveForm.LEAD1.Bitmap
  220. Preview_Click
  221. Left = (Screen.Width - Width) / 2
  222. Top = (Screen.Height - Height) / 2
  223. End Sub
  224. Private Sub OK_Click()
  225. fPrintGo = True
  226. End Sub
  227. Private Sub Preview_Click()
  228. Dim NewLeft As Integer
  229. Dim NewTop As Integer
  230. Dim NewWidth As Integer
  231. Dim NewHeight As Integer
  232. NewLeft = CInt(CLng(DimLeft) * PageToPrint.ScaleWidth / DimDPI / 8.5)
  233. NewTop = CInt(CLng(DimTop) * PageToPrint.ScaleHeight / DimDPI / 11)
  234. NewWidth = CInt(CLng(DimWidth) * PageToPrint.ScaleWidth / DimDPI / 8.5)
  235. NewHeight = CInt(CLng(DimHeight) * PageToPrint.ScaleHeight / DimDPI / 11)
  236. ResetAllRects NewWidth, NewHeight
  237. LEAD1.Move NewLeft, NewTop, NewWidth, NewHeight
  238. LEAD1.ForceRepaint
  239. End Sub
  240.