Page 1 of 1

TGet ingresar uno a uno

Posted: Wed Jan 19, 2011 12:55 am
by jgayoso
Se prodra hacer lo siguiente:
Paso el foco a oGet1 luego de ingresar motrar mensaje Paso 1, ingresar oGet2 luego de ingresar motrar mensaje Paso 2, etc.
Con que intrucción puedo reemplzar ???? para que se detenga el proceso hasta que se ingrese algon en un oGet.

Se agradece. :roll:


Function fPrueba()

MsgAlert( "Paso 0")

@y,x GET oGet1 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet1:SetFocus()

????

MsgAlert( "Paso 1")


@y,x GET oGet2 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet2:SetFocus()

????

MsgAlert( "Paso 2")

@y,x GET oGet3 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet3:SetFocus()

????

MsgAlert( "Paso 3")

@y,x GET oGet4 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet4:SetFocus()

????

MsgAlert( "Paso 4")
Return .T.

Re: TGet ingresar uno a uno

Posted: Wed Jan 19, 2011 1:16 am
by jrestojeda
Hola jgayoso
Prueba de la siguiente manera...

Code: Select all

MsgAlert( "Paso 0")

@y,x GET oGet1 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet1:SetFocus()

oGet1:bLostFocus:={|| MsgAlert( "Paso 1") }

@y,x GET oGet2 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet2:SetFocus()

oGet2:bLostFocus:={|| MsgAlert( "Paso 2") }

@y,x GET oGet3 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet3:SetFocus()

oGet3:bLostFocus:={|| MsgAlert( "Paso 3") }

@y,x GET oGet4 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet4:SetFocus()

oGet4:bLostFocus:={|| MsgAlert( "Paso 4") }

 
Del mismo modo en el bloque de código puedes llamar a una función que evalúe que el GET tenga algo. Si es que no quieres usar un VALID(!EMPTY(vGet)) claro está.

Espero te sirva.
Saludos,

Re: TGet ingresar uno a uno

Posted: Wed Jan 19, 2011 2:41 pm
by jgayoso
La idea es que no pase al siguiente tGet si no ha salido del primero...

jrestojeda wrote:Hola jgayoso
Prueba de la siguiente manera...

Code: Select all

MsgAlert( "Paso 0")

@y,x GET oGet1 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet1:SetFocus()

oGet1:bLostFocus:={|| MsgAlert( "Paso 1") }

@y,x GET oGet2 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet2:SetFocus()

oGet2:bLostFocus:={|| MsgAlert( "Paso 2") }

@y,x GET oGet3 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet3:SetFocus()

oGet3:bLostFocus:={|| MsgAlert( "Paso 3") }

@y,x GET oGet4 VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto
oGet4:SetFocus()

oGet4:bLostFocus:={|| MsgAlert( "Paso 4") }

 
Del mismo modo en el bloque de código puedes llamar a una función que evalúe que el GET tenga algo. Si es que no quieres usar un VALID(!EMPTY(vGet)) claro está.

Espero te sirva.
Saludos,

Re: TGet ingresar uno a uno

Posted: Wed Jan 19, 2011 3:11 pm
by jrestojeda
jgayoso wrote:La idea es que no pase al siguiente tGet si no ha salido del primero...
No entiendo...
Si no salió del un GET quiere decir que el foco está posicionado en ese GET. Y hasta que no pierda el foco no pasará al siguiente control.

Re: TGet ingresar uno a uno

Posted: Wed Jan 19, 2011 9:27 pm
by Marcelo Via Giglio
Hola,

algo asi te serviria?

Code: Select all

Function fPrueba()
local oGet[4]

MsgAlert( "Paso 0")

@y,x GET oGet[1] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(2)
@y,x GET oGet[2] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(3)
@y,x GET oGet[3] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(4)
@y,x GET oGet[4] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(5)

// al inicializar el oWdn_Secundario debe haber algo que oculte todos los gets AEVAL( oGet, {|o| o:hide() } )

Return .T.

function next_step(n)

        msgalert( "Paso " + STR(n) )     
    oGet[n-1]:hide()
        oGet[n]:show()
        oGet[n]:setFocus()
 
return .t.

Re: TGet ingresar uno a uno

Posted: Thu Jan 20, 2011 7:52 pm
by jgayoso
Marcelo, la idea es la siguiente:

Carga formulario con 3 tGet en invocar una función al iniciar, que tenga lo siguiente:

linea de comando 1
linea de comando 2
linea de comando 3
ir a Tget 1 al peder el foco seguir en linea de comando 4
linea de comando 4
linea de comando 5
ir a otro 2 Tget al peder el foco seguir linea de comando 6
linea de comando 6
linea de comando 7
linea de comando 8
linea de comando 9
ir a otro 3 Tget al peder el foco seguir en linea de comando 10

linea de comando 10

Se muestra el formulario y la función decide cual det activar o sesactivar y entremedio hay comandos.

Se podra? :cry:


Marcelo Via Giglio wrote:Hola,

algo asi te serviria?

Code: Select all

Function fPrueba()
local oGet[4]

MsgAlert( "Paso 0")

@y,x GET oGet[1] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(2)
@y,x GET oGet[2] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(3)
@y,x GET oGet[3] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(4)
@y,x GET oGet[4] VAR valr OF oWdn_Secundario SIZE 40, 10 Font oFnt_Texto VALID next_step(5)

// al inicializar el oWdn_Secundario debe haber algo que oculte todos los gets AEVAL( oGet, {|o| o:hide() } )

Return .T.

function next_step(n)

        msgalert( "Paso " + STR(n) )     
    oGet[n-1]:hide()
        oGet[n]:show()
        oGet[n]:setFocus()
 
return .t.