diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 39fa205ae4..8fb3861ac0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,10 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-11 14:27 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * src/rtl/browse.prg + % Optimized. On some RDD some points were a killer. + 2011-02-11 13:52 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbide/dbstruct.ui * contrib/hbide/idebrowse.prg diff --git a/harbour/src/rtl/browse.prg b/harbour/src/rtl/browse.prg index 60bbb57ad8..7a55da637b 100644 --- a/harbour/src/rtl/browse.prg +++ b/harbour/src/rtl/browse.prg @@ -57,7 +57,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) LOCAL oBrw - LOCAL lExit, lAppend, lKeyPressed, lRefresh + LOCAL lExit, lAppend, lKeyPressed, lRefresh, lDispScore LOCAL n, nOldCursor, nKey LOCAL cOldScreen LOCAL bAction @@ -106,6 +106,8 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) lKeyPressed := .T. ENDIF + lDispScore := .T. + DO WHILE ! lExit DO WHILE ! lKeyPressed .AND. ! oBrw:Stabilize() @@ -129,7 +131,10 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) { 2, 2 } ) ENDIF - StatLine( oBrw, lAppend ) + IF lDispScore + lDispScore := .F. + StatLine( oBrw, lAppend ) + ENDIF oBrw:ForceStable() @@ -158,6 +163,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) lRefresh := .T. ELSE oBrw:Up() + lDispScore := .T. ENDIF EXIT @@ -169,6 +175,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) oBrw:HitBottom( .T. ) ELSE oBrw:Down() + lDispScore := .T. ENDIF EXIT @@ -177,6 +184,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) lRefresh := .T. ELSE oBrw:PageUp() + lDispScore := .T. ENDIF EXIT @@ -185,6 +193,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) oBrw:HitBottom( .T. ) ELSE oBrw:PageDown() + lDispScore := .T. ENDIF EXIT @@ -193,6 +202,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) lRefresh := .T. ELSE oBrw:GoTop() + lDispScore := .T. ENDIF EXIT @@ -201,6 +211,7 @@ FUNCTION Browse( nTop, nLeft, nBottom, nRight ) lRefresh := .T. ELSE oBrw:GoBottom() + lDispScore := .T. ENDIF EXIT @@ -292,18 +303,22 @@ STATIC PROCEDURE StatLine( oBrw, lAppend ) LOCAL nTop := oBrw:nTop - 1 LOCAL nRight := oBrw:nRight + LOCAL nRecNo, nLastRec hb_dispOutAt( nTop, nRight - 27, "Record " ) - IF LastRec() == 0 .AND. ! lAppend + nRecNo := RecNo() + nLastRec := LastRec() + + IF nLastRec == 0 .AND. ! lAppend hb_dispOutAt( nTop, nRight - 20, " " ) - ELSEIF RecNo() == LastRec() + 1 + ELSEIF nRecNo == nLastRec + 1 hb_dispOutAt( nTop, nRight - 40, " " ) hb_dispOutAt( nTop, nRight - 20, " " ) ELSE hb_dispOutAt( nTop, nRight - 40, iif( Deleted(), "", " " ) ) - hb_dispOutAt( nTop, nRight - 20, PadR( hb_NToS( RecNo() ) + "/" + ; - hb_NToS( LastRec() ), 16 ) + ; + hb_dispOutAt( nTop, nRight - 20, PadR( hb_NToS( nRecNo ) + "/" + ; + hb_NToS( nLastRec ), 16 ) + ; iif( oBrw:HitTop(), "", " " ) ) ENDIF @@ -339,7 +354,10 @@ STATIC FUNCTION DoGet( oBrw, lAppend ) IF lAppend .AND. RecNo() == LastRec() + 1 dbAppend() ENDIF - Eval( oCol:Block, xValue ) + IF RLock() + Eval( oCol:Block, xValue ) + DbUnlock() + ENDIF IF !lAppend .AND. !Empty( cForExp := OrdFor( IndexOrd() ) ) .AND. ; ! &cForExp