*!* Descripción de los objetos
*!*
*!* ADD OBJECT 'Cnt_gen4' AS container WITH ;
*!* BackStyle = 1, ;
*!* Height = 215, ;
*!* Left = 288, ;
*!* Name = "Cnt_gen4", ;
*!* TabIndex = 27, ;
*!* Top = 164, ;
*!* Width = 326
*!* ADD OBJECT 'Cnt_gen4.Txt_texto1' AS textbox WITH ;
*!* Height = 21, ;
*!* Left = 13, ;
*!* Name = "Txt_texto1", ;
*!* TabIndex = 1, ;
*!* Top = 43, ;
*!* Width = 202
*!* ADD OBJECT 'Cnt_gen4.Txt_num1' AS textbox WITH ;
*!* Height = 21, ;
*!* Left = 214, ;
*!* Name = "Txt_num1", ;
*!* TabIndex = 2, ;
*!* Top = 43, ;
*!* Value = 0, ;
*!* Width = 103
*!* ADD OBJECT 'Cnt_gen4.Lst_list1' AS listbox WITH ;
*!* ColumnCount = 2, ;
*!* ColumnWidths = "200", ;
*!* Height = 122, ;
*!* Left = 11, ;
*!* Name = "Lst_list1", ;
*!* TabIndex = 3, ;
*!* Top = 63, ;
*!* Width = 308
*!* ADD OBJECT 'Cnt_gen4.Txt_num2' AS Textbox WITH ;
*!* Enabled = .F., ;
*!* Left = 231, ;
*!* Name = "Txt_num2", ;
*!* TabIndex = 4, ;
*!* Top = 185, ;
*!* Value = 0
*!* Codigo de los objetos
PROCEDURE Cnt_gen4.Init
CREATE CURSOR curList ("texto" c(40), "valor" n(12,2))
this.lst_list1.RowSourceType= 2
this.lst_list1.RowSource="Curlist.texto,valor"
ADDPROPERTY(this,"Accion",0)
*!* Propiedad accion
*!* 0 - Nada
*!* 1 - Inserta REgistro
*!* 2 - Modifica Registro actual
ENDPROC
PROCEDURE Cnt_gen4.Lst_list1.DblClick
WITH this.Parent
.txt_num1.Value = curList.Valor
.txt_texto1.Value = TRIM(curList.texto)
.Accion = 2
ENDWITH
ENDPROC
PROCEDURE Cnt_gen4.Txt_num1.LostFocus
IF this.Parent.Accion>0
this.Parent.ACcion = 0
SELECT SUM(valor) FROM curList WHERE !DELETED() INTO ARRAY laSum
IF _tally > 0
this.Parent.txt_num2.Value = laSum[1,1]
ENDIF
this.Parent.txt_texto1.SetFocus()
ENDIF
ENDPROC
PROCEDURE Cnt_gen4.Txt_num1.Valid
IF !EMPTY(this.Value)
IF EMPTY(this.Parent.txt_texto1.Value )
RETURN this.Parent.txt_texto1
ENDIF
DO CASE
CASE this.Parent.accion = 0
INSERT INTO curlist (texto,valor) ;
VALUES (ALLTRIM(this.Parent.txt_texto1.text),;
this.Value )
CASE this.Parent.accion = 2
SELECT curList
replace texto WITH ALLTRIM(this.Parent.txt_texto1.text),;
valor WITH this.Value
ENDCASE
this.Parent.lst_list1.Requery
this.Parent.txt_texto1.Value = ""
this.Value = 0
this.Parent.accion = 1
ENDIF
ENDPROC
PROCEDURE Cnt_gen4.Destroy
IF USED("curList")
USE IN CurList
ENDIF
ENDPROC