Page 1 of 2
GRID - RECALL
Posted: Fri Mar 25, 2016 8:33 pm
by andyglezl
Hola
Será posible que en el GRID, cuando se oprime la tecla <Supr> por segunda vez en un mismo registro, haga un RECALL ?.
Creo que seria de utilidad para no tener que estar abriendo otro programa para recuperarlo.
-----------------------------------------------------------------------------------------------------------------------------------------------
Hello
Is it possible that in the GRID, when the <Del> key is pressed a second time on the same record, make a RECALL?.
I think it would be useful to avoid having to open another program to retrieve it.
Re: GRID - RECALL
Posted: Fri Mar 25, 2016 8:57 pm
by srvet_claudio
Se puede programar a través del evento ON KEY del Grid
Re: GRID - RECALL
Posted: Fri Mar 25, 2016 9:23 pm
by andyglezl
Gracias Dr. Soto
Pero no encuentro ningun ejemplo del GRID que contenga el evento ON KEY y la ayuda me muestra lo del COMANDO ON KEY:
Tendrá algun ejemplo disponible ?
----------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks Dr. Soto
But I can not find any example of GRID containing the ON KEY event and help show me what the COMMAND ON KEY:
You have any example available?
ON KEY
Defines a Keyboard Shortcut
ON KEY <Key>
[ OF <ParentWindow> ]
ACTION <ActionProcedureName> | <bBlock>
Re: GRID - RECALL
Posted: Fri Mar 25, 2016 9:34 pm
by andyglezl
OK, ya encontre un ejemplo en la version 3.4.2, lo reviso y comento.
Re: GRID - RECALL
Posted: Sat Mar 26, 2016 4:23 am
by andyglezl
Hola
Sobre la edición del CAMPO MEMO en el GRID, hay forma de editarlo en una ventana y no en la linea ?
Re: GRID - RECALL
Posted: Sat Mar 26, 2016 6:43 am
by andyglezl
Hola
Sucede algo raro, cuando utilizo el evento ON KEY del GRID, dejan de funcionar las teclas de navegación
arriba, abajo, derecha, izquierda, Enter, PgUp, PgDn. Es normal ???
------------------------------------------------------------------------------------------------------------------------------
Hello
Something strange happens when I use the GRID ON KEY event, stop working the navigation keys
up, down, left, right, Enter, PgUp, PgDn. It is normal ???
Re: GRID - RECALL
Posted: Sat Mar 26, 2016 5:23 pm
by andyglezl
Sucede algo raro, cuando utilizo el evento ON KEY del GRID, dejan de funcionar las teclas de navegación
arriba, abajo, derecha, izquierda, Enter, PgUp, PgDn. Es normal ???
Anexo ejemplo...
Re: GRID - RECALL
Posted: Sat Mar 26, 2016 8:48 pm
by srvet_claudio
andyglezl wrote:Sucede algo raro, cuando utilizo el evento ON KEY del GRID, dejan de funcionar las teclas de navegación
arriba, abajo, derecha, izquierda, Enter, PgUp, PgDn. Es normal ???
Anexo ejemplo...
PrbSample.rar
Change in FUNCTION CHK_Delete( ):
RETURN 1 for RETURN NIL
Re: GRID - RECALL
Posted: Sat Mar 26, 2016 10:31 pm
by andyglezl
Gracias Dr. Soto, solucionado lo de las teclas de navegacion.
Otro detalle, cuando entro a una celda para editar, marco algo (en azul), oprimo la tecla <Supr> y luego doy <Enter>
para terminar la edicion, me lo toma como si oprimí solo <Supr> y me marca como "Borrado" ese registro.
( se puede probar en el .prg posteado )
Pregunta: porque no lo puedo utilizar de la siguiente forma ?
Domethod( ThisWindow.Name, This.Name, 'Recall' )
// Da error !!! BASE/1132 Error de Rango: acceso al array - GETDATAGRIDRECNO(2400)
Re: GRID - RECALL
Posted: Sun Mar 27, 2016 12:44 am
by srvet_claudio
andyglezl wrote:Gracias Dr. Soto, solucionado lo de las teclas de navegacion.
Otro detalle, cuando entro a una celda para editar, marco algo (en azul), oprimo la tecla <Supr> y luego doy <Enter>
para terminar la edicion, me lo toma como si oprimí solo <Supr> y me marca como "Borrado" ese registro.
( se puede probar en el .prg posteado )
Pregunta: porque no lo puedo utilizar de la siguiente forma ?
Domethod( ThisWindow.Name, This.Name, 'Recall' )
// Da error !!! BASE/1132 Error de Rango: acceso al array - GETDATAGRIDRECNO(2400)
Porque cuando se esta editando una celda el Grid crea una ventana nueva sobre la celda que simula una verdadera edición sobre el Grid, hay que hacerlo así:
Code: Select all
PRIVATE cThisWindowName := "", cThisControlName := ""
DEFINE WINDOW Form_GridCtes AT 0 , 0 WIDTH 1024 HEIGHT 600 TITLE '| ABC CLIENTES |' MODAL NOSIZE ON RELEASE Form_Main.Restore BACKCOLOR { 0, 33, 38 };
ON GOTFOCUS cThisWindowName := ThisWindow.Name
@ 030 , 005 GRID Grid_2 OF Form_GridCtes WIDTH 1008 HEIGHT 505 FONT "VERDANA" SIZE 10 FONTCOLOR BLACK;
...
ON GOTFOCUS cThisControlName := This.Name
Code: Select all
FUNCTION CHK_Delete( )
IF HMG_GetLastVirtualKeyDown() == VK_DELETE
HMG_CleanLastVirtualKeyDown()
IF RegEnRed( "Ctes" )
IF DELETE()
Domethod( cThisWindowName, cThisControlName, 'Recall' )
RECALL
ELSE
*Domethod( cThisWindowName, cThisControlName, 'Delete' )
DELETE
ENDIF
UNLOCK
aPso := GetProperty( cThisWindowName, cThisControlName, 'Value' )
Tone( 700, 1 )
SetProperty( cThisWindowName, cThisControlName, 'Value', aPso )
ENDIF
ENDIF
return nil