VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Trans_main 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Main Translator"
   ClientHeight    =   4905
   ClientLeft      =   870
   ClientTop       =   1395
   ClientWidth     =   8520
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   4905
   ScaleWidth      =   8520
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin MSFlexGridLib.MSFlexGrid Grid1 
      Height          =   1395
      Left            =   2880
      TabIndex        =   16
      Top             =   2040
      Visible         =   0   'False
      Width           =   3735
      _ExtentX        =   6588
      _ExtentY        =   2461
      _Version        =   393216
      Cols            =   6
      FixedRows       =   0
      FixedCols       =   0
      AllowBigSelection=   0   'False
      ScrollBars      =   0
   End
   Begin VB.Frame ToolBar 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   600
      Left            =   0
      TabIndex        =   2
      Top             =   0
      Width           =   3120
      Begin VB.PictureBox pic_Excel 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "TRAN_MAI.frx":0000
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   1320
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   12
         TabStop         =   0   'False
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_help 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "TRAN_MAI.frx":030A
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   2520
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   6
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_quit 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "TRAN_MAI.frx":0614
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   1920
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   5
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_OutlRefresh 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Height          =   480
         Left            =   120
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   4
         Top             =   60
         Width           =   480
      End
      Begin VB.PictureBox pic_upd 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "TRAN_MAI.frx":091E
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   480
         Left            =   720
         ScaleHeight     =   480
         ScaleWidth      =   480
         TabIndex        =   3
         Top             =   60
         Width           =   480
      End
   End
   Begin VB.PictureBox pic_Language 
      AutoSize        =   -1  'True
      BorderStyle     =   0  'None
      DragIcon        =   "TRAN_MAI.frx":0C28
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   480
      Left            =   3480
      ScaleHeight     =   480
      ScaleWidth      =   480
      TabIndex        =   1
      Top             =   180
      Width           =   480
   End
   Begin MSFlexGridLib.MSFlexGrid Grid 
      Height          =   3675
      Left            =   60
      TabIndex        =   15
      Top             =   840
      Width           =   8475
      _ExtentX        =   14949
      _ExtentY        =   6482
      _Version        =   393216
      Rows            =   1
      FixedRows       =   0
      FixedCols       =   0
      SelectionMode   =   1
      AllowUserResizing=   1
   End
   Begin VB.Label lbl_Type 
      Caption         =   "Type"
      Height          =   195
      Left            =   4320
      TabIndex        =   14
      Top             =   180
      Visible         =   0   'False
      Width           =   1395
   End
   Begin MSForms.ComboBox cbo_Type 
      Height          =   315
      Left            =   5820
      TabIndex        =   13
      Top             =   120
      Visible         =   0   'False
      Width           =   2655
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4683;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin MSForms.ComboBox cbo_OldScreen 
      Height          =   315
      Left            =   5820
      TabIndex        =   11
      Top             =   300
      Width           =   2655
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4683;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin VB.Label lbl_Screen 
      Caption         =   "Screen"
      Height          =   195
      Left            =   4320
      TabIndex        =   10
      Top             =   540
      Width           =   1395
   End
   Begin MSForms.ComboBox cbo_Screen 
      Height          =   315
      Left            =   5820
      TabIndex        =   9
      Top             =   480
      Width           =   2655
      VariousPropertyBits=   679495707
      DisplayStyle    =   7
      Size            =   "4683;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin VB.Label lbl_SystemName 
      Caption         =   "System Name"
      Height          =   195
      Left            =   4320
      TabIndex        =   8
      Top             =   180
      Width           =   1395
   End
   Begin MSForms.ComboBox cbo_SystemName 
      Height          =   315
      Left            =   5820
      TabIndex        =   7
      Top             =   120
      Width           =   2655
      VariousPropertyBits=   679479323
      DisplayStyle    =   7
      Size            =   "4683;556"
      MatchEntry      =   1
      ShowDropButtonWhen=   2
      FontHeight      =   165
      FontCharSet     =   0
      FontPitchAndFamily=   2
   End
   Begin VB.Label lbl_dbclick 
      AutoSize        =   -1  'True
      Caption         =   "Double click on the record you want to edit"
      ForeColor       =   &H00000040&
      Height          =   195
      Left            =   2445
      TabIndex        =   0
      Top             =   4560
      Width           =   3045
   End
