VERSION 5.00
Begin VB.Form frmMin 
   Caption         =   "Minims"
   ClientHeight    =   3075
   ClientLeft      =   15675
   ClientTop       =   4365
   ClientWidth     =   2775
   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     =   3075
   ScaleWidth      =   2775
   ShowInTaskbar   =   0   'False
   Begin VB.Frame FraBilletes 
      Caption         =   "Notes"
      Height          =   975
      Left            =   180
      TabIndex        =   4
      Top             =   1320
      Width           =   2475
      Begin VB.TextBox txt 
         Alignment       =   1  'Right Justify
         Height          =   390
         Index           =   0
         Left            =   1680
         TabIndex        =   5
         Text            =   "15"
         Top             =   390
         Width           =   645
      End
      Begin VB.Label lblDenom 
         Alignment       =   1  'Right Justify
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Denom"
         Height          =   270
         Index           =   0
         Left            =   90
         TabIndex        =   6
         Top             =   450
         Width           =   1365
      End
   End
   Begin VB.Frame FraMonedas 
      Caption         =   "Coins"
      Height          =   975
      Left            =   180
      TabIndex        =   1
      Top             =   180
      Width           =   2475
      Begin VB.TextBox txtMonedas 
         Alignment       =   1  'Right Justify
         Height          =   390
         Left            =   1620
         TabIndex        =   2
         Text            =   "0"
         Top             =   390
         Width           =   645
      End
      Begin VB.Label lblTodas 
         Alignment       =   1  'Right Justify
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "All"
         Height          =   270
         Index           =   1
         Left            =   1110
         TabIndex        =   3
         Top             =   450
         Width           =   255
      End
   End
   Begin VB.CommandButton cmdAceptar 
      Caption         =   "OK"
      Height          =   360
      Left            =   570
      TabIndex        =   0
      Top             =   2490
      Width           =   1530
   End
End
Attribute VB_Name = "frmMin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Public Sub ShowMin()
    Dim i As Integer
    Dim cnt As Integer
    
    If Len(Monedes) > 0 Then
        txtMonedas.text = CStr(CCC(LBound(CCC)).low)
    Else
        txtMonedas.text = 0
    End If
    cnt = 0
    For i = LBCCN To UBCCN
        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(CCN(i).Valor) / 100, "standard")
        txt(cnt).text = CCN(i).low
        cnt = cnt + 1
    Next i
    FraBilletes.Height = 975 + (510 * (cnt - 1))
    cmdAceptar.top = FraBilletes.top + FraBilletes.Height + 195
    cmdAceptar.TabIndex = 50
    Me.Height = FraBilletes.top + FraBilletes.Height + 1290
    CentraForm Me
End Sub

Private Sub cmdAceptar_Click()
    Dim i As Integer
    Dim cnt As Integer
    Dim denoms As String
    Dim values As String
    Dim ok As Boolean
    
    cnt = 0
    
    CK.CoinsLowLevel = CByte(txtMonedas.text)
    For i = LBCCN To UBCCN
        If Len(denoms) > 0 Then
            denoms = denoms & ","
            values = values & ","
        End If
        denoms = denoms & CCN(i).Valor
        values = values & txt(cnt).text
        CCN(i).low = CInt(txt(cnt).text)
        cnt = cnt + 1
    Next i
    ok = CK.SetLowLevelNotes(denoms, values)
    If Not ok Then
        MsgBox "error SetLowLevelNotes/SetCoinsLowLevel"
        LoadLowLevels
        Exit Sub
    End If
    For i = LBCCC To UBCCC
        CCC(i).low = CByte(txtMonedas.text)
    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

Private Sub txtMonedas_GotFocus()
    txtMonedas.SelStart = 0
    txtMonedas.SelLength = Len(txtMonedas.text)
End Sub

Private Sub txtMonedas_LostFocus()
    If Not IsNumeric(txtMonedas.text) Then
        txtMonedas.text = 0
    Else
        txtMonedas.text = val(txtMonedas.text) \ 1
    End If
End Sub

Private Sub txtMonedas_Validate(Cancel As Boolean)
    If Not IsNumeric(Replace(txtMonedas.text, ".", ",")) Then
        Cancel = True
    End If
End Sub


