home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 1999 October / PCpro_1999_10.ISO / Tools / scrint9b / Source / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1998-07-11  |  18.3 KB  |  524 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  3. Object = "{84926CA3-2941-101C-816F-0E6013114B7F}#1.0#0"; "IMGSCAN.OCX"
  4. Object = "{6D940288-9F11-11CE-83FD-02608C3EC08A}#1.0#0"; "IMGEDIT.OCX"
  5. Object = "{009541A3-3B81-101C-92F3-040224009C02}#1.0#0"; "IMGADMIN.OCX"
  6. Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.1#0"; "RICHTX32.OCX"
  7. Begin VB.Form Form1 
  8.    ClientHeight    =   5430
  9.    ClientLeft      =   60
  10.    ClientTop       =   345
  11.    ClientWidth     =   5745
  12.    Icon            =   "Form1.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   5430
  15.    ScaleWidth      =   5745
  16.    StartUpPosition =   2  'Bildschirmmitte
  17.    Begin ScanLibCtl.ImgScan ImgScan1 
  18.       Left            =   480
  19.       Top             =   6120
  20.       _Version        =   65536
  21.       _ExtentX        =   1402
  22.       _ExtentY        =   1296
  23.       _StockProps     =   0
  24.       DestImageControl=   "ImgEdit1"
  25.       PageOption      =   0
  26.       PageType        =   6
  27.       CompressionType =   1
  28.       CompressionInfo =   0
  29.       MultiPage       =   -1  'True
  30.       ScanTo          =   5
  31.    End
  32.    Begin VB.PictureBox Layer 
  33.       BorderStyle     =   0  'Kein
  34.       DrawStyle       =   6  'Innen ausgef
  35.       Height          =   4455
  36.       Index           =   0
  37.       Left            =   240
  38.       ScaleHeight     =   4455
  39.       ScaleWidth      =   4995
  40.       TabIndex        =   1
  41.       Top             =   720
  42.       Width           =   4995
  43.       Begin VB.CommandButton Btn 
  44.          Height          =   1620
  45.          Index           =   0
  46.          Left            =   3240
  47.          Picture         =   "Form1.frx":030A
  48.          Style           =   1  'Grafisch
  49.          TabIndex        =   4
  50.          Top             =   2700
  51.          Width           =   1620
  52.       End
  53.       Begin VB.PictureBox ImgEdit1Frame3D 
  54.          Height          =   4335
  55.          Left            =   0
  56.          ScaleHeight     =   4629.964
  57.          ScaleMode       =   0  'Benutzer
  58.          ScaleWidth      =   3045
  59.          TabIndex        =   2
  60.          Top             =   0
  61.          Width           =   3105
  62.          Begin ImgeditLibCtl.ImgEdit ImgEdit1 
  63.             Height          =   2115
  64.             Left            =   840
  65.             TabIndex        =   3
  66.             Top             =   1080
  67.             Width           =   1695
  68.             _Version        =   65536
  69.             _ExtentX        =   2990
  70.             _ExtentY        =   3731
  71.             _StockProps     =   0
  72.             ImageControl    =   "ImgEdit1"
  73.             SelectionRectangleEnabled=   0   'False
  74.             BorderStyle     =   0
  75.             DisplayScaleAlgorithm=   4
  76.          End
  77.       End
  78.       Begin VB.Label CounterImg 
  79.          Alignment       =   2  'Zentriert
  80.          BackColor       =   &H00000000&
  81.          BorderStyle     =   1  'Fest Einfach
  82.          Caption         =   "01"
  83.          BeginProperty Font 
  84.             Name            =   "Courier New"
  85.             Size            =   63.75
  86.             Charset         =   0
  87.             Weight          =   700
  88.             Underline       =   0   'False
  89.             Italic          =   0   'False
  90.             Strikethrough   =   0   'False
  91.          EndProperty
  92.          ForeColor       =   &H000000FF&
  93.          Height          =   1455
  94.          Left            =   3360
  95.          TabIndex        =   20
  96.          Top             =   120
  97.          Width           =   1455
  98.       End
  99.    End
  100.    Begin VB.PictureBox Layer 
  101.       BorderStyle     =   0  'Kein
  102.       DrawStyle       =   6  'Innen ausgef
  103.       Height          =   4575
  104.       Index           =   1
  105.       Left            =   240
  106.       ScaleHeight     =   4575
  107.       ScaleWidth      =   4635
  108.       TabIndex        =   5
  109.       Top             =   600
  110.       Width           =   4635
  111.       Begin VB.PictureBox SubLayer1 
  112.          BorderStyle     =   0  'Kein
  113.          Height          =   2895
  114.          Left            =   120
  115.          ScaleHeight     =   2895
  116.          ScaleWidth      =   3135
  117.          TabIndex        =   10
  118.          Top             =   120
  119.          Width           =   3135
  120.          Begin VB.Frame Frame1 
  121.             Height          =   855
  122.             Left            =   0
  123.             TabIndex        =   17
  124.             Top             =   2040
  125.             Width           =   3135
  126.             Begin VB.CheckBox ShowSpecificSetupChk 
  127.                Caption         =   "Scanner-eigenes Setup anzeigen"
  128.                Height          =   255
  129.                Left            =   120
  130.                TabIndex        =   19
  131.                Top             =   240
  132.                Width           =   2895
  133.             End
  134.             Begin VB.CheckBox ShowSpecificSetupFirstPageChk 
  135.                Caption         =   "Nur beim ersten Scan"
  136.                Height          =   255
  137.                Left            =   360
  138.                TabIndex        =   18
  139.                Top             =   480
  140.                Width           =   2175
  141.             End
  142.          End
  143.          Begin VB.Frame Frame2 
  144.             Height          =   1455
  145.             Left            =   0
  146.             TabIndex        =   13
  147.             Top             =   0
  148.             Width           =   3135
  149.             Begin VB.CommandButton Btn 
  150.                Caption         =   "&Bildeinstellungen"
  151.                Height          =   300
  152.                Index           =   3
  153.                Left            =   120
  154.                TabIndex        =   16
  155.                Top             =   960
  156.                Width           =   2820
  157.             End
  158.             Begin VB.CommandButton Btn 
  159.                Caption         =   "&Druckerauswahl"
  160.                Height          =   315
  161.                Index           =   2
  162.                Left            =   120
  163.                TabIndex        =   15
  164.                Top             =   600
  165.                Width           =   2820
  166.             End
  167.             Begin VB.CommandButton Btn 
  168.                Caption         =   "&Scannerauswahl"
  169.                Height          =   300
  170.                Index           =   1
  171.                Left            =   120
  172.                TabIndex        =   14
  173.                Top             =   240
  174.                Width           =   2820
  175.             End
  176.          End
  177.          Begin VB.Frame Frame3 
  178.             Height          =   615
  179.             Left            =   0
  180.             TabIndex        =   11
  181.             Top             =   1440
  182.             Width           =   3135
  183.             Begin VB.CheckBox AskBeforePrintChk 
  184.                Caption         =   "Ausdruck quittieren lassen"
  185.                Height          =   255
  186.                Left            =   120
  187.                TabIndex        =   12
  188.                Top             =   240
  189.                Width           =   2535
  190.             End
  191.          End
  192.       End
  193.    End
  194.    Begin VB.PictureBox Layer 
  195.       BorderStyle     =   0  'Kein
  196.       DrawStyle       =   6  'Innen ausgef
  197.       Height          =   4455
  198.       Index           =   2
  199.       Left            =   240
  200.       ScaleHeight     =   4455
  201.       ScaleWidth      =   4995
  202.       TabIndex        =   6
  203.       Top             =   600
  204.       Width           =   4995
  205.       Begin RichTextLib.RichTextBox Rtf 
  206.          Height          =   3375
  207.          Left            =   840
  208.          TabIndex        =   7
  209.          Top             =   360
  210.          Width           =   3135
  211.          _ExtentX        =   5530
  212.          _ExtentY        =   5953
  213.          _Version        =   327681
  214.          BorderStyle     =   0
  215.          Enabled         =   -1  'True
  216.          ReadOnly        =   -1  'True
  217.          ScrollBars      =   2
  218.          TextRTF         =   $"Form1.frx":2234
  219.       End
  220.    End
  221.    Begin ComctlLib.TabStrip TabStrip1 
  222.       Height          =   5235
  223.       Left            =   60
  224.       TabIndex        =   0
  225.       Top             =   60
  226.       Width           =   5235
  227.       _ExtentX        =   9234
  228.       _ExtentY        =   9234
  229.       ShowTips        =   0   'False
  230.       _Version        =   327682
  231.       BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7} 
  232.          NumTabs         =   4
  233.          BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  234.             Caption         =   "Kopierer"
  235.             Key             =   ""
  236.             Object.Tag             =   ""
  237.             ImageVarType    =   2
  238.          EndProperty
  239.          BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  240.             Caption         =   "Optionen"
  241.             Key             =   ""
  242.             Object.Tag             =   ""
  243.             ImageVarType    =   2
  244.          EndProperty
  245.          BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  246.             Caption         =   "Hilfe"
  247.             Key             =   ""
  248.             Object.Tag             =   ""
  249.             ImageVarType    =   2
  250.          EndProperty
  251.          BeginProperty Tab4 {0713F341-850A-101B-AFC0-4210102A8DA7} 
  252.             Caption         =   "Info"
  253.             Key             =   ""
  254.             Object.Tag             =   ""
  255.             ImageVarType    =   2
  256.          EndProperty
  257.       EndProperty
  258.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  259.          Name            =   "MS Sans Serif"
  260.          Size            =   8.25
  261.          Charset         =   0
  262.          Weight          =   400
  263.          Underline       =   0   'False
  264.          Italic          =   0   'False
  265.          Strikethrough   =   0   'False
  266.       EndProperty
  267.    End
  268.    Begin VB.PictureBox Layer 
  269.       BorderStyle     =   0  'Kein
  270.       DrawStyle       =   6  'Innen ausgef
  271.       Height          =   4575
  272.       Index           =   3
  273.       Left            =   240
  274.       ScaleHeight     =   4575
  275.       ScaleWidth      =   4635
  276.       TabIndex        =   8
  277.       Top             =   720
  278.       Width           =   4635
  279.       Begin VB.Label WwInfo 
  280.          AutoSize        =   -1  'True
  281.          BackStyle       =   0  'Transparent
  282.          Height          =   195
  283.          Left            =   840
  284.          TabIndex        =   9
  285.          Top             =   1080
  286.          Width           =   660
  287.          WordWrap        =   -1  'True
  288.       End
  289.    End
  290.    Begin AdminLibCtl.ImgAdmin ImgAdmin1 
  291.       Left            =   1560
  292.       Top             =   6240
  293.       _Version        =   65536
  294.       _ExtentX        =   1402
  295.       _ExtentY        =   1296
  296.       _StockProps     =   0
  297.       CancelError     =   0   'False
  298.       PrintStartPage  =   0
  299.       PrintEndPage    =   0
  300.    End
  301. Attribute VB_Name = "Form1"
  302. Attribute VB_GlobalNameSpace = False
  303. Attribute VB_Creatable = False
  304. Attribute VB_PredeclaredId = True
  305. Attribute VB_Exposed = False
  306. '----------------------------------------------------
  307. '###SCRINT V1.0 (C) 1998 by W.Wirth
  308. '----------------------------------------------------
  309. Option Explicit
  310. Const Title = "Scrint f
  311. r Windows 95"
  312. Const cScrintFile = "Scrint.tif"
  313. Const cLogoFile = "Logo.tif"
  314. Const cHelpFile = "Scrint.rtf"
  315. Const dh = 60
  316. Const dw = 60
  317. Const phScan = 0
  318. Const phPrint = 1
  319. Const phPrinterSel = 2
  320. Const cPrintNowMsg = "Soll die eingescannte Seite jetzt gedruckt werden?"
  321. Const SettingIntro = "Wolfgang Wirth's VB-Tools"
  322. Const SettingAskBeforePrint = "AskBeforePrint"
  323. Const SettingShowSpecificSetup = "ShowSpecificSetup"
  324. Const SettingShowSpecificSetupFirstPage = "ShowSpecificSetupFirstPage"
  325. Const cWwInfo = "Scrint + Scanner + Printer = Fotokopierer" + vbCr + vbCr + _
  326.                 "
  327.  1998 by Wolfgang Wirth" + vbCr + vbCr + _
  328.                 "'Verbesserungsvorschl
  329. ge und konstruktive Kritik sind mir immer willkommen!'" + vbCr + vbCr + _
  330.                 "E-Mail: Toolmaker@iname.com" + vbCr + vbCr + _
  331.                 "Homepage: http://perso.wanadoo.fr/wolfgang.wirth/"
  332. Dim ScrintFile As String
  333. Dim LogoFile As String
  334. Dim FormatValue As Integer
  335. Dim SetupValue As Integer
  336. Dim CurrLayer As Integer
  337. Dim CopyCounter As Integer
  338. Dim FirstScanDone As Boolean
  339. Private Sub AskBeforePrintChk_Click()
  340.     SaveSetting SettingIntro, Title, SettingAskBeforePrint, AskBeforePrintChk.Value
  341. End Sub
  342. Private Sub CounterImg_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  343. Dim i As Integer
  344.     i = ImgAdmin1.PrintNumCopies
  345.     If Button = 2 Then If i > 1 Then SetCopyCounter i - 1 Else Beep
  346.     If Button = 1 Then If i < 99 Then SetCopyCounter i + 1 Else Beep
  347. End Sub
  348. Private Sub Form_Load()
  349.     Caption = Title
  350.     WwInfo.Caption = cWwInfo
  351.     SetCurrLayer 0
  352.     ScrintFile = App.Path + "\" + cScrintFile
  353.     LogoFile = App.Path + "\" + cLogoFile
  354.     ImgEdit1.Image = ScrintFile
  355.     ImgEdit1.ImagePalette = wiPaletteRGB24
  356.     ImgScan1.Image = ScrintFile
  357.     ImgScan1.FileType = TIFF
  358.     ImgScan1.MultiPage = False
  359.     ImgScan1.ScanTo = DisplayAndFile
  360.     ImgScan1.PageOption = CreateNewFile
  361.     SetCopyCounter 1
  362.     Rtf.LoadFile cHelpFile
  363.     AskBeforePrintChk.Value = GetSetting(SettingIntro, Title, SettingAskBeforePrint, 0)
  364.     ShowSpecificSetupChk.Value = GetSetting(SettingIntro, Title, SettingShowSpecificSetup, 1)
  365.     ShowSpecificSetupFirstPageChk.Value = GetSetting(SettingIntro, Title, SettingShowSpecificSetupFirstPage, 0)
  366. End Sub
  367. Sub SetCopyCounter(i As Integer)
  368.     If i > 99 Then i = 99
  369.     ImgAdmin1.PrintNumCopies = i
  370.     CounterImg.Caption = Right("0" & i, 2)
  371. End Sub
  372. Private Sub Btn_Click(Index As Integer)
  373.     '### Taster auswerten
  374.     Select Case Index
  375.         Case 0: 'Copy-Taste
  376.             Scrint phScan
  377.         Case 1: 'Scannerauswahl
  378.             ImgScan1.ShowSelectScanner
  379.         Case 2: 'Druckerauswahl
  380.             Scrint phPrinterSel
  381.         Case 3: 'Scannereinstellungen (SCRINT-eigen)
  382.             ImgScan1.ShowScanPreferences
  383.     End Select
  384. End Sub
  385. Private Sub ImgScan1_ScanDone()
  386.     Scrint phPrint
  387. End Sub
  388. Sub Scrint(Phase As Integer)
  389. Dim bPrintAborted As Boolean
  390.     On Error GoTo ScrintError
  391.     Select Case Phase
  392.         Case phScan '---ScanPhase
  393.             '--- Scanner eig. Setup einblenden?
  394.             ImgScan1.ShowSetupBeforeScan = True
  395.             If ShowSpecificSetupChk.Value = 1 Then
  396.                 If ShowSpecificSetupFirstPageChk.Value = 1 Then
  397.                     If FirstScanDone Then
  398.                         ImgScan1.ShowSetupBeforeScan = False
  399.                     End If
  400.                 End If
  401.             Else
  402.                 ImgScan1.ShowSetupBeforeScan = False
  403.             End If
  404.             '--- Scan vorbereiten und starten
  405.             ImgAdmin1.Image = ScrintFile
  406.             If ImgAdmin1.VerifyImage(0) Then Kill ScrintFile
  407.             ImgScan1.StartScan
  408.         Case phPrint '---DruckPhase
  409.             '--- Scan fertig. Jetzt speichern und dann drucken
  410.             ImgScan1.CloseScanner
  411.             ImgEdit1.SaveAs ScrintFile, , , , , False
  412.             ImgEdit1.FitTo 0
  413.             ImgEdit1.Display
  414.             '--- Quittierung vor Druck gew
  415. nscht?
  416.             If AskBeforePrintChk.Value = 1 Then
  417.                 bPrintAborted = vbNo = MsgBox(cPrintNowMsg, vbYesNo, Title)
  418.             End If
  419.             If Not bPrintAborted Then
  420.                 ImgEdit1.PrintImage ImgAdmin1.PrintStartPage, ImgAdmin1.PrintEndPage, _
  421.                     ImgAdmin1.PrintOutputFormat, False
  422.                 FirstScanDone = True
  423.             End If
  424.             ImgEdit1.ClearDisplay
  425.         Case phPrinterSel '---Druckerauswahl
  426.             ImgAdmin1.Image = LogoFile
  427.             ImgAdmin1.ShowPrintDialog hWnd
  428.             ImgAdmin1.Image = ScrintFile
  429.             SetCopyCounter ImgAdmin1.PrintNumCopies
  430.     End Select
  431.     On Error GoTo 0
  432. Exit Sub
  433. '#############################################
  434. ScrintError:
  435.     MsgBox "Es kam zu folgendem Problem:" + vbCr + vbCr + Err.Description & _
  436.         " (" & Err.Number & ")" + vbCr + vbCr + "Ort: " & Err.Source + vbCr + vbCr + _
  437.         "Phase: " & Phase, vbCritical, Title
  438.     Resume Next
  439. End Sub
  440. Private Sub ShowSpecificSetupChk_Click()
  441.     SaveSetting SettingIntro, Title, SettingShowSpecificSetup, ShowSpecificSetupChk.Value
  442. End Sub
  443. Private Sub ShowSpecificSetupFirstPageChk_Click()
  444.     SaveSetting SettingIntro, Title, SettingShowSpecificSetupFirstPage, ShowSpecificSetupFirstPageChk.Value
  445. End Sub
  446.  Sub TabStrip1_Click()
  447.     SetCurrLayer TabStrip1.SelectedItem.Index - 1
  448. End Sub
  449.  Sub SetCurrLayer(i As Integer)
  450.     CurrLayer = i
  451.     Layer(CurrLayer).ZOrder 0
  452. End Sub
  453. Private Sub Form_Resize()
  454. Dim i As Long
  455.     If WindowState <> 1 Then
  456.         i = 2.8 * Btn(0).Width
  457.         If Width < i Then Width = i
  458.         i = 2.4 * Btn(0).Height
  459.         If Height < i Then Height = i
  460.         
  461.         With TabStrip1
  462.             .Width = ScaleWidth - 2 * dw
  463.             .Height = ScaleHeight - 2 * dh
  464.             .Top = dh
  465.             .Left = dw
  466.         End With
  467.         
  468.         For i = 0 To 3
  469.             With Layer(i)
  470.                 .Width = TabStrip1.ClientWidth
  471.                 .Height = TabStrip1.ClientHeight
  472.                 .Top = TabStrip1.ClientTop
  473.                 .Left = TabStrip1.ClientLeft
  474.             End With
  475.         Next
  476.         
  477.         With Btn(0)
  478.             .Top = Layer(0).ScaleHeight - .Height - dh
  479.             .Left = Layer(0).ScaleWidth - .Width - dw
  480.         End With
  481.         
  482.         With CounterImg
  483.             If .Height + 2 * dh < Btn(0).Top Then
  484.                 .Width = Btn(0).Width
  485.                 '.Height = btn(0).Height
  486.                 .Top = dh
  487.                 .Left = Btn(0).Left
  488.                 .Visible = True
  489.             Else
  490.                 .Visible = False
  491.             End If
  492.         End With
  493.         
  494.         With ImgEdit1Frame3D
  495.             .Width = Btn(0).Left - 3 * dw
  496.             .Height = Layer(0).ScaleHeight - 2 * dh
  497.             .Top = dh
  498.             .Left = dw
  499.         End With
  500.         
  501.         ImgEdit1.Width = ImgEdit1Frame3D.ScaleWidth
  502.         ImgEdit1.Height = ImgEdit1Frame3D.ScaleHeight
  503.         ImgEdit1.Top = 0
  504.         ImgEdit1.Left = 0
  505.         
  506.         ImgEdit1.FitTo 0
  507.         
  508.         With Rtf
  509.             .Width = Layer(0).ScaleWidth - 2 * dw
  510.             .Height = Layer(0).ScaleHeight - 2 * dh
  511.             .Top = dh
  512.             .Left = dw
  513.         End With
  514.     End If
  515.     With WwInfo
  516.         .Top = (Layer(0).ScaleHeight - .Height) / 2
  517.         .Left = (Layer(0).ScaleWidth - .Width) / 2
  518.     End With
  519.     With SubLayer1
  520.         .Top = (Layer(0).ScaleHeight - .Height) / 2
  521.         .Left = (Layer(0).ScaleWidth - .Width) / 2
  522.     End With
  523. End Sub
  524.