End
Attribute VB_Name = "Trans_main"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim mi_Status As Integer
Dim ml_Hstmt As Long
Dim ms_Req As String

' For Excel repporting configuration
Public ms_ReqExportExcel As String
Public mb_ExportExcelEnabled As Boolean

Private Function GetCode(pString As String) As Integer

    Select Case pString
    Case "Screen descriptions"
        GetCode = 1
    Case "Menu options"
        GetCode = 2
    End Select
    
End Function

Private Sub Form_Load()

    MouseOff
    
    If gl_CodePage <> 1252 And gl_CodePage <> 0 Then ChangeCharset Me
    
    'Load all the picture for action button
    pic_OutlRefresh.Picture = LoadResPicture(RES_REFRESH, 1)
    pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
    pic_quit.Picture = LoadResPicture(RES_QUIT, 1)
    pic_help.Picture = LoadResPicture(RES_HELP, 1)
    pic_Excel.Picture = LoadResPicture(RES_EXCEL, 1)
    If mb_ExportExcelEnabled Then
        pic_Excel.Enabled = OK
        pic_Excel.Visible = OK
    Else
        pic_Excel.Enabled = KO
        pic_Excel.Visible = KO
    End If
    'Load the picture of the selected language
    pic_Language.Picture = LoadResPicture(gut_LangWork.Icon, 1)
    
    'Define the size of each column
    Grid.ColWidth(0) = 4200
    Grid.ColWidth(1) = 4200
    Grid.ColAlignment(0) = flexAlignLeftCenter
    Grid.ColAlignment(1) = flexAlignLeftCenter
    
    GetCaptions
    
    'Define the title of the form
    Caption = Caption + " " + gut_LangWork.Desc
    
    If gut_Param2.Str1 = "" Or gut_Param2.Str1 = "Glossary" Then
        'We are in the translator or in the glossary translator
                
        cbo_OldScreen.Visible = False
        cbo_SystemName.Visible = True
        cbo_Screen.Visible = True
        cbo_Screen.Enabled = False
        lbl_Screen.Enabled = False
        
        FillCboSystemName
    Else
        'We are in internet translator
        
        If gut_Param2.Str1 = "NewInternet" Then
            FillCboType
            lbl_Type.Visible = OK
            cbo_Type.Visible = OK
            cbo_OldScreen.Visible = KO
            lbl_SystemName.Top = 520
            cbo_SystemName.Top = 480
            lbl_Screen.Top = 880
            cbo_Screen.Top = 840
            Grid.Top = 1200
            Grid.Height = 3225
            lbl_SystemName.Enabled = False
            cbo_SystemName.Enabled = False
            lbl_Screen.Enabled = False
            cbo_Screen.Enabled = False
        Else
            cbo_OldScreen.Visible = True
            cbo_Screen.Visible = False
            cbo_SystemName.Visible = False
            lbl_SystemName.Visible = False
            lbl_Screen.Top = cbo_OldScreen.Top + 60
            FillCboScreen
        End If
    End If
    
    MouseOn

End Sub

Private Sub GetCaptions()
Dim ls_Field As String
Dim ls_Text As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim ls_req As String

    On Error GoTo suite
    
    Select Case gut_Param2.Str1
    Case "Internet"
        ls_req = "EXEC Screen_Csts 'Trans_Int', '" & gut_LangLogin.Code & "'"
    Case "NewInternet"
        ls_req = "EXEC Screen_Csts 'Trans_Int_New', '" & gut_LangLogin.Code & "'"
    Case "Glossary"
        ls_req = "EXEC Screen_Csts 'Trans_Glo', '" & gut_LangLogin.Code & "'"
    Case Else
        ls_req = "EXEC Screen_Csts 'Trans', '" & gut_LangLogin.Code & "'"
    End Select
    
    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"
                Trans_main.Caption = ls_Text
            Case "lbl_Type"
                lbl_Type.Caption = ls_Text
            Case "lbl_SystemName"
                lbl_SystemName.Caption = ls_Text
            Case "lbl_Screen"
                lbl_Screen.Caption = ls_Text
            Case "lbl_DblClick"
                lbl_dbclick.Caption = ls_Text
            End Select
        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
    Exit Sub

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

