For example when i use the GRID demo 20 (c:\hmg.3.4.3\SAMPLES\Controls\Grid\GRID_20) and a start to edit a line this looks like this:
When i press enter i automaticly can edit the second column
The same for the next columns. When i press ESC the editing is canceled.
But when i press enter again on the same line the editing continues with the last edited column.
How can i change this behaviour to always startover with the first column
Is there maybe a variable or a property i can set to 'column 1' ?
Theo
How to change the start column in an inplace edit grid control (non CellNavigation mode)
Moderator: Rathinagiri
How to change the start column in an inplace edit grid control (non CellNavigation mode)
Last edited by trmpluym on Sun May 29, 2016 6:38 am, edited 1 time in total.
Re: How to change the start column in an inplace edit grid control (non CellNavigation mode)
En español:
Yo lo resolvi de esta manera ( no se si es la mas adecuada )
En h_grid.prg modifiqué la linea (1018 aproximadamente ) donde se activa la tecla escape para dejar de leer en la celda:
ON KEY ESCAPE ACTION ( _HMG_SYSDATA [ 256 ] := .T. , THISWINDOW.RELEASE )
y la compuse asi:
ON KEY ESCAPE ACTION ( _HMG_SYSDATA [ 256 ] := .T. ,_HMG_SYSDATA [ 340 ] := 1, THISWINDOW.RELEASE )
Luego apliqué BuildAllLib.bat volvi a generar el ehecutable y funcionó.
Si logras una manera mejor por favor compartela
Espero te ayude.
In English:
I solved it this way ( if not the most suitable )
In h_grid.prg I modified the line ( approximately 1018 ) where the escape key to stop reading in the cell is activated :
KEY ACTION ON ESCAPE ( _HMG_SYSDATA [256 ] : = .T , THISWINDOW.RELEASE . )
and composed as follows:
KEY ACTION ON ESCAPE ( _HMG_SYSDATA [256 ] : = .T , _HMG_SYSDATA [340 ] . = 1 , THISWINDOW.RELEASE )
Then I apply BuildAllLib.bat I returned to generate the ehecutable and it worked.
If you achieve a better way please share it
I hope to help you.
Yo lo resolvi de esta manera ( no se si es la mas adecuada )
En h_grid.prg modifiqué la linea (1018 aproximadamente ) donde se activa la tecla escape para dejar de leer en la celda:
ON KEY ESCAPE ACTION ( _HMG_SYSDATA [ 256 ] := .T. , THISWINDOW.RELEASE )
y la compuse asi:
ON KEY ESCAPE ACTION ( _HMG_SYSDATA [ 256 ] := .T. ,_HMG_SYSDATA [ 340 ] := 1, THISWINDOW.RELEASE )
Luego apliqué BuildAllLib.bat volvi a generar el ehecutable y funcionó.
Si logras una manera mejor por favor compartela
Espero te ayude.
In English:
I solved it this way ( if not the most suitable )
In h_grid.prg I modified the line ( approximately 1018 ) where the escape key to stop reading in the cell is activated :
KEY ACTION ON ESCAPE ( _HMG_SYSDATA [256 ] : = .T , THISWINDOW.RELEASE . )
and composed as follows:
KEY ACTION ON ESCAPE ( _HMG_SYSDATA [256 ] : = .T , _HMG_SYSDATA [340 ] . = 1 , THISWINDOW.RELEASE )
Then I apply BuildAllLib.bat I returned to generate the ehecutable and it worked.
If you achieve a better way please share it
I hope to help you.
Re: How to change the start column in an inplace edit grid control (non CellNavigation mode)
Hola.
Hice nuevas pruebas.
Sin hacer cambios en h_grid.prg.
Ni tampoco usar BuildAllLib.bat
Observa este ejemplo, creo que funciona.
Hice nuevas pruebas.
Sin hacer cambios en h_grid.prg.
Ni tampoco usar BuildAllLib.bat
Observa este ejemplo, creo que funciona.
Code: Select all
#include "hmg.ch"
Function Main
Local aRows [20] [3]
PRIVATE cGridName := ""
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 800 ;
HEIGHT 550 ;
TITLE 'Hello World!' ;
MAIN
aRows [1] := {'Simpson','Homer','555-5555'}
aRows [2] := {'Mulder','Fox','324-6432'}
aRows [3] := {'Smart','Max','432-5892'}
aRows [4] := {'Grillo','Pepe','894-2332'}
aRows [5] := {'Kirk','James','346-9873'}
aRows [6] := {'Barriga','Carlos','394-9654'}
aRows [7] := {'Flanders','Ned','435-3211'}
aRows [8] := {'Smith','John','123-1234'}
aRows [9] := {'Pedemonti','Flavio','000-0000'}
aRows [10] := {'Gomez','Juan','583-4832'}
aRows [11] := {'Fernandez','Raul','321-4332'}
aRows [12] := {'Borges','Javier','326-9430'}
aRows [13] := {'Alvarez','Alberto','543-7898'}
aRows [14] := {'Gonzalez','Ambo','437-8473'}
aRows [15] := {'Batistuta','Gol','485-2843'}
aRows [16] := {'Vinazzi','Amigo','394-5983'}
aRows [17] := {'Pedemonti','Flavio','534-7984'}
aRows [18] := {'Samarbide','Armando','854-7873'}
aRows [19] := {'Pradon','Alejandra','???-????'}
aRows [20] := {'Reyes','Monica','432-5836'}
@ 10,10 GRID Grid_1 ;
WIDTH 760 ;
HEIGHT 240 ;
HEADERS {'Last Name','First Name','Phone'} ;
WIDTHS {140,140,140};
ITEMS aRows ;
VALUE {1,1} ;
TOOLTIP 'Editable Grid Control' ;
EDIT ;
JUSTIFY { GRID_JTFY_CENTER,GRID_JTFY_RIGHT, GRID_JTFY_RIGHT } ;
CELLNAVIGATION;
ON GOTFOCUS cGridName := This.Name
@ 250,10 GRID Grid_2 ;
WIDTH 760 ;
HEIGHT 240 ;
HEADERS {'Last Name','First Name','Phone'} ;
WIDTHS {140,140,140};
ITEMS aRows ;
VALUE 1 EDIT ;
TOOLTIP 'Editable Grid Control' ;
ON HEADCLICK { {||MsgInfo('Click 1')} , {||MsgInfo('Click 2')} , {||MsgInfo('Click 3')} } ;
JUSTIFY { GRID_JTFY_LEFT,GRID_JTFY_CENTER, GRID_JTFY_CENTER };
ON GOTFOCUS cGridName := This.Name
END WINDOW
CREATE EVENT PROCNAME GridInplace()
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return
FUNCTION GridInplace()
IF _HMG_GridInplaceEdit_ControlHandle <> 0 // Grid Inplace Edit is in course
IF HMG_GetLastVirtualKeyDown() == VK_F2
HMG_CleanLastVirtualKeyDown()
This.CellValue := "Press Key " + cGridName
IF HMG_UPPER( cGridName ) == HMG_UPPER( "Grid_1" )
RETURN 1 // Abort processing the F2 key
ELSE
RETURN NIL // Continue processing the F2 key
ENDIF
elseif HMG_GetLastVirtualKeyDown() == VK_ESCAPE
_HMG_SYSDATA [ 340 ] := 1
ENDIF
ENDIF
RETURN NIL
Re: How to change the start column in an inplace edit grid control (non CellNavigation mode)
Asesormix !
Many thanks changing the value _HMG_SYSDATA [ 340 ] to 1 is the solution !!!
I changed my code with the line from your solution:
_HMG_SYSDATA [ 340 ] := 1
And now it works like a charm
Many thanks again for helping me out !
Many thanks changing the value _HMG_SYSDATA [ 340 ] to 1 is the solution !!!
I changed my code with the line from your solution:
_HMG_SYSDATA [ 340 ] := 1
And now it works like a charm
Many thanks again for helping me out !
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: How to change the start column in an inplace edit grid control (non CellNavigation mode)
Very nice! Thanks for finding the bug. We shall update in the next patch!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact: