VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frm_main_cwpr 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Classification within products range"
   ClientHeight    =   6360
   ClientLeft      =   90
   ClientTop       =   645
   ClientWidth     =   9450
   ClipControls    =   0   'False
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   PaletteMode     =   1  'UseZOrder
   ScaleHeight     =   6360
   ScaleWidth      =   9450
   ShowInTaskbar   =   0   'False
   Begin VB.Frame frm_Language 
      BackColor       =   &H80000009&
      ClipControls    =   0   'False
      ForeColor       =   &H00FFFFFF&
      Height          =   2595
      Left            =   5040
      TabIndex        =   4
      Top             =   480
      Visible         =   0   'False
      Width           =   915
      Begin MSComctlLib.ListView lvw_Language 
         Height          =   2415
         Left            =   60
         TabIndex        =   19
         Top             =   120
         Width           =   765
         _ExtentX        =   1349
         _ExtentY        =   4260
         View            =   3
         LabelWrap       =   -1  'True
         HideSelection   =   -1  'True
         HideColumnHeaders=   -1  'True
         _Version        =   393217
         ForeColor       =   -2147483640
         BackColor       =   -2147483643
         Appearance      =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         NumItems        =   1
         BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
            Object.Width           =   882
         EndProperty
      End
   End
   Begin VB.Frame SSP_General 
      BackColor       =   &H80000009&
      BorderStyle     =   0  'None
      Caption         =   "Frame2"
      Height          =   615
      Left            =   0
      TabIndex        =   7
      Top             =   0
      Width           =   9495
      Begin VB.PictureBox pic_Quit 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":0000
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   8280
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   18
         Top             =   90
         Width           =   384
      End
      Begin VB.PictureBox pic_add 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":030A
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   240
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   17
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_delete 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   1680
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   16
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_help 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":0614
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   8880
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   15
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_log 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":091E
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   3660
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   14
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_upd 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":0C28
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   960
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   13
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_refresh 
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         Height          =   384
         Left            =   4350
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   12
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_search 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":0F32
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   2325
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   11
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_print 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   3000
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   10
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_Language 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":123C
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   5040
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   9
         Top             =   75
         Width           =   384
      End
      Begin VB.PictureBox pic_media 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00FFFFFF&
         BorderStyle     =   0  'None
         DragIcon        =   "MAIN_CWP.frx":1546
         DrawStyle       =   5  'Transparent
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   384
         Left            =   6000
         ScaleHeight     =   390
         ScaleWidth      =   390
         TabIndex        =   8
         Top             =   60
         Width           =   384
      End
   End
   Begin VB.ComboBox cbo_CategoryCode 
      Height          =   288
      Left            =   5160
      Style           =   2  'Dropdown List
      TabIndex        =   2
      Top             =   1080
      Visible         =   0   'False
      Width           =   492
   End
   Begin VB.ComboBox cbo_Category 
      Height          =   300
      Left            =   3720
      Style           =   2  'Dropdown List
      TabIndex        =   0
      Top             =   1080
      Width           =   2175
   End
   Begin VB.Frame Frame1 
      Height          =   4812
      Left            =   120
      TabIndex        =   5
      Top             =   1440
      Visible         =   0   'False
      Width           =   9252
      Begin VB.ComboBox cbo_CodeProd 
         Height          =   300
         ItemData        =   "MAIN_CWP.frx":1850
         Left            =   7080
         List            =   "MAIN_CWP.frx":1852
         TabIndex        =   6
         Text            =   "Combo1"
         Top             =   3120
         Visible         =   0   'False
         Width           =   1692
      End
      Begin MSFlexGridLib.MSFlexGrid Grid 
         Height          =   4455
         Left            =   120
         TabIndex        =   20
         Top             =   240
         Width           =   9015
         _ExtentX        =   15901
         _ExtentY        =   7858
         _Version        =   393216
         Cols            =   9
         FixedCols       =   0
         AllowBigSelection=   0   'False
         FocusRect       =   0
         SelectionMode   =   1
         AllowUserResizing=   1
      End
   End
   Begin MSComctlLib.ImageList img_pictList 
      Left            =   8700
      Top             =   780
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      MaskColor       =   8388736
      _Version        =   393216
   End
   Begin VB.Label lbl_category 
      Height          =   252
      Left            =   1680
      TabIndex        =   3
      Top             =   840
      Visible         =   0   'False
      Width           =   1212
   End
   Begin VB.Label lbl_Categ 
      Caption         =   "Category"
      Height          =   255
      Left            =   3720
      TabIndex        =   1
      Top             =   840
      Width           =   2175
   End
