VERSION 5.00
Begin VB.Form frmFCL 
   Caption         =   "Force coin levels"
   ClientHeight    =   1485
   ClientLeft      =   11010
   ClientTop       =   4170
   ClientWidth     =   2685
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   12
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   ScaleHeight     =   1485
   ScaleWidth      =   2685
   ShowInTaskbar   =   0   'False
   Begin VB.TextBox txt 
      Alignment       =   1  'Right Justify
      Height          =   390
      Index           =   0
      Left            =   1815
      TabIndex        =   1
      Text            =   "15"
      Top             =   150
      Width           =   645
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "OK"
      Height          =   360
      Left            =   570
      TabIndex        =   0
      Top             =   810
      Width           =   1530
   End
   Begin VB.Label lblDenom 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Denom"
      Height          =   270
      Index           =   0
      Left            =   225
      TabIndex        =   2
      Top             =   210
      Width           =   1365
   End
End
Attribute VB_Name = "frmFCL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public Sub ShowFCL()
    Dim i As Integer
    Dim cnt As Integer
    
    cnt = 0
    For i = LBCCC To UBCCC
        If cnt > 0 Then
            Load lblDenom(cnt)
            lblDenom(cnt).top = lblDenom(0).top + (510 * cnt)
            lblDenom(cnt).Visible = True
            Load txt(cnt)
            txt(cnt).top = txt(0).top + (510 * cnt)
            txt(cnt).Visible = True
        End If
        lblDenom(cnt).Caption = Format$(CCur(CCC(i).Valor) / 100, "standard")
        txt(cnt).text = CCC(i).current
        cnt = cnt + 1
    Next i
    cmdAceptar.top = lblDenom(0).top + (510 * cnt)
    cmdAceptar.TabIndex = 50
    Me.Height = 1050 + cmdAceptar.top
    CentraForm Me
End Sub

Private Sub cmdAceptar_Click()
    Dim i As Integer
    Dim cnt As Integer
    Dim qty As Integer
    
    cnt = 0
    For i = LBCCC To UBCCC
        qty = CInt(txt(cnt).text)
        If qty < 0 Then
            'MsgBox "Las cantidades no pueden ser negativas."
            MsgBox "Quantities can not be negatives."
            Exit Sub
        End If
        If CCC(i).current <> qty Then
            If Not CK.ForceCoinLevel(CCC(i).Valor, qty, False) Then
                MsgBox "error SetMaxLevel " & CCC(i).Valor & "=" & qty
            End If
        End If
        cnt = cnt + 1
    Next i
    Unload Me
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyReturn And ((Shift And 6) = 0) Then
        MySendKeys "{TAB}"
    ElseIf KeyCode = vbKeyEscape And (Shift = 0) Then
        Unload Me
    End If
End Sub

Private Sub txt_GotFocus(Index As Integer)
    txt(Index).SelStart = 0
    txt(Index).SelLength = Len(txt(Index).text)
End Sub

Private Sub txt_LostFocus(Index As Integer)
    If Not IsNumeric(txt(Index).text) Then
        txt(Index).text = 0
    Else
        txt(Index).text = val(txt(Index).text) \ 1
    End If
End Sub

Private Sub txt_Validate(Index As Integer, Cancel As Boolean)
    If Not IsNumeric(Replace(txt(Index).text, ".", ",")) Then
        Cancel = True
    End If
End Sub

