VERSION 5.00
Begin VB.Form DirectorySel 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Target directory"
   ClientHeight    =   4260
   ClientLeft      =   2910
   ClientTop       =   1740
   ClientWidth     =   2820
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   4260
   ScaleWidth      =   2820
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton spp_save 
      Default         =   -1  'True
      Height          =   612
      Left            =   1320
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   3540
      Width           =   612
   End
   Begin VB.CommandButton ssp_Quit 
      Height          =   612
      Left            =   2040
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   3540
      Width           =   612
   End
   Begin VB.ListBox lst_Path 
      Height          =   2985
      ItemData        =   "TECHPATH.frx":0000
      Left            =   180
      List            =   "TECHPATH.frx":0002
      TabIndex        =   0
      Top             =   360
      Width           =   2472
   End
   Begin VB.Label lbl_Path 
      Caption         =   "Select the directory for the media"
      Height          =   252
      Left            =   180
      TabIndex        =   1
      Top             =   120
      Width           =   2472
   End
End
Attribute VB_Name = "DirectorySel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub ssp_quit_Click()
    Unload Me
End Sub
Private Sub GetPossiblePath()
Dim i As Integer
'For i = 0 To UBound(gs_MediaPath, 2) - 1
For i = 0 To UBound(gs_MediaPath, 2)
    If (CInt(gs_MediaPath(1, i)) And MEDIA_UPDATE) = MEDIA_UPDATE Then
        lst_Path.AddItem gs_MediaPath(2, i)
    End If
Next i
End Sub

Private Sub Form_Load()
MouseOff

If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharset Me

gut_Param.Str12 = ""
gut_Param.Str13 = ""
gut_Param.Str14 = ""
spp_save.Picture = LoadResPicture(RES_OK, 1)
ssp_Quit.Picture = LoadResPicture(RES_QUIT, 1)
GetPossiblePath
GetScCsts
MouseOn
End Sub
Private Sub GetScCsts()
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_Field As String
Dim ls_Text As String
   
On Error GoTo suite

ls_Req = "EXEC Screen_Csts 'tech_path','" & QuoteParam(gut_LangLogin.Code) & "'"

If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If

Do While li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO
    li_Status = SQLFetch(ll_Statement)
    If li_Status = SQL_SUCCESS Or li_Status = SQL_SUCCESS_WITH_INFO Then
        ls_Field = ODBCData(ll_Statement, 1)
        ls_Text = ODBCData(ll_Statement, 2)
        Select Case ls_Field
            Case "title": Caption = ls_Text
            Case "lbl_path": lbl_Path = ls_Text
        End Select
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

suite:
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
StdError
End Sub

Private Sub lst_Path_Click()
Dim i As Integer

MouseOff
gut_Param.Str12 = lst_Path
For i = 0 To UBound(gs_MediaPath, 2)
    If gut_Param.Str12 = gs_MediaPath(2, i) Then
        gut_Param.Str13 = gs_MediaPath(3, i)
        gut_Param.Str14 = gs_MediaPath(0, i)
    End If
Next i
MouseOn
End Sub

Private Sub spp_save_Click()
MouseOff
If gut_Param.Str12 = "" Or gut_Param.Str13 = "" Or gut_Param.Str14 = "" Then
    SendMessage 89, "You must choose a path first", gut_LangLogin.Code
    MouseOn
    Exit Sub
End If
gb_Return = OK
Unload Me
'MouseOn
End Sub
