Code: Select all
/*
Tecla Numerico Virtual
Pablo Vidal
*/
Function KeyPad()
Local nResultado := 0
Local oDlg
Local oSay
Local uTemp := "0"
Local oFnt
DEFINE FONT oFnt NAME "TAHOMA" SIZE 0, -16 BOLD
DEFINE DIALOG oDlg FROM 0,0 TO 185, 175 Title "KeyPad" Pixel
@ 005, 005 Say oSay Prompt {|| Transform( Val( uTemp ),"999,999,999,999.99" ) } RIGHT SIZE 80, 12 OF oDlg PIXEL FONT oFnt COLOR CLR_HGREEN, CLR_BLACK
@ 020, 005 BUTTON "7" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "7" ), oSay:Refresh() )
@ 020, 023 BUTTON "8" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "8" ), oSay:Refresh() )
@ 020, 041 BUTTON "9" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "9" ), oSay:Refresh() )
@ 038, 005 BUTTON "4" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "4" ), oSay:Refresh() )
@ 038, 023 BUTTON "5" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "5" ), oSay:Refresh() )
@ 038, 041 BUTTON "6" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "6" ), oSay:Refresh() )
@ 056, 005 BUTTON "1" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "1" ), oSay:Refresh() )
@ 056, 023 BUTTON "2" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "2" ), oSay:Refresh() )
@ 056, 041 BUTTON "3" OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "3" ), oSay:Refresh() )
@ 074, 005 BUTTON "0" OF oDlg SIZE 33, 15 PIXEL ACTION ( ( uTemp += "0" ), oSay:Refresh() )
@ 074, 041 BUTTON "." OF oDlg SIZE 15, 15 PIXEL ACTION ( ( uTemp += "." ), oSay:Refresh() )
@ 020, 060 BUTTON "Back" OF oDlg SIZE 23, 15 PIXEL ACTION ( ( uTemp := substr( uTemp, 1, Len( uTemp)-1 ) ), oSay:Refresh() )
@ 038, 060 BUTTON "Borrar" OF oDlg SIZE 23, 15 PIXEL ACTION ( ( uTemp := "" ), oSay:Refresh() )
@ 056, 060 BUTTON "ENTER" OF oDlg SIZE 23, 33 PIXEL ACTION ( ( nResultado := Val( uTemp ) ), odlg:End() )
ACTIVATE DIALOG oDlg CENTER
oFnt:End()
Return( nResultado )