Private Sub FillCboType()

    cbo_Type.AddItem "Screen descriptions"
    cbo_Type.AddItem "Menu options"

End Sub

Private Sub Cbo_type_Click()

    If cbo_Type.ListIndex >= 0 Then
        cbo_Type.MousePointer = fmMousePointerHourGlass
        MouseOff
        lbl_SystemName.Enabled = True
        cbo_SystemName.Enabled = True
        FillCboSystemName
        pic_Excel.Visible = OK
        pic_Excel.Enabled = OK
        Select Case cbo_Type.Text
        Case "Menu options"
            ms_ReqExportExcel = "EXEC Web_MenuItem_Desc_t_lst '" & gut_LangWork.Code & "'"
        Case "Screen descriptions"
            ms_ReqExportExcel = "EXEC Web_LabelItem_Desc_t_lst '" & gut_LangWork.Code & "'"
        End Select
        cbo_Type.MousePointer = fmMousePointerArrow
        MouseOn
    End If

End Sub

Private Sub FillCboSystemName()
Dim ls_req As String

    MouseOff
    
    'Clear the combobox
    cbo_SystemName.Clear
    cbo_Screen.Clear
    
    'Clear all grid
    GridClear Grid
    GridClear Grid1
    
    'Refresh the screen
    DoEvents
    
    Select Case gut_Param2.Str1
    Case "Glossary"
        ls_req = "EXEC Glossary_Topic_Cbo 'E'"
    Case "NewInternet"
        ls_req = "EXEC Web_First_Level_lst " & GetCode(cbo_Type.Text)
    Case Else
        ls_req = "EXEC System_Name_lst"
    End Select
    
    MCombo_Fill cbo_SystemName, ls_req
        
    MouseOn
    
End Sub

Private Sub cbo_SystemName_Click()

    If cbo_SystemName.ListIndex >= 0 Then
        cbo_SystemName.MousePointer = fmMousePointerHourGlass
        MouseOff
        cbo_Screen.Enabled = True
        lbl_Screen.Enabled = True
        FillCboScreen
        cbo_SystemName.MousePointer = fmMousePointerArrow
        MouseOn
    End If
    
End Sub

Private Sub FillCboScreen()
Dim ls_req As String

    'Clear all cbo
    If gut_Param2.Str1 = "" Or gut_Param2.Str1 = "Glossary" Or gut_Param2.Str1 = "NewInternet" Then
        'We are in the translator or in the glossary translator
        cbo_Screen.Clear
    Else
        'We are in internet translator
        cbo_OldScreen.Clear
    End If
    
    'Clear all grid
    GridClear Grid
    GridClear Grid1
    
    'Refresh the screen
    DoEvents
    
    'Create the request
    Select Case gut_Param2.Str1
    Case "Internet"
        ls_req = "EXEC TranslatorInternet_lst"
    Case "NewInternet"
        ls_req = "EXEC Web_Second_Level_lst '" & MCombo_GetCode(cbo_SystemName) & "'"
    Case "Glossary"
        ls_req = "EXEC TranslatorGlossary_lst '" & MCombo_GetCode(cbo_SystemName) & "'"
    Case Else
        ls_req = "EXEC Translator_Header_lst " & MCombo_GetCode(cbo_SystemName)
    End Select
    
    If gut_Param2.Str1 = "" Or gut_Param2.Str1 = "Glossary" Or gut_Param2.Str1 = "NewInternet" Then
        MCombo_Fill cbo_Screen, ls_req
    Else
        MCombo_Fill cbo_OldScreen, ls_req
    End If
    
End Sub

Private Sub cbo_Screen_Click()

    If cbo_Screen.ListIndex >= 0 Then
        cbo_Screen.MousePointer = fmMousePointerHourGlass
        MouseOff
        Grid.Rows = 1
        Grid1.Rows = 1
        FillGrid
        cbo_Screen.MousePointer = fmMousePointerArrow
        MouseOn
    End If

End Sub