End
Attribute VB_Name = "frm_main_cwpr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'Dim mi_Xav As Integer
'Dim mi_Yav As Integer
Dim mi_Xav2 As Integer
Dim mi_Yav2 As Integer
' Title of the columns
Dim ms_ColI As String
Dim ms_Col0 As String
Dim ms_Col1 As String
Dim ms_Col2 As String
Dim ms_Col3 As String
Dim ms_Col4 As String
Dim ms_Col5 As String
Dim ms_Col6 As String
Dim ms_Col7 As String
'
Dim mi_CboCount As Integer
Private Sub def_permission()
Dim ls_Perm As String
Dim ll_Statement As Long
Dim ll_LngID As Long
Dim li_Status As Integer
Dim ls_Req As String

On Error GoTo suite

ls_Req = "EXEC Check_Security Media_Products_Classif, " & prg.LoginName
pic_add.Visible = 0
pic_delete.Visible = 0
pic_upd.Visible = 0

If gut_LangWork.Code = "E" Then
    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_Perm = ODBCData(ll_Statement, 1)
            If ls_Perm = "Insert" Then pic_add.Visible = -1
            If ls_Perm = "Delete" Then pic_delete.Visible = -1
            If ls_Perm = "Update" Then pic_upd.Visible = -1
        End If
    Loop
    li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
End If
Exit Sub

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


Private Sub get_sc_csts()
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 'main_cwpr','" & 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_categ": lbl_Categ = ls_Text
            Case "colI": ms_ColI = ls_Text
            Case "col0": ms_Col0 = ls_Text
            Case "col1": ms_Col1 = ls_Text
            Case "col2": ms_Col2 = ls_Text
            Case "col3": ms_Col3 = ls_Text
            Case "col4": ms_Col4 = ls_Text
            Case "col5": ms_Col5 = ls_Text
            Case "col6": ms_Col6 = ls_Text
            Case "col7": ms_Col7 = 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

Public Sub clear_grid()

Dim i As Integer

Grid.HighLight = flexHighlightNever
Grid.Rows = 2
Grid.Row = 1
For i = 0 To Grid.Cols - 1
    Grid.Col = i
    Grid.Text = ""
    Grid.ColWidth(i) = 2000
Next i

End Sub
Public Sub fill_cols()

Grid.Row = 0
Grid.Col = 0
Grid.Text = ms_ColI
Grid.Col = 1
Grid.Text = ms_Col0
Grid.Col = 2
Grid.Text = ms_Col1
Grid.Col = 3
Grid.Text = ms_Col2
Grid.Col = 4
Grid.Text = ms_Col3
Grid.Col = 5
Grid.Text = ms_Col4
Grid.Col = 6
Grid.Text = ms_Col5

If cbo_CategoryCode.List(cbo_Category.ListIndex) = "C001" Or cbo_CategoryCode.List(cbo_Category.ListIndex) = "C006" Then
    Grid.Col = 7
    Grid.Text = ms_Col6
    Grid.Col = 8
    Grid.Text = ms_Col7
End If

End Sub
Public Sub FillGrid()

Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer
Dim li_Count As Integer

On Error GoTo suite

ls_Req = "EXEC Media_Product_Classif_t_lst '" & QuoteParam(cbo_CategoryCode.List(cbo_Category.ListIndex)) & "','" & QuoteParam(gs_MediaCode) & "','" & QuoteParam(gut_LangWork.Code) & "'"
If SQLSubmit(gl_Environment, gl_Database, ll_Statement, ls_Req) Then
    li_Status = SQL_SUCCESS
Else
    li_Status = SQL_ERROR
End If
If cbo_CategoryCode.List(cbo_Category.ListIndex) = "C001" Or cbo_CategoryCode.List(cbo_Category.ListIndex) = "C006" Then
    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
            Grid.Row = Grid.Rows - 1
            For li_Count = 0 To 8
                Grid.Col = li_Count
                Grid.Text = ODBCData(ll_Statement, li_Count + 1)
            Next li_Count
            cbo_CodeProd.AddItem ODBCData(ll_Statement, 10), cbo_CodeProd.ListCount
            Grid.Rows = Grid.Rows + 1
        End If
    Loop
Else
    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
            Grid.Row = Grid.Rows - 1
            For li_Count = 0 To 6
                Grid.Col = li_Count
                Grid.Text = ODBCData(ll_Statement, li_Count + 1)
            Next li_Count
            Grid.Rows = Grid.Rows + 1
            cbo_CodeProd.AddItem ODBCData(ll_Statement, 8), cbo_CodeProd.ListCount
        End If
    Loop
