home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD4545452000.psc / MainForm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-04-05  |  6.5 KB  |  220 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form MainForm 
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "UU Class Project Tester"
  7.    ClientHeight    =   3150
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   5070
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   3150
  15.    ScaleWidth      =   5070
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.CommandButton DoProgDec 
  18.       Caption         =   "Progressive Decode"
  19.       Height          =   375
  20.       Left            =   3000
  21.       TabIndex        =   12
  22.       Top             =   1080
  23.       Width           =   1935
  24.    End
  25.    Begin MSComctlLib.ProgressBar EncProg 
  26.       Height          =   255
  27.       Left            =   120
  28.       TabIndex        =   8
  29.       Top             =   2040
  30.       Width           =   4815
  31.       _ExtentX        =   8493
  32.       _ExtentY        =   450
  33.       _Version        =   393216
  34.       Appearance      =   1
  35.    End
  36.    Begin VB.CommandButton DoDecode 
  37.       Caption         =   "Decode"
  38.       Height          =   375
  39.       Left            =   1560
  40.       TabIndex        =   7
  41.       Top             =   1080
  42.       Width           =   1335
  43.    End
  44.    Begin VB.CommandButton DoEncode 
  45.       Caption         =   "Encode"
  46.       Height          =   375
  47.       Left            =   120
  48.       TabIndex        =   6
  49.       Top             =   1080
  50.       Width           =   1335
  51.    End
  52.    Begin VB.CommandButton PickOutFile 
  53.       Caption         =   "..."
  54.       Height          =   255
  55.       Left            =   4680
  56.       TabIndex        =   5
  57.       Top             =   600
  58.       Width           =   255
  59.    End
  60.    Begin VB.CommandButton PickInFile 
  61.       Caption         =   "..."
  62.       Height          =   255
  63.       Left            =   4680
  64.       TabIndex        =   4
  65.       Top             =   120
  66.       Width           =   255
  67.    End
  68.    Begin VB.TextBox OutFile 
  69.       Height          =   285
  70.       Left            =   1800
  71.       TabIndex        =   1
  72.       Top             =   600
  73.       Width           =   2775
  74.    End
  75.    Begin VB.TextBox InFile 
  76.       Height          =   285
  77.       Left            =   1800
  78.       TabIndex        =   0
  79.       Text            =   "C:\Code\UU Class\Test Files\Aolback.uue"
  80.       Top             =   120
  81.       Width           =   2775
  82.    End
  83.    Begin MSComDlg.CommonDialog Dialogs 
  84.       Left            =   4440
  85.       Top             =   1560
  86.       _ExtentX        =   847
  87.       _ExtentY        =   847
  88.       _Version        =   393216
  89.    End
  90.    Begin MSComctlLib.ProgressBar DecProg 
  91.       Height          =   255
  92.       Left            =   120
  93.       TabIndex        =   9
  94.       Top             =   2760
  95.       Width           =   4815
  96.       _ExtentX        =   8493
  97.       _ExtentY        =   450
  98.       _Version        =   393216
  99.       Appearance      =   1
  100.    End
  101.    Begin VB.Label Label 
  102.       Caption         =   "Decode Progress:"
  103.       Height          =   255
  104.       Index           =   3
  105.       Left            =   120
  106.       TabIndex        =   11
  107.       Top             =   2520
  108.       Width           =   1575
  109.    End
  110.    Begin VB.Label Label 
  111.       Caption         =   "Encode Progress:"
  112.       Height          =   255
  113.       Index           =   2
  114.       Left            =   120
  115.       TabIndex        =   10
  116.       Top             =   1800
  117.       Width           =   1575
  118.    End
  119.    Begin VB.Label Label 
  120.       Alignment       =   1  'Right Justify
  121.       Caption         =   "Output Filename:"
  122.       Height          =   255
  123.       Index           =   1
  124.       Left            =   120
  125.       TabIndex        =   3
  126.       Top             =   600
  127.       Width           =   1575
  128.    End
  129.    Begin VB.Label Label 
  130.       Alignment       =   1  'Right Justify
  131.       Caption         =   "Input Filename:"
  132.       Height          =   255
  133.       Index           =   0
  134.       Left            =   120
  135.       TabIndex        =   2
  136.       Top             =   120
  137.       Width           =   1575
  138.    End
  139. Attribute VB_Name = "MainForm"
  140. Attribute VB_GlobalNameSpace = False
  141. Attribute VB_Creatable = False
  142. Attribute VB_PredeclaredId = True
  143. Attribute VB_Exposed = False
  144. Option Explicit
  145. Dim WithEvents UUCoder As UUTools
  146. Attribute UUCoder.VB_VarHelpID = -1
  147. Private Sub DoDecode_Click()
  148.     Dim timeholder As Double
  149.     If InFile <> "" Then
  150.         timeholder = Timer
  151.         UUCoder.UUDecodeFile InFile.Text
  152.         MsgBox Timer - timeholder
  153.     End If
  154.     InFile = ""
  155.     DecProg.Value = 0
  156. End Sub
  157. Private Sub DoEncode_Click()
  158.     Dim timeholder As Double
  159.     If InFile <> "" And OutFile <> "" Then
  160.         timeholder = Timer
  161.         UUCoder.UUEncodeFile InFile.Text, OutFile.Text
  162.         MsgBox Timer - timeholder
  163.     End If
  164.     InFile = ""
  165.     OutFile = ""
  166.     EncProg.Value = 0
  167. End Sub
  168. Private Sub DoProgDec_Click()
  169.     Dim i As Long
  170.     Dim TotalParts As Long
  171.     Dim CurrentPos As Long
  172.     Dim Remain As Long
  173.     Dim Buffer As String
  174.     Dim timeholder As Double
  175.     Open InFile.Text For Binary Access Read Shared As #1
  176.     TotalParts = LOF(1) \ 1000
  177.     Remain = LOF(1) Mod 1000
  178.     CurrentPos = 1
  179.     Buffer = String(1000, 0)
  180.     timeholder = Timer
  181.     For i = 1 To TotalParts
  182.         Buffer = String(1000, 0)
  183.         Get #1, CurrentPos, Buffer
  184.         UUCoder.ProgressiveDecode Buffer, "C:\Code\UU Class\Test Files\"
  185.         CurrentPos = CurrentPos + 1000
  186.     Next
  187.     Buffer = String(Remain, 0)
  188.     Get #1, CurrentPos, Buffer
  189.     UUCoder.ProgressiveDecode Buffer, "C:\Code\UU Class\Test Files\"
  190.     MsgBox "Total Time: " & Timer - timeholder
  191.     Close #1
  192. End Sub
  193. Private Sub Form_Load()
  194.     Set UUCoder = New UUTools
  195.     EncProg.Min = 0
  196.     EncProg.Max = 1000
  197.     EncProg.Value = 0
  198.     DecProg.Min = 0
  199.     DecProg.Max = 1000
  200.     DecProg.Value = 0
  201. End Sub
  202. Private Sub PickInFile_Click()
  203.     Dialogs.Filename = ""
  204.     Dialogs.ShowOpen
  205.     InFile = Dialogs.Filename
  206. End Sub
  207. Private Sub PickOutFile_Click()
  208.     Dialogs.Filename = ""
  209.     Dialogs.ShowSave
  210.     OutFile = Dialogs.Filename
  211. End Sub
  212. Private Sub UUCoder_DecodeProgress(ByVal Percent As Single, ByVal Total As Long)
  213.     DecProg.Value = Percent * 1000
  214.     DoEvents
  215. End Sub
  216. Private Sub UUCoder_EncodeProgress(ByVal Percent As Single, ByVal Total As Long)
  217.     EncProg.Value = Percent * 1000
  218.     DoEvents
  219. End Sub
  220.