GRID - RECALL

Creative ideas/suggestions for HMG

Moderator: Rathinagiri

User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

GRID - RECALL

Post 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.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID - RECALL

Post by srvet_claudio »

Se puede programar a través del evento ON KEY del Grid
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: GRID - RECALL

Post 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>
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: GRID - RECALL

Post by andyglezl »

OK, ya encontre un ejemplo en la version 3.4.2, lo reviso y comento.
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: GRID - RECALL

Post 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 ?
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: GRID - RECALL

Post 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 ???
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: GRID - RECALL

Post 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...
PrbSample.rar
(4.38 KiB) Downloaded 260 times
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID - RECALL

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
andyglezl
Posts: 1461
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Contact:

Re: GRID - RECALL

Post 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)
Andrés González López
Desde Guadalajara, Jalisco. México.
User avatar
srvet_claudio
Posts: 2220
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GRID - RECALL

Post 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
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply