home *** CD-ROM | disk | FTP | other *** search
/ BUG 6 / BUGCD1997_09.BIN / UTIL / ADDZIP / ADDZIP.EXE / VB / QUICKZIP / CMDIALOG.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-06-01  |  5.0 KB  |  170 lines

  1. VERSION 2.00
  2. Begin Form frmCmDialog 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Form1"
  6.    ClientHeight    =   3285
  7.    ClientLeft      =   1500
  8.    ClientTop       =   4470
  9.    ClientWidth     =   6945
  10.    Height          =   3690
  11.    Left            =   1440
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3285
  16.    ScaleWidth      =   6945
  17.    Top             =   4125
  18.    Width           =   7065
  19.    Begin ComboBox cboFileTypes 
  20.       Height          =   300
  21.       Left            =   120
  22.       Style           =   2  'Dropdown List
  23.       TabIndex        =   4
  24.       Top             =   2760
  25.       Width           =   2535
  26.    End
  27.    Begin TextBox txtFilename 
  28.       Height          =   285
  29.       Left            =   120
  30.       TabIndex        =   1
  31.       Top             =   360
  32.       Width           =   2535
  33.    End
  34.    Begin CommandButton cmdCancel 
  35.       Cancel          =   -1  'True
  36.       Caption         =   "Cancel"
  37.       Height          =   375
  38.       Left            =   5520
  39.       TabIndex        =   9
  40.       Top             =   600
  41.       Width           =   1335
  42.    End
  43.    Begin CommandButton cmdOK 
  44.       Caption         =   "OK"
  45.       Default         =   -1  'True
  46.       Height          =   375
  47.       Left            =   5520
  48.       TabIndex        =   8
  49.       Top             =   120
  50.       Width           =   1335
  51.    End
  52.    Begin FileListBox File1 
  53.       Height          =   1590
  54.       Left            =   120
  55.       Pattern         =   "*.zip"
  56.       TabIndex        =   2
  57.       Top             =   720
  58.       Width           =   2535
  59.    End
  60.    Begin DirListBox Dir1 
  61.       Height          =   1605
  62.       Left            =   2880
  63.       TabIndex        =   5
  64.       Top             =   720
  65.       Width           =   2535
  66.    End
  67.    Begin DriveListBox Drive1 
  68.       Height          =   315
  69.       Left            =   2880
  70.       TabIndex        =   7
  71.       Top             =   2760
  72.       Width           =   2535
  73.    End
  74.    Begin Label Label3 
  75.       BackStyle       =   0  'Transparent
  76.       Caption         =   "List Files of &Type:"
  77.       Height          =   255
  78.       Left            =   120
  79.       TabIndex        =   3
  80.       Top             =   2520
  81.       Width           =   2535
  82.    End
  83.    Begin Label Label2 
  84.       BackStyle       =   0  'Transparent
  85.       Caption         =   "Dri&ves:"
  86.       Height          =   255
  87.       Left            =   2880
  88.       TabIndex        =   6
  89.       Top             =   2520
  90.       Width           =   1335
  91.    End
  92.    Begin Label Label1 
  93.       BackStyle       =   0  'Transparent
  94.       Caption         =   "File &Name:"
  95.       Height          =   255
  96.       Left            =   120
  97.       TabIndex        =   0
  98.       Top             =   120
  99.       Width           =   2655
  100.    End
  101. Option Explicit
  102. Sub cboFileTypes_Click ()
  103.     Select Case cboFileTypes.ListIndex
  104.     Case 0
  105.         File1.Pattern = "*.zip"
  106.     Case 1
  107.         File1.Pattern = "*.*"
  108.     End Select
  109.     File1.Refresh
  110. End Sub
  111. Sub cmdCancel_Click ()
  112.     Unload Me
  113. End Sub
  114. Sub cmdOK_Click ()
  115.   g_cFile = Dir1.Path
  116.   If (Right$(g_cFile, 1) <> "\") Then g_cFile = g_cFile & "\"
  117.   g_cFile = g_cFile & txtFilename.Text
  118.   If (g_iNew) Then
  119.       If (txtFilename.Text = "") Then
  120.     MsgBox "No filename entered!", 16, "Error"
  121.     Exit Sub
  122.     End If
  123.   Else
  124.     If ((txtFilename.Text = "") Or (Dir$(g_cFile) = "")) Then
  125.     MsgBox g_cFile & " does not exist or is not a valid filename.", 16, "Error"
  126.     Exit Sub
  127.     End If
  128.   End If
  129.   Unload Me
  130. End Sub
  131. Sub Dir1_Change ()
  132.     File1.Path = Dir1.Path  ' When Dir changes, set File path.
  133. End Sub
  134. Sub Draw3D (a As Control)
  135.     Me.Line (a.Left - 10, a.Top - 10)-Step(10, a.Height + 20), RGB(128, 128, 128), BF
  136.     Me.Line (a.Left - 10, a.Top - 10)-Step(a.Width + 20, 10), RGB(128, 128, 128), BF
  137.     Me.Line (a.Left + a.Width, a.Top - 10)-Step(10, a.Height + 20), RGB(255, 255, 255), BF
  138.     Me.Line (a.Left - 10, a.Top + a.Height)-Step(a.Width + 20, 10), RGB(255, 255, 255), BF
  139. End Sub
  140. Sub Drive1_Change ()
  141.     Dir1.Path = Drive1.Drive    ' When Drive changes, set Dir path.
  142. End Sub
  143. Sub File1_Click ()
  144.     txtFilename.Text = File1.List(File1.ListIndex)
  145. End Sub
  146. Sub File1_DblClick ()
  147.     cmdOK_Click
  148. End Sub
  149. Sub Form_Load ()
  150.   Dim I As Integer
  151.   ' centre the form on screen
  152.   Move screen.Width / 2 - Me.Width / 2, screen.Height / 2 - Me.Height / 2
  153.   If (frmQuickZIP.mnuOptionsOnTop.Checked = True) Then
  154.       I = SetWindowPos(Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  155.   Else
  156.       I = SetWindowPos(Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, FLAGS)
  157.   End If
  158.   cboFileTypes.AddItem ".ZIP archives (*.zip)"
  159.   cboFileTypes.AddItem "All files (*.*)"
  160.   cboFileTypes.ListIndex = 0
  161.   Form_Colour Me
  162. End Sub
  163. Sub Form_Paint ()
  164.     Call Draw3D(File1)
  165.     Call Draw3D(Dir1)
  166.     Call Draw3D(Drive1)
  167.     Call Draw3D(txtFilename)
  168.     Call Draw3D(cboFileTypes)
  169. End Sub
  170.