End If
Grid.Row = 1
Grid.Col = 0
If Grid.Text <> "" Then
    Grid.RemoveItem Grid.Rows - 1
End If
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

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

MouseOff
If cbo_Category.ListIndex <> -1 Then
    Frame1.Visible = -1
    If cbo_CategoryCode.List(cbo_Category.ListIndex) = "C001" Or cbo_CategoryCode.List(cbo_Category.ListIndex) = "C006" Then
        Grid.Cols = 9
    Else
        Grid.Cols = 7
    End If
    cbo_CodeProd.Clear
    clear_grid
    fill_cols
    FillGrid
    lbl_Category = cbo_Category
End If
MouseOn

End Sub



'Private Sub csp_Language_Click()

'MouseOff

'gut_LangWork.Code = csp_Language.ListTabText(csp_Language.ListIndex, 1)
'pic_Language.Picture = csp_Language.ListPicture(csp_Language.ListIndex)
'Frame1.Visible = KO
'frm_Language.Visible = KO
'def_permission
'init_category
'If mi_CboCount >= 1 Then
'    cbo_Category.ListIndex = 0
'End If
'MouseOn

'End Sub

'Private Sub csp_Language_LostFocus()
'frm_Language.Visible = KO
'End Sub

Private Sub lvw_Language_Click()
MouseOff

If Not lvw_Language.SelectedItem Is Nothing Then
    gut_LangWork.Code = GetTagValue(lvw_Language.SelectedItem, 0)
    pic_Language.Picture = img_pictList.ListImages(lvw_Language.SelectedItem.SmallIcon).Picture
    Frame1.Visible = KO
    frm_Language.Visible = KO
    def_permission
    init_category
    If mi_CboCount >= 1 Then
        cbo_Category.ListIndex = 0
    End If
End If

MouseOn
End Sub

Private Sub lvw_Language_LostFocus()
frm_Language.Visible = KO
End Sub

Private Sub Form_Load()

MouseOff

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

gut_LangWork.Code = gut_LangLogin.Code
pic_add.Picture = LoadResPicture(RES_ADD, 1)
pic_delete.Picture = LoadResPicture(RES_DELETE, 1)
pic_upd.Picture = LoadResPicture(RES_MODIFY, 1)
pic_help.Picture = LoadResPicture(RES_HELP, 1)
pic_log.Picture = LoadResPicture(RES_LOG, 1)
pic_quit.Picture = LoadResPicture(RES_QUIT, 1)
pic_refresh.Picture = LoadResPicture(RES_REFRESH, 1)
pic_search.Picture = LoadResPicture(RES_SEARCH, 1)
pic_print.Picture = LoadResPicture(RES_PRINT, 1)
pic_Language.Picture = LoadResPicture(gut_LangLogin.Icon, 1)
pic_media.Picture = LoadResPicture(RES_MEDIA, 1)
    
    ' NEW remove ListView begin
    Call InitImageList(img_pictList)
    Call InitListView(lvw_Language, img_pictList)
    ' NEW remove ListView end


'FillCspLanguage csp_Language
FillLvwLanguage lvw_Language

'mi_Yav = 0
'mi_Xav = 0
mi_Yav2 = 0
mi_Xav2 = 0
get_sc_csts
init_category
def_permission
If mi_CboCount >= 1 Then
    cbo_Category.ListIndex = 0
End If
MouseOn

End Sub
Private Sub init_category()
Dim ls_Req As String
Dim ll_Statement As Long
Dim li_Status As Integer

On Error GoTo suite

cbo_Category.Clear
mi_CboCount = 0
ls_Req = "EXEC Media_Product_Classif_CG_t_lst '" & QuoteParam(gs_MediaCode) & "','" & gut_LangWork.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
        cbo_Category.AddItem ODBCData(ll_Statement, 1), cbo_Category.ListCount
        cbo_CategoryCode.AddItem ODBCData(ll_Statement, 2), cbo_CategoryCode.ListCount
        mi_CboCount = mi_CboCount + 1
    End If
Loop
li_Status = SQLFreeStatement(ll_Statement, SQL_DROP)
Exit Sub

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

Public Sub Grid_Click()
    Grid.HighLight = IIf(Grid.HighLight = flexHighlightNever, flexHighlightAlways, flexHighlightNever)
    Grid.RowSel = Grid.Row
    If Grid.HighLight = flexHighlightNever Then
        gs_TableCode = ""
        Grid.FocusRect = flexFocusHeavy
    Else
        Grid.FocusRect = flexFocusNone
    End If
    
End Sub

