home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / PVb5.0 / VB / SETUPKIT / SETUP1 / PATH.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-01-31  |  10.6 KB  |  337 lines

  1. VERSION 5.00
  2. Begin VB.Form frmPath 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "#"
  5.    ClientHeight    =   4710
  6.    ClientLeft      =   150
  7.    ClientTop       =   1530
  8.    ClientWidth     =   5955
  9.    ClipControls    =   0   'False
  10.    BeginProperty Font 
  11.       Name            =   "
  12.       Size            =   9
  13.       Charset         =   0
  14.       Weight          =   700
  15.       Underline       =   0   'False
  16.       Italic          =   0   'False
  17.       Strikethrough   =   0   'False
  18.    EndProperty
  19.    Icon            =   "path.frx":0000
  20.    KeyPreview      =   -1  'True
  21.    LinkTopic       =   "Form1"
  22.    LockControls    =   -1  'True
  23.    MaxButton       =   0   'False
  24.    MinButton       =   0   'False
  25.    ScaleHeight     =   4710
  26.    ScaleWidth      =   5955
  27.    Begin VB.CommandButton cmdCancel 
  28.       Cancel          =   -1  'True
  29.       Caption         =   "#"
  30.       BeginProperty Font 
  31.          Name            =   "
  32.          Size            =   9
  33.          Charset         =   0
  34.          Weight          =   400
  35.          Underline       =   0   'False
  36.          Italic          =   0   'False
  37.          Strikethrough   =   0   'False
  38.       EndProperty
  39.       Height          =   420
  40.       Left            =   4170
  41.       MaskColor       =   &H00000000&
  42.       TabIndex        =   7
  43.       Top             =   2640
  44.       Width           =   1560
  45.    End
  46.    Begin VB.CommandButton cmdOK 
  47.       Caption         =   "#"
  48.       Default         =   -1  'True
  49.       BeginProperty Font 
  50.          Name            =   "
  51.          Size            =   9
  52.          Charset         =   0
  53.          Weight          =   400
  54.          Underline       =   0   'False
  55.          Italic          =   0   'False
  56.          Strikethrough   =   0   'False
  57.       EndProperty
  58.       Height          =   420
  59.       Left            =   4170
  60.       MaskColor       =   &H00000000&
  61.       TabIndex        =   6
  62.       Top             =   1890
  63.       Width           =   1560
  64.    End
  65.    Begin VB.DriveListBox drvDrives 
  66.       BeginProperty Font 
  67.          Name            =   "
  68.          Size            =   9
  69.          Charset         =   0
  70.          Weight          =   400
  71.          Underline       =   0   'False
  72.          Italic          =   0   'False
  73.          Strikethrough   =   0   'False
  74.       EndProperty
  75.       Height          =   315
  76.       Left            =   216
  77.       TabIndex        =   5
  78.       Top             =   4140
  79.       Width           =   3510
  80.    End
  81.    Begin VB.DirListBox dirDirs 
  82.       BeginProperty Font 
  83.          Name            =   "
  84.          Size            =   9
  85.          Charset         =   0
  86.          Weight          =   400
  87.          Underline       =   0   'False
  88.          Italic          =   0   'False
  89.          Strikethrough   =   0   'False
  90.       EndProperty
  91.       Height          =   1605
  92.       Left            =   204
  93.       TabIndex        =   3
  94.       Top             =   1896
  95.       Width           =   3510
  96.    End
  97.    Begin VB.TextBox txtPath 
  98.       BeginProperty Font 
  99.          Name            =   "
  100.          Size            =   9
  101.          Charset         =   0
  102.          Weight          =   400
  103.          Underline       =   0   'False
  104.          Italic          =   0   'False
  105.          Strikethrough   =   0   'False
  106.       EndProperty
  107.       Height          =   288
  108.       Left            =   204
  109.       MaxLength       =   240
  110.       TabIndex        =   1
  111.       Top             =   1056
  112.       Width           =   5532
  113.    End
  114.    Begin VB.Label lblDrives 
  115.       AutoSize        =   -1  'True
  116.       Caption         =   "#"
  117.       BeginProperty Font 
  118.          Name            =   "
  119.          Size            =   9
  120.          Charset         =   0
  121.          Weight          =   400
  122.          Underline       =   0   'False
  123.          Italic          =   0   'False
  124.          Strikethrough   =   0   'False
  125.       EndProperty
  126.       Height          =   195
  127.       Left            =   210
  128.       TabIndex        =   4
  129.       Top             =   3870
  130.       Width           =   105
  131.    End
  132.    Begin VB.Label lblDirs 
  133.       AutoSize        =   -1  'True
  134.       Caption         =   "#"
  135.       BeginProperty Font 
  136.          Name            =   "
  137.          Size            =   9
  138.          Charset         =   0
  139.          Weight          =   400
  140.          Underline       =   0   'False
  141.          Italic          =   0   'False
  142.          Strikethrough   =   0   'False
  143.       EndProperty
  144.       Height          =   195
  145.       Left            =   210
  146.       TabIndex        =   2
  147.       Top             =   1590
  148.       Width           =   105
  149.    End
  150.    Begin VB.Label lblPath 
  151.       AutoSize        =   -1  'True
  152.       Caption         =   "#"
  153.       BeginProperty Font 
  154.          Name            =   "
  155.          Size            =   9
  156.          Charset         =   0
  157.          Weight          =   400
  158.          Underline       =   0   'False
  159.          Italic          =   0   'False
  160.          Strikethrough   =   0   'False
  161.       EndProperty
  162.       Height          =   195
  163.       Left            =   210
  164.       TabIndex        =   0
  165.       Top             =   750
  166.       Width           =   105
  167.    End
  168.    Begin VB.Label lblPrompt 
  169.       AutoSize        =   -1  'True
  170.       Caption         =   "*"
  171.       BeginProperty Font 
  172.          Name            =   "
  173.          Size            =   9
  174.          Charset         =   0
  175.          Weight          =   400
  176.          Underline       =   0   'False
  177.          Italic          =   0   'False
  178.          Strikethrough   =   0   'False
  179.       EndProperty
  180.       Height          =   192
  181.       Left            =   204
  182.       TabIndex        =   8
  183.       Top             =   204
  184.       Width           =   5532
  185.       WordWrap        =   -1  'True
  186.    End
  187. Attribute VB_Name = "frmPath"
  188. Attribute VB_GlobalNameSpace = False
  189. Attribute VB_Creatable = False
  190. Attribute VB_PredeclaredId = True
  191. Attribute VB_Exposed = False
  192. Option Explicit
  193. Option Compare Text
  194. Dim mfMustExist As Integer
  195. Dim mfCancelExit As Integer
  196. Private Sub cmdCancel_Click()
  197.     If mfCancelExit = True Then
  198.         ExitSetup Me, gintRET_EXIT
  199.     Else
  200.         gfRetVal = gintRET_CANCEL
  201.         Unload Me
  202.     End If
  203. End Sub
  204. Private Sub cmdOK_Click()
  205.     Dim strPathName As String
  206.     Dim strMsg As String
  207.     Dim intRet As Integer
  208.     SetMousePtr gintMOUSE_HOURGLASS
  209.     strPathName = ResolveDir(txtPath.Text, mfMustExist, True)
  210.     If strPathName <> gstrNULL Then
  211.         If frmSetup1.Tag = gstrDIR_DEST And strPathName <> gstrDestDir Then
  212.             If DirExists(strPathName) = False Then
  213.                 strMsg = ResolveResString(resDESTDIR) & LS$ & strPathName
  214.                 strMsg = strMsg & LS$ & ResolveResString(resCREATE)
  215.                 intRet = MsgFunc(strMsg, MB_YESNO Or MB_ICONQUESTION, gstrTitle)
  216.                 If gfNoUserInput = True Then
  217.                     ExitSetup Me, gintRET_FATAL
  218.                 End If
  219.                 If intRet = IDNO Then
  220.                     txtPath.SetFocus
  221.                     SetMousePtr gintMOUSE_DEFAULT
  222.                     Exit Sub
  223.                 End If
  224.             End If
  225.             If IsValidDestDir(strPathName) = False Then
  226.                 txtPath.SetFocus
  227.                 SetMousePtr gintMOUSE_DEFAULT
  228.                 Exit Sub
  229.             End If
  230.         End If
  231.         frmSetup1.Tag = strPathName
  232.         gfRetVal = gintRET_CONT
  233.         Unload Me
  234.     Else
  235.         txtPath.SetFocus
  236.     End If
  237.     SetMousePtr gintMOUSE_DEFAULT
  238. End Sub
  239. Private Sub dirDirs_Change()
  240.     Static intBusy As Integer
  241.     On Error Resume Next
  242.     If intBusy = False Then
  243.         intBusy = True
  244.         ChDir dirDirs.Path
  245.         If Err = 0 Then
  246.             txtPath.Text = dirDirs.Path
  247.             drvDrives.Drive = Left$(dirDirs.Path, 2)
  248.         Else
  249.             Err = 0
  250.         End If
  251.         intBusy = False
  252.     End If
  253. End Sub
  254. Private Sub drvDrives_Change()
  255.     Static strOldDrive As String
  256.     Static intBusy As Integer
  257.     Dim strDrive As String
  258.     If intBusy = False Then
  259.         intBusy = True
  260.         strDrive = drvDrives.Drive
  261.         If CheckDrive(strDrive, Me.Caption) = True Then
  262.             strOldDrive = strDrive
  263.             dirDirs.Path = strDrive
  264.         Else
  265.             drvDrives.Drive = strOldDrive
  266.         End If
  267.         intBusy = False
  268.     End If
  269. End Sub
  270. Private Sub Form_Load()
  271.     On Error Resume Next
  272.     SetMousePtr gintMOUSE_HOURGLASS
  273.     SetFormFont Me
  274.     cmdOK.Caption = ResolveResString(resBTNOK)
  275.     lblDrives.Caption = ResolveResString(resLBLDRIVES)
  276.     lblDirs.Caption = ResolveResString(resLBLDIRS)
  277.     lblPath.Caption = ResolveResString(resLBLPATH)
  278.     If frmSetup1.Tag = gstrDIR_SRC Then
  279.         Caption = ResolveResString(resINSTFROM)
  280.         lblPrompt.Caption = ResolveResString(resSRCPROMPT, "|1", gstrAppName)
  281.         cmdCancel.Caption = ResolveResString(resBTNEXIT, "|1", gstrAppName)
  282.         mfCancelExit = True
  283.         dirDirs.Path = gstrSrcPath
  284.         If Err > 0 Then
  285.             dirDirs.Path = Left$(App.Path, 3)
  286.         End If
  287.         mfMustExist = True
  288.     Else
  289.         Caption = ResolveResString(resCHANGEDIR)
  290.         lblPrompt.Caption = ResolveResString(resDESTPROMPT)
  291.         cmdCancel.Caption = ResolveResString(resBTNCANCEL)
  292.         mfCancelExit = False
  293.         dirDirs.Path = gstrDestDir
  294.         If Err > 0 Then
  295.             '
  296.             If Len(gstrDestDir) >= 2 Then
  297.                 If Mid$(gstrDestDir, 2, 1) = gstrCOLON Then
  298.                     Err = 0
  299.                     dirDirs.Path = Left$(gstrDestDir, 2) & gstrSEP_DIR
  300.                 End If
  301.             End If
  302.         End If
  303.         If Err > 0 Then
  304.             dirDirs.Path = Left$(App.Path, 3)
  305.         End If
  306.         
  307.         '
  308.  txtPath.Text 
  309.  gstrDestDir
  310.         txtPath.Text = gstrDestDir
  311.         mfMustExist = False
  312.     End If
  313.     If frmSetup1.Tag = gstrDIR_SRC Then
  314.         txtPath.Text = dirDirs.Path
  315.     End If
  316.     drvDrives.Drive = Left$(dirDirs.Path, 2)
  317.     drvDrives_Change
  318.     SetMousePtr gintMOUSE_DEFAULT
  319.     CenterForm Me
  320.     '
  321.  txtPath 
  322.     txtPath.SelStart = 0
  323.     txtPath.SelLength = Len(txtPath.Text)
  324.     Err = 0
  325. End Sub
  326. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  327.     If UnloadMode <> 1 Then
  328.         If mfCancelExit = True Then
  329.             ExitSetup Me, gintRET_EXIT
  330.             Cancel = 1
  331.         Else
  332.             gfRetVal = gintRET_CANCEL
  333.             Unload Me
  334.         End If
  335.     End If
  336. End Sub
  337.