From 6f5d5a964cb2cdaa76ae569f7a2f906df4ee9f96 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Fri, 23 Nov 2012 16:15:09 +0000 Subject: [PATCH] 2012-11-23 17:14 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * harbour/contrib/xhb/xhbtedit.prg * harbour/contrib/hbmysql/tsqlbrw.prg * harbour/contrib/hbodbc/browodbc.prg % eliminated NextKey() calls ; TOFIX: BrowseODBC() just like dbEdit() ignore setKey() actions If key is pressed during stabilization faze. I think it's implementation problem not intentional decision and it should be fixed - there is nothing worse then application which ignores some keystrokes if user types to fast ;) I'd like to ask authors of above code to check it. ; I haven't touched xhb/xhbmemo.prg - it makes some hacks with keyboard polling so it's serious chance I would break sth. --- harbour/ChangeLog | 14 ++++++++++++++ harbour/contrib/hbmysql/tsqlbrw.prg | 10 ++++++++-- harbour/contrib/hbodbc/browodbc.prg | 14 +++++++------- harbour/contrib/xhb/xhbtedit.prg | 9 ++++----- 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index bf18ec37dc..c3547cc5e1 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,20 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-23 17:14 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) + * harbour/contrib/xhb/xhbtedit.prg + * harbour/contrib/hbmysql/tsqlbrw.prg + * harbour/contrib/hbodbc/browodbc.prg + % eliminated NextKey() calls + ; TOFIX: BrowseODBC() just like dbEdit() ignore setKey() actions + If key is pressed during stabilization faze. I think it's + implementation problem not intentional decision and it + should be fixed - there is nothing worse then application + which ignores some keystrokes if user types to fast ;) + I'd like to ask authors of above code to check it. + ; I haven't touched xhb/xhbmemo.prg - it makes some hacks with + keyboard polling so it's serious chance I would break sth. + 2012-11-23 16:22 UTC+0100 Viktor Szakats (harbour syenar.net) * website/js/shBrushHarbour.js % limited the number of known functions to non-internal diff --git a/harbour/contrib/hbmysql/tsqlbrw.prg b/harbour/contrib/hbmysql/tsqlbrw.prg index 32d0f6ffba..60b1d061d3 100644 --- a/harbour/contrib/hbmysql/tsqlbrw.prg +++ b/harbour/contrib/hbmysql/tsqlbrw.prg @@ -331,10 +331,16 @@ METHOD BrowseTable( lCanEdit, aExitKeys ) CLASS TBrowseSQL DO WHILE lKeepGoing - DO WHILE ! ::Stabilize() .AND. NextKey() == 0 + DO WHILE .T. + nKey := Inkey() + IF ::Stabilize() .AND. nKey != 0 + EXIT + ENDIF ENDDO - nKey := Inkey( 0 ) + IF nKey == 0 + nKey := Inkey( 0 ) + ENDIF IF AScan( aExitKeys, nKey ) > 0 lKeepGoing := .F. diff --git a/harbour/contrib/hbodbc/browodbc.prg b/harbour/contrib/hbodbc/browodbc.prg index d7fcbb28ae..f729e117f0 100644 --- a/harbour/contrib/hbodbc/browodbc.prg +++ b/harbour/contrib/hbodbc/browodbc.prg @@ -109,12 +109,14 @@ FUNCTION BrowseODBC( nTop, nLeft, nBottom, nRight, oDataSource ) DO WHILE ! lExit - IF nKey == 0 - DO WHILE ! oBrw:stabilize() .AND. NextKey() == 0 - ENDDO - ENDIF + DO WHILE .T. + nKey := Inkey() + IF oBrw:stabilize() .OR. nKey != 0 + EXIT + ENDIF + ENDDO - IF NextKey() == 0 + IF nKey == 0 oBrw:forceStable() Statline( oBrw, oDataSource ) @@ -125,8 +127,6 @@ FUNCTION BrowseODBC( nTop, nLeft, nBottom, nRight, oDataSource ) Eval( bAction, ProcName( 1 ), ProcLine( 1 ), "" ) LOOP ENDIF - ELSE - nKey := Inkey() ENDIF DO CASE diff --git a/harbour/contrib/xhb/xhbtedit.prg b/harbour/contrib/xhb/xhbtedit.prg index 4391201875..d3389b22d6 100644 --- a/harbour/contrib/xhb/xhbtedit.prg +++ b/harbour/contrib/xhb/xhbtedit.prg @@ -695,12 +695,11 @@ METHOD Edit( nPassedKey ) CLASS XHBEditor // IF nPassedKey == NIL - IF NextKey() == 0 + IF ( nKey := Inkey( , INKEY_ALL ) ) == 0 ::IdleHook() + nKey := Inkey( 0, INKEY_ALL ) ENDIF - nKey := Inkey( 0, INKEY_ALL ) - ELSE lSingleKeyProcess := .T. @@ -3068,11 +3067,11 @@ METHOD BrowseText( nPassedKey, lHandleOneKey ) CLASS XHBEditor // If I haven't been called with a key already preset, evaluate this key and then exit IF nPassedKey == NIL - IF NextKey() == 0 + IF ( nKey := Inkey() ) == 0 ::IdleHook() + nKey := Inkey( 0 ) ENDIF - nKey := Inkey( 0 ) ELSE nKey := nPassedKey ENDIF