Grid: problem with events onkey
Posted: Fri May 06, 2016 8:20 am
Welcome.
Probably a mistake with support for key events at onkey, create event, etc.
I noticed the lack of EventMSG () == WM_CHAR the keys A S D R U.
Error disappears when you change the end of the function key handling A S D R U file h_windows.prg from the line in 2865 by converting to return 1 return 0. Below accurate description.
....
"Harbour Project"
Copyright 1999-2008, http://www.harbour-project.org/
"WHAT32"
Copyright 2002 AJ Wos <andrwos@aust1.net>
"HWGUI"
Copyright 2001-2008 Alexander S.Kresin <alex@belacy.belgorod.su>
---------------------------------------------------------------------------*/
/*
From line 2865 in structure else .. endif rename return 1 --> return 0 for key A D R S U
add 29-04-2016 Piotr Michalski (bad read key in event onkey)
*/
// #define ALLOW_ONLY_ONE_MESSAGE_LOOP
.....
.....
....
//line 2865
Case GetGridvKey (lParam) == 65 // A
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 12 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridAppend(i)
ENDIF
Else
return 0 //not return 1 ?
EndIf
Case GetGridvKey (lParam) == 68 // D
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 17 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridDelete(i)
ENDIF
Else
return 0
EndIf
Case GetGridvKey (lParam) == 82 // R
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 17 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridReCall(i)
ENDIF
Else
return 0
EndIf
Case GetGridvKey (lParam) == 83 // S
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF ( _HMG_SYSDATA [ 40 ] [ i ] [ 12 ] == .T. .OR. _HMG_SYSDATA [ 40 ] [ i ] [ 1 ] == .T. ) .AND. ( VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C' )
DataGridSave(i)
ENDIF
Else
Return 0
EndIf
Case GetGridvKey (lParam) == 85 // U
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 12 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridClearBuffer(i)
ENDIF
Else
Return 0
EndIf
OtherWise
// Return 1 // Remove, december 2014
EndCase
Return 0 // ADD, december 2014
EndIf
EndIf
.....
...
In the Annex the corrected file h windows.prg
I do not know how well I think, but can someone come in handy
greetings
Translated by Google
Probably a mistake with support for key events at onkey, create event, etc.
I noticed the lack of EventMSG () == WM_CHAR the keys A S D R U.
Error disappears when you change the end of the function key handling A S D R U file h_windows.prg from the line in 2865 by converting to return 1 return 0. Below accurate description.
....
"Harbour Project"
Copyright 1999-2008, http://www.harbour-project.org/
"WHAT32"
Copyright 2002 AJ Wos <andrwos@aust1.net>
"HWGUI"
Copyright 2001-2008 Alexander S.Kresin <alex@belacy.belgorod.su>
---------------------------------------------------------------------------*/
/*
From line 2865 in structure else .. endif rename return 1 --> return 0 for key A D R S U
add 29-04-2016 Piotr Michalski (bad read key in event onkey)
*/
// #define ALLOW_ONLY_ONE_MESSAGE_LOOP
.....
.....
....
//line 2865
Case GetGridvKey (lParam) == 65 // A
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 12 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridAppend(i)
ENDIF
Else
return 0 //not return 1 ?
EndIf
Case GetGridvKey (lParam) == 68 // D
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 17 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridDelete(i)
ENDIF
Else
return 0
EndIf
Case GetGridvKey (lParam) == 82 // R
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 17 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridReCall(i)
ENDIF
Else
return 0
EndIf
Case GetGridvKey (lParam) == 83 // S
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF ( _HMG_SYSDATA [ 40 ] [ i ] [ 12 ] == .T. .OR. _HMG_SYSDATA [ 40 ] [ i ] [ 1 ] == .T. ) .AND. ( VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C' )
DataGridSave(i)
ENDIF
Else
Return 0
EndIf
Case GetGridvKey (lParam) == 85 // U
if GetAltState() == -127 ;
.or.;
GetAltState() == -128 // ALT
IF _HMG_SYSDATA [ 40 ] [ i ] [ 12 ] == .T. .AND. VALTYPE(_HMG_SYSDATA [ 40 ] [ i ] [ 10 ] ) == 'C'
DataGridClearBuffer(i)
ENDIF
Else
Return 0
EndIf
OtherWise
// Return 1 // Remove, december 2014
EndCase
Return 0 // ADD, december 2014
EndIf
EndIf
.....
...
In the Annex the corrected file h windows.prg
I do not know how well I think, but can someone come in handy
greetings
Translated by Google