Private Sub FillGrid()
Dim ls_FieldName As String
Dim ls_LanguageCode As String
Dim ls_Value As String
Dim ls_NbMaxChar As String
Dim ls_ScreenName As String
Dim li_Count As Integer
Dim ls_OriginLanguage As String
Dim ls_Column5 As String

    On Error GoTo FillGrid_Err

    ' hide selection
    Grid.Highlight = flexHighlightNever     '= KO
    Grid.FocusRect = flexFocusNone
    
    DoEvents
    
    'Clear all grids
    GridClear Grid
    GridClear Grid1
    
    'We have read no lines
    li_Count = 0

    'Construct the request
    Select Case gut_Param2.Str1
    Case "Internet"
        ms_Req = "EXEC TranslatorInternet_sel '" & gut_LangWork.Code & "', '" _
            & QuoteParam(MCombo_GetCode(cbo_OldScreen)) & "'"
        ls_OriginLanguage = "E"
    Case "NewInternet"
        ms_Req = "EXEC Web_Data_Level_sel " & GetCode(cbo_Type.Text) & ", '" _
                & MCombo_GetCode(cbo_Screen) & "', '" _
                & gut_LangWork.Code & "'"
        ls_OriginLanguage = "E"
    Case "Glossary"
        ms_Req = "EXEC TranslatorGlossary_sel '" & gut_LangWork.Code & "', '" _
            & QuoteParam(MCombo_GetCode(cbo_Screen)) & "', '" & QuoteParam(MCombo_GetCode(cbo_SystemName)) & "'"
        ls_OriginLanguage = "E"
    Case Else
        ms_Req = "EXEC Translator_sel '" & gut_LangWork.Code & "', '" _
            & MCombo_GetCode(cbo_Screen) & "'"
        ls_OriginLanguage = "E"
    End Select
    
    ' Execute the request
    If SQLSubmit(gl_Environment, gl_Database, ml_Hstmt, ms_Req) Then
        mi_Status = SQL_SUCCESS
        Do While mi_Status = SQL_SUCCESS Or mi_Status = SQL_SUCCESS_WITH_INFO
            mi_Status = SQLFetch(ml_Hstmt)
            If mi_Status = SQL_SUCCESS Or mi_Status = SQL_SUCCESS_WITH_INFO Then
                   
                'Two lines or one line of the request correspond to one line of the grid
                'For one line of the grid, the request send (one line with english code
                'and one line with desired language code) or (one line with english code)
                   
                ls_FieldName = ODBCData(ml_Hstmt, 1)
                ls_LanguageCode = ODBCData(ml_Hstmt, 2)
                ls_NbMaxChar = ODBCData(ml_Hstmt, 3)
                If gut_Param2.Str1 = "NewInternet" Then
                    ls_Value = ODBCMemoGet(ml_Hstmt, 4, OK)
                Else
                    ls_Value = ODBCMemoGet(ml_Hstmt, 4)
                End If
                ls_Column5 = ODBCData(ml_Hstmt, 5)
                If gut_Param2.Str1 = "" Then
                    'If we are in the translation only, we read the next parameter
                    ls_ScreenName = ls_Column5
                End If

                If ls_LanguageCode = ls_OriginLanguage Then
                    'if it's english code, we add a line to the grid
                    li_Count = li_Count + 1
                    Grid.Rows = li_Count
                    Grid1.Rows = li_Count
                    
                    'We select the last line
                    Grid.Row = li_Count - 1
                    Grid1.Row = li_Count - 1
                End If

                If ls_LanguageCode = ls_OriginLanguage Then
                    'Mise en forme si Menu du nouvel internet translator
                    If gut_Param2.Str1 = "NewInternet" Then
                        If cbo_Type.Text = "Menu options" Then
                            If ODBCData(ml_Hstmt, 7) <> "" Then
                                ls_Value = "     " & ls_Value
                            End If
                        End If
                    End If

                    'Field name
                    Grid1.Col = 0
                    Grid1.Text = ls_FieldName
                
                    'English Value
                    Grid1.Col = 1
                    Grid1.Text = ls_Value
                    Grid.Col = 0
                    Grid.Text = ls_Value
                    
                    'If the work language is English, we fill the translation column
                    If gut_LangWork.Code = "E" Then
                        Grid1.Col = 2
                        Grid1.Text = ls_Value
                        Grid.Col = 1
                        Grid.Text = ls_Value
                    End If
                    
                    'Authorized length
                    Grid1.Col = 3
                    Grid1.Text = ls_NbMaxChar
                    
                    'We fill the screen name if we have it (only for Translation)
                    'Screen Name
                    Grid1.Col = 4
                    Grid1.Text = ls_ScreenName
                Else
                    If gut_Param2.Str1 = "NewInternet" Then
                        If cbo_Type.Text = "Menu options" Then
                            If ODBCData(ml_Hstmt, 7) <> "" Then
                                ls_Value = "     " & ls_Value
                            End If
                        End If
                    End If
                    
                    'We fill the translation Value
                    Grid1.Col = 2
                    Grid1.Text = ls_Value
                    Grid.Col = 1
                    Grid.Text = ls_Value
                End If
                
                If gut_Param2.Str1 = "NewInternet" Then
                    Grid1.Col = 5
                    Grid1.Text = ls_Column5
                End If
                
            End If
        Loop
        
        SQLFreeStatement ml_Hstmt, SQL_DROP
        
    End If
    
    Exit Sub
    
