FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TGet ingresar uno a uno
Posts: 170
Joined: Sat Aug 07, 2010 11:36 PM
TGet ingresar uno a uno
Posted: Wed Jan 19, 2011 12:55 AM

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.

Posts: 601
Joined: Wed Jul 04, 2007 03:51 PM
Re: TGet ingresar uno a uno
Posted: Wed Jan 19, 2011 01:16 AM
Hola jgayoso
Prueba de la siguiente manera...

Code (fw): Select all Collapse
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,
Ojeda Esteban Eduardo.

Buenos Aires - Argentina.

FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport

Skype: jreduojeda
Posts: 170
Joined: Sat Aug 07, 2010 11:36 PM
Re: TGet ingresar uno a uno
Posted: Wed Jan 19, 2011 02:41 PM
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 (fw): Select all Collapse
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,
Posts: 601
Joined: Wed Jul 04, 2007 03:51 PM
Re: TGet ingresar uno a uno
Posted: Wed Jan 19, 2011 03:11 PM
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.
Ojeda Esteban Eduardo.

Buenos Aires - Argentina.

FWH - PellesC - DBF/CDX - ADS - Gloriosos .Bat - MySql - C# .net - FastReport

Skype: jreduojeda
Posts: 1088
Joined: Fri Oct 07, 2005 03:33 PM
Re: TGet ingresar uno a uno
Posted: Wed Jan 19, 2011 09:27 PM
Hola,

algo asi te serviria?
Code (fw): Select all Collapse
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.
Posts: 170
Joined: Sat Aug 07, 2010 11:36 PM
Re: TGet ingresar uno a uno
Posted: Thu Jan 20, 2011 07:52 PM
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? :-)



Marcelo Via Giglio wrote:Hola,

algo asi te serviria?
Code (fw): Select all Collapse
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.

Continue the discussion