LOCAL oGet, cvar := Space(100)
@ 82, 2 GET oGet VAR cVar SIZE 200,20 PIXEL OF oBarRight NOBORDER FONT oFontGet
oGet:bChange := {|nKey|(Chr(nKey)$"0123456789.")}
why I can insert also characters ? (as you see in this picture )
![Image](https://i.postimg.cc/qvSZZKDT/kk.png)
what about using cPicture "99"Silvio.Falconi wrote:the user can digit only number and "." on a get
Code: Select all | Expand
// C:\FWH..\SAMPLES\SILVGETN.PRG
#Include "FiveWin.ch"
STATIC oDlg, oFont
FUNCTION Main()
LOCAL oGet, cVar := Space(100)
LOCAL oBtnX2, cTitle, aGrad, oSay
cTitle := "Cambia GET"
DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14
DEFINE DIALOG oDlg SIZE 600, 200 PIXEL TRUEPIXEL RESIZABLE ;
TITLE cTitle GRADIENT aGrad FONT oFont
oDlg:lHelpIcon := .F.
@ 12, 2 GET oGet VAR cVar SIZE 200,20 PIXEL OF oDlg FONT oFont ;
PICTURE "@R 99,999,999,999.99"
ACTIVATE DIALOG oDlg CENTERED ON INIT( CAMBIA_PICT( oGet ) )
RETURN NIL
FUNCTION CAMBIA_PICT( oGet )
LOCAL cPict := "012345678912"
oGet:VARPUT( cPict )
oGet:Refresh()
RETURN( .T. )
// FIN / END
NOkarinha wrote:Algo asi?
Regards, saludos.Code: Select all | Expand
// C:\FWH..\SAMPLES\SILVGETN.PRG #Include "FiveWin.ch" STATIC oDlg, oFont FUNCTION Main() LOCAL oGet, cVar := Space(100) LOCAL oBtnX2, cTitle, aGrad, oSay cTitle := "Cambia GET" DEFINE FONT oFont NAME "TAHOMA" SIZE 0, - 14 DEFINE DIALOG oDlg SIZE 600, 200 PIXEL TRUEPIXEL RESIZABLE ; TITLE cTitle GRADIENT aGrad FONT oFont oDlg:lHelpIcon := .F. @ 12, 2 GET oGet VAR cVar SIZE 200,20 PIXEL OF oDlg FONT oFont ; PICTURE "@R 99,999,999,999.99" ACTIVATE DIALOG oDlg CENTERED ON INIT( CAMBIA_PICT( oGet ) ) RETURN NIL FUNCTION CAMBIA_PICT( oGet ) LOCAL cPict := "012345678912" oGet:VARPUT( cPict ) oGet:Refresh() RETURN( .T. ) // FIN / END
Code: Select all | Expand
PICTURE "99.99.99.9.9.99.99" //-> 36.67.80.7.3.23.45
I not know the config of stringkarinha wrote:Code: Select all | Expand
PICTURE "99.99.99.9.9.99.99" //-> 36.67.80.7.3.23.45
https://vivaclipper.wordpress.com/2012/ ... -template/
Regards, saludos.
Code: Select all | Expand
oGet:bKeyChar := { |k| If( chr( k ) $ ".0123456789", nil, 0 ) }
Thanks raonageswaragunupudi wrote:Code: Select all | Expand
oGet:bKeyChar := { |k| If( chr( k ) $ ".0123456789", nil, 0 ) }