On Wed, Apr 23, 2008 at 9:12 PM, Przemyslaw Czerpak <[EMAIL PROTECTED]> wrote:

>  Can you describe with more details the difference?

I've attached a test that simulate the real code ( not exactly since
it didn't catch the previous error ).

If you press K_CTRL_INS when the cursor is on the last row ( the
second ) C53B "opens" the rows to make room for a new one while
Harbour's tbrowse shows the first row duplicated.

best regards,
Lorenzo
#include "inkey.ch"

procedure Main()

local oBrowse, lEnd := .f., nKey

cls

use test alias test
set filter to recno() < 3

oBrowse := TBrowseDB( 2, 30, 12, 70 )

oBrowse:AddColumn(tbColumnNew("Last Name",{||test->first}))
oBrowse:AddColumn(tbColumnNew("First Name",{||test->last}))
oBrowse:AddColumn(tbColumnNew("Street",{||test->street}))

oBrowse:Freeze := 1

While !lEnd

      dispbegin()

      oBrowse:ForceStable()

      dispend()

      nKey = InKey( 0 )

      do case
         case nKey == K_ESC
              lEnd = .t.

         case nKey == K_DOWN
              oBrowse:Down()

         case nKey == K_UP
              oBrowse:Up()

         case nKey == K_LEFT
              oBrowse:colpos--

         case nKey == K_RIGHT
              oBrowse:colpos++

         case nKey = K_PGDN
              oBrowse:pageDown()

         case nKey = K_PGUP
              oBrowse:pageUp()

         case nKey = K_CTRL_PGUP
              oBrowse:goTop()

         case nKey = K_CTRL_PGDN
              oBrowse:goBottom()

         case nKey = K_HOME
              oBrowse:home()

         case nKey = K_END
              oBrowse:end()

         case nKey = K_CTRL_LEFT
              oBrowse:panLeft()

         case nKey = K_CTRL_RIGHT
              oBrowse:panRight()

         case nKey = K_CTRL_HOME
              oBrowse:panHome()

         case nKey = K_CTRL_END
              oBrowse:panEnd()

         case nKey = K_CTRL_INS
              oBrowse:RefreshCurrent()
              oBrowse:down()
              dbgoto( 1 )
              TAB_INS( oBrowse )
              inkey( 2 )
              oBrowse:RefreshAll()

      endcase

      oBrowse:refreshCurrent()

   end

return

//********************************************************************
//
//     TAB_INS()
//
//********************************************************************
//
function TAB_INS( oTBrowse )

   local nScrTop
   local nScrLeft
   local nScrRight
   local nScrBottom

   oTBrowse:deHilite()

   if ( oTBrowse:RowPos == oTBrowse:RowCount )

      nScrTop  = 3
      nScrLeft = oTBrowse:nLeft

      nScrBottom = 3 + oTBrowse:RowPos - 1
      nScrRight = oTBrowse:nRight

      scroll( nScrTop, ;
              nScrLeft, ;
              nScrBottom, ;
              nScrRight, 1 ) // Scroll up

   else

      oTBrowse:Down()

      nScrTop  = 3 + oTBrowse:RowPos
      nScrLeft = oTBrowse:nLeft

      nScrBottom = 3 + oTBrowse:RowCount - 1
      nScrRight = oTBrowse:nRight

      scroll( nScrTop, ;
              nScrLeft, ;
              nScrBottom, ;
              nScrRight, -1 ) // Scroll down

   endif

   oTBrowse:colpos := 1

   dispbegin()

   // This runs ok. Leave it in this way 31-Oct-1993

   oTBrowse:RefreshCurrent()

   oTBrowse:ForceStable()

   dbgoto( lastrec() + 1 )

   oTBrowse:RefreshCurrent()

   oTBrowse:ForceStable()

   dispend()

   return .t.

_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to