Private Sub Grid_SelChange()
    Grid.HighLight = flexHighlightNever             ' if event Click is raised and will change this to flexHighlightAlways
    Grid.FocusRect = flexFocusHeavy
    gs_TableCode = cbo_CodeProd.List(Grid.Row - 1)
End Sub


Private Sub pic_add_Click()
gs_Action = "add"
frm_mtnc_cwpr.show 1
End Sub

Private Sub pic_delete_Click()

If gs_TableCode = "" Then
    SendMessage 1, "Select record first, please", gut_LangLogin.Code
    MouseOn
    Exit Sub
End If

'Grid.Row = mi_Yav
gs_Action = "del"
frm_mtnc_cwpr.show 1

End Sub

Private Sub pic_Language_Click()
MouseOff
frm_Language.Visible = Not frm_Language.Visible
'csp_Language.SetFocus
lvw_Language.SetFocus
MouseOn
End Sub

Private Sub pic_media_Click()
On Error GoTo suite
MouseOff
If gs_MediaCode <> "" Then
    
    Media_dsp.ms_Caller = "media"
    Media_dsp.show 1
End If
MouseOn
Exit Sub

suite:
SendMessage 106, "No media associated or impossible to display it.", gut_LangLogin.Code
End Sub

Private Sub pic_print_Click()

If Printers.Count = 0 Then
    SendMessage 135, "No printer is installed on your computer. Please, contact your system administrator.", gut_LangLogin.Code
    Exit Sub
End If

MouseOff
If cbo_Category.Text <> "" Then
    If Grid.Cols = 9 Then
        PrintGrid2 8, Array(10, 70, 70, 70, 70, 70, 70, 70, 70), Array(0, 1, 2, 3, 4, 5, 6, 7, 8)
    Else
        PrintGrid2 8, Array(10, 70, 70, 70, 70, 70, 70), Array(0, 1, 2, 3, 4, 5, 6)
    End If
End If
MouseOn

End Sub

Private Sub pic_quit_Click()
Unload Me
End Sub


Private Sub pic_refresh_Click()

MouseOff
If cbo_Category.ListIndex <> -1 Then
    Frame1.Visible = -1
    If cbo_CategoryCode.List(cbo_Category.ListIndex) = "C001" Or cbo_CategoryCode.List(cbo_Category.ListIndex) = "C006" Then
        Grid.Cols = 9
    Else
        Grid.Cols = 7
    End If
    clear_grid
    fill_cols
    FillGrid
End If
MouseOn

End Sub


Private Sub pic_search_Click()
MouseOff
If cbo_Category.Text <> "" Then
    gi_SearchGrid = 3
    C_search.show 1
End If
MouseOn
End Sub


Private Sub pic_upd_Click()

MouseOff
If Grid.HighLight = flexHighlightNever Then
    SendMessage 1, "Select record first, please", gut_LangLogin.Code
    MouseOn
    Exit Sub
End If

If cbo_Category.ListIndex <> -1 Then
'    Grid.Row = mi_Yav
    gs_Action = "upd"
    frm_mtnc_cwpr.show 1
End If

End Sub

' NEW Remove ListView begin

Private Function GetTagValue(ByVal ao_lvw As MSComctlLib.ListItem, ByVal al_Index As Long)
    Dim ls_values() As String
    ls_values = Split(ao_lvw.Tag, SEP)

    GetTagValue = ls_values(al_Index)

End Function

Private Function LoadImage(ByVal ao_imageList As MSComctlLib.ImageList, ByVal al_resIndex As Long, ByVal al_resType As LoadResConstants) As Long
    Dim lo_image As MSComctlLib.ListImage
    Set lo_image = ao_imageList.ListImages.Add(, "_" & al_resIndex, LoadResPicture(al_resIndex, al_resType))
    LoadImage = lo_image.Index
End Function

Private Sub InitListView(ByRef ao_lvw As MSComctlLib.ListView, Optional ByVal ao_imgList As MSComctlLib.ImageList = Nothing)
    ao_lvw.HideSelection = False        ' don't hide selection when lostFocus
    ao_lvw.View = lvwReport
    ao_lvw.LabelEdit = lvwManual       ' disable edit labels
    ao_lvw.Icons = ao_imgList
    ao_lvw.SmallIcons = ao_imgList
End Sub

Private Sub InitImageList(ByRef ao_imgList As MSComctlLib.ImageList)
    ao_imgList.ImageHeight = 32
    ao_imgList.ImageWidth = 32
    ao_imgList.MaskColor = vbMagenta

    ' at least one image must be loaded to correctly initialize imagelist
    Call LoadImage(ao_imgList, RES_OPENFOLDER, vbResBitmap)
End Sub
' NEW Remove ListView end

