diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c0ab2153cf..30d754f273 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,13 @@ +2000-11-20 17:38 GMT+1 Maurilio Longo + * source/rtl/tbrowse.prg + ! ::aRedraw[] can change its size if header/footer separators are added/removed + during object life. ::Configure() can now handle this. + ! ::PageDown() could set ::RowPos past ::RowCount. Fixed. + * contrib/mysql/tmysql.prg + ! fixed ::Skip() error when at eof(). + * contrib/mysql/tsqlbrw.prg + ! missing ::Configure() call + 2000-11-18 11:11 GMT+1 Maurilio Longo * source/rtl/tbrowse.prg * drawing headers and footers is not needed if columns on screen don't change, diff --git a/harbour/contrib/mysql/tmysql.prg b/harbour/contrib/mysql/tmysql.prg index 71723b758a..ee767109d1 100644 --- a/harbour/contrib/mysql/tmysql.prg +++ b/harbour/contrib/mysql/tmysql.prg @@ -378,7 +378,7 @@ METHOD Skip(nRows) CLASS TMySQLQuery else // positive movement - ::nCurRow := Min(::nCurRow + nRows, ::nNumRows + 1) + ::nCurRow := Min(::nCurRow + nRows, ::nNumRows) endif diff --git a/harbour/contrib/mysql/tsqlbrw.prg b/harbour/contrib/mysql/tsqlbrw.prg index 52275ce2c9..fb9236a0f9 100644 --- a/harbour/contrib/mysql/tsqlbrw.prg +++ b/harbour/contrib/mysql/tsqlbrw.prg @@ -390,4 +390,5 @@ return Self // Empty method to be subclassed METHOD KeyboardHook(nKey) CLASS TBrowseSQL + return Self diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index 98201f4047..aa162b7db5 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -197,6 +197,12 @@ METHOD New(nTop, nLeft, nBottom, nRight) CLASS TBrowse return Self +METHOD Invalidate() CLASS TBrowse + + AFill(::aRedraw, .F. ) + ::Stable := .F. + +return Self METHOD Configure(nMode) CLASS TBrowse @@ -222,6 +228,17 @@ METHOD Configure(nMode) CLASS TBrowse endif next + // 20/nov/2000 - maurilio.longo@libero.it + // If I add (or remove) header or footer separator I have to change number + // of available rows + ::RowCount := ::nBottom - ::nTop + 1 - iif( ::lHeaders, 1, 0 ) - ; + iif( ::lFooters, 1, 0 ) - iif( Empty( ::HeadSep ), 0, 1 ) - ; + iif( Empty( ::FootSep ), 0, 1 ) + + if Len(::aRedraw) <> ::RowCount + ::aRedraw := Array(::RowCount) + endif + ::Invalidate() return Self @@ -265,8 +282,8 @@ METHOD Down() CLASS TBrowse if Eval( ::SkipBlock, 1 ) != 0 if ::RowPos < ::RowCount ::RowPos++ - ::Hilite() ::RelativePos++ + ::Hilite() else n := ::nTop + iif( ::lHeaders, 1, 0 ) + iif( Empty( ::HeadSep ), 0, 1 ) Scroll( n, ::nLeft, n + ::RowCount - 1, ::nRight, 1 ) @@ -334,19 +351,6 @@ METHOD Home() CLASS TBrowse return Self -METHOD Invalidate() CLASS TBrowse - - local n - - ::RowCount := ::nBottom - ::nTop + 1 - iif( ::lHeaders, 1, 0 ) - ; - iif( ::lFooters, 1, 0 ) - iif( Empty( ::HeadSep ), 0, 1 ) - ; - iif( Empty( ::FootSep ), 0, 1 ) - - AFill(::aRedraw, .F. ) - ::Stable := .F. - -return Self - METHOD _Right() CLASS TBrowse if ::ColPos < ::rightVisible @@ -428,15 +432,17 @@ METHOD PageDown() CLASS TBrowse ::HitTop := .F. if !::HitBottom if ( nDown := Eval( ::SkipBlock, ::RowCount ) ) != 0 - if nDown < ::RowCount - ::RefreshAll() + if ::RowPos + nDown < ::RowCount ::RowPos += nDown ::RelativePos += nDown + ::RefreshAll() else + ::RowPos := ::RowCount + ::RelativePos := ::RowCount ::RefreshAll() endif else - ::HitBottom := .t. + ::HitBottom := .T. endif endif @@ -450,9 +456,9 @@ METHOD PageUp() CLASS TBrowse if !::HitTop if ( nUp := Abs( Eval( ::SkipBlock, - ::RowCount ) ) ) != 0 if nUp < ::RowCount - ::RefreshAll() ::RowPos := 1 ::RelativePos := 1 + ::RefreshAll() else ::RefreshAll() endif @@ -649,13 +655,6 @@ METHOD Stabilize() CLASS TBrowse ::rightVisible := nColsVisible - if Empty(::aRedraw) - ::RowCount := ::nBottom - ::nTop + 1 - iif( ::lHeaders, 1, 0 ) - ; - iif( ::lFooters, 1, 0 ) - iif( Empty( ::HeadSep ), 0, 1 ) - iif( Empty( ::FootSep ), 0, 1 ) - ::aRedraw := Array( ::RowCount ) - AFill( ::aRedraw, .F. ) - endif - else oCol := ::aColumns[ iif( ::rightVisible != 0, ::rightVisible, 1 ) ] oCol2 := ::aColumns[ iif( ::Freeze > 0, 1, ::leftVisible ) ]