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