Ajuda com cálculo no GetBox
Enviado: 28 Out 2014 15:39
Alguém saberia informar como se faz um cálculo no GetBox automáticamente? Preciso que o terceiro GetBox seja preenchido sem ter que teclar o botão.
Obrigado.
Código: Selecionar todos
#include "minigui.ch"
Function Main
Local Qtd:=Valor:=TotItem:=0
Define Window Form_1 ;
At 0,0;
Width 300;
Height 250;
Title 'Getbox Demo' ;
Main
Define Label Label_Quantidade
Col 010
Row 020
AutoSize .T.
Value 'Quantidade'
End Label
Define GetBox Gbox_Quantidade
Col 100
Row 020
Width 30
AutoSize .T.
Value Qtd
Picture '99999'
End GetBox
Define Label Label_Valor
Col 010
Row 060
AutoSize .T.
Value 'Unitário'
End Label
Define GetBox Gbox_Valor
Col 100
Row 060
Width 70
AutoSize .T.
Value Valor
Picture '@E 99,999.99'
End GetBox
Define Label Label_Total
Col 010
Row 100
AutoSize .T.
Value 'Total'
End Label
Define GetBox Gbox_Total
Col 100
Row 100
Width 75
AutoSize .T.
Value TotItem
Picture '@E 999,999.99'
Action {||Totaliza(Form_1.Gbox_Quantidade.Value,Form_1.Gbox_Valor.Value)}
End GetBox
End Window
Form_1.Center
Form_1.Activate
Return Nil
Static Function Totaliza(nValor1,nValor2)
nTotItem:=Form_1.Gbox_Total.Value:=nValor1*nValor2
Return(nTotItem)