FillGrid_Err:
    SQLFreeStatement ml_Hstmt, SQL_DROP
    
End Sub

Private Sub pic_quit_Click()

    Unload Me

End Sub

Private Sub Grid_Click()

    'We select only the current line
    Grid.Highlight = flexHighlightAlways
    Grid.FocusRect = flexFocusNone
    
    'We select the same line in grid1
    Grid1.Row = Grid.Row
    
End Sub

Private Sub Grid_DblClick()

    pic_upd_Click

End Sub

Private Sub Grid_KeyUp(KeyCode As Integer, Shift As Integer)

    'We unselect all lines
    Grid.Highlight = flexHighlightNever     '= KO
    Grid.FocusRect = flexFocusHeavy
    Grid.Row = 0
    Grid.Col = 0

End Sub

Private Sub pic_OutlRefresh_Click()
Dim lv_Code As Variant
Dim lv_Code1 As Variant
Dim lv_Text As Variant

    MouseOff
    Select Case gut_Param2.Str1
    Case "Glossary"
        'We are in the glossary
        lv_Code = MCombo_GetCode(cbo_SystemName)
        lv_Code1 = MCombo_GetCode(cbo_Screen)
        FillCboSystemName
        MCombo_CodeSelect(cbo_SystemName) = lv_Code
        MCombo_CodeSelect(cbo_Screen) = lv_Code1
        
    Case "Internet"
        'We are in the glossary or internet translator
        lv_Code = MCombo_GetCode(cbo_OldScreen)
        FillCboScreen
        MCombo_CodeSelect(cbo_OldScreen) = lv_Code
        
    Case "NewInternet"
        'We are in the glossary or new internet translator
        lv_Code = MCombo_GetCode(cbo_SystemName)
        lv_Code1 = MCombo_GetCode(cbo_Screen)
        FillCboSystemName
        MCombo_CodeSelect(cbo_SystemName) = lv_Code
        MCombo_CodeSelect(cbo_Screen) = lv_Code1
        
    Case Else
        'We are in the translator
        lv_Code = MCombo_GetCode(cbo_SystemName)
        lv_Code1 = MCombo_GetCode(cbo_Screen)
        FillCboSystemName
        MCombo_CodeSelect(cbo_SystemName) = lv_Code
        MCombo_CodeSelect(cbo_Screen) = lv_Code1
    End Select
    
    MouseOn

End Sub

