KeyPad

Post Reply
User avatar
pablovidal
Posts: 398
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana
Contact:

KeyPad

Post by pablovidal »

Esto es un Teclado Numerico Virtual:

Image

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 )
 
Last edited by pablovidal on Sun Nov 15, 2009 5:00 pm, edited 1 time in total.
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: KeyPad

Post by Antonio Linares »

Pablo,

Puedes poner un pantallazo de como se ve ?

gracias! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
pablovidal
Posts: 398
Joined: Thu Oct 06, 2005 10:15 pm
Location: Republica Dominicana
Contact:

Re: KeyPad

Post by pablovidal »

Image
Saludos,

Pablo Alberto Vidal
/*
------------------------------------------------------
Harbour 3.2.0, Fivewin 17.02, BCC7
------------------------------------------------------
*/
Post Reply