Private Sub pic_upd_Click()
Dim li_SvgRow As Integer
Dim ls_Space As String

    If Grid.Highlight <> flexHighlightAlways Or Grid.TextMatrix(Grid.Row, 0) = "" Then Exit Sub
    
    MouseOff
    
    Select Case gut_Param2.Str1
    Case "Internet"
        'screen_name
        gut_Param.Str1 = MCombo_GetCode(cbo_OldScreen)
        
        'title (only for glossary)
        gut_Param.Str2 = ""
        
        'System Code (only for Translator)
        gut_Param.Str7 = ""
    Case "NewInternet"
        'screen_name
        gut_Param.Str1 = MCombo_GetCode(cbo_SystemName)
        
        'title (only for glossary or internet)
        gut_Param.Str2 = "cbo_Screen"
        
        'System Code (only for Translator)
        gut_Param.Str7 = ""
    
        'Type (only for Internet)
        Grid1.Col = 5
        gut_Param.Str8 = Grid1.Text
        
        gs_TableName = "NewInternet"
    
    Case "Glossary"
        'screen_name
        gut_Param.Str1 = MCombo_GetCode(cbo_SystemName)
        
        'title (only for glossary or internet)
        gut_Param.Str2 = MCombo_GetCode(cbo_Screen)
        
        'System Code (only for Translator)
        gut_Param.Str7 = ""
    Case Else
        'screen_name
        Grid1.Col = 4
        gut_Param.Str1 = Grid1.Text
        
        'title (only for glossary)
        gut_Param.Str2 = ""
        
        'System Code (only for Translator)
        gut_Param.Str7 = MCombo_GetCode(cbo_Screen)
    End Select
    
    'field_name
    Grid1.Col = 0
    gut_Param.Str3 = Grid1.Text
    
    'english text
    Grid1.Col = 1
    gut_Param.Str4 = Grid1.Text
    If Len(LTrim(Grid1.Text)) = Len(Grid1.Text) Then
        ls_Space = ""
    Else
        ls_Space = "     "
    End If
    
    'translation
    Grid1.Col = 2
    gut_Param.Str5 = LTrim(Grid1.Text)
    
    'nb_maxchar
    Grid1.Col = 3
    gut_Param.Str6 = Grid1.Text
    
    MouseOff
    
    'We call the maintenance screen
    gb_Return = KO
    Trans_mtnc.show 1

    If gb_Return = OK Then
        Grid1.Col = 2
        Grid1.Text = ls_Space & Trans_mtnc.ms_NewTextTrans
        Grid.Col = 1
        Grid.Text = ls_Space & Trans_mtnc.ms_NewTextTrans
        If gut_LangWork.Code = "E" Then
            Grid1.Col = 1
            Grid1.Text = ls_Space & Trans_mtnc.ms_NewTextTrans
            Grid.Col = 0
            Grid.Text = ls_Space & Trans_mtnc.ms_NewTextTrans
        End If
    End If

End Sub

Private Sub pic_Excel_Click()
Dim lo_appExcel As New CExcel
Dim lo_Fetch As Fetch
Dim li_NBcol As Integer
Dim li_Count As Integer
Dim ls_req As String
Dim li_Status As Integer
Dim lb_Exit As Boolean
Dim li_RowNum As Integer
Dim li_RelativeRowNum As Integer
Dim li_ColNum As Integer
On Error GoTo Err_ExportExcel
MouseOff

lo_appExcel.NewDocument ""
With lo_appExcel.o_ExcelSheet1
    Set lo_Fetch = New Fetch
    lo_Fetch.EnvironmentIdentifier = gl_Environment
    lo_Fetch.DatabaseIdentifier = gl_Database
    
    
    li_Status = lo_Fetch.ExecuteQry(ms_ReqExportExcel, OK)
        
    li_NBcol = lo_Fetch.NbCol
    
    lb_Exit = KO
    li_RowNum = 1
    'if the serverCursor is true, we must make only one round
    'in the other case, we must read all the data
    Do While OK
        li_Count = lo_Fetch.FillMore
        If li_Count = 0 Then Exit Do
        For li_RelativeRowNum = 1 To li_Count
            For li_ColNum = 1 To li_NBcol
                .cells(li_RowNum, li_ColNum).value = ConvertCodePageFromAnsi("'" & lo_Fetch.GetData(li_RelativeRowNum, li_ColNum), gl_CodePage)
            Next
            li_RowNum = li_RowNum + 1
        Next
        'lb_Exit = OK
    Loop
         
    
    Set lo_Fetch = Nothing
End With
Set lo_appExcel = Nothing

MouseOn
SendMessage 129, "Press ALT+TAB to switch to the Excel application.", gut_LangLogin.Code
Exit Sub

Err_ExportExcel:
    
    Set lo_Fetch = Nothing
    Set lo_appExcel = Nothing
    
    SendMessage 124, "Error on export process.", gut_LangLogin.Code
    MouseOn
End Sub
    
Private Sub cbo_OldScreen_Click()

    If cbo_OldScreen.ListIndex >= 0 Then
        cbo_OldScreen.MousePointer = fmMousePointerHourGlass
        MouseOff
        Grid.Rows = 1
        Grid1.Rows = 1
        FillGrid
        cbo_OldScreen.MousePointer = fmMousePointerArrow
        MouseOn
    End If
    
End Sub
