Error in last xBrowse with :bDropOver - Solved

Post Reply
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Error in last xBrowse with :bDropOver - Solved

Post by Maurizio »

Hello
I have this error

Code: Select all

Time from start: 0 hours 0 mins 2 secs 
   Error occurred at: 08/07/20, 16:50:52
   Error description: Error BASE/1074  Argument error: <=
   Args:
     [   1] = U   
     [   2] = N   0

Stack Calls
===========
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:LBUTTONUP( 4868 )
   Called from: x_move.prg => (b)MAIN( 25 )
   Called from: .\source\classes\WINDOW.PRG => TXBROWSE:DROPOVER( 3490 )
   Called from:  => TWINDOW:HANDLEEVENT( 0 )
this is the source

Code: Select all

#include "fivewin.ch"
#include "xbrowse.ch"

function main()

   local oDlg, oBrw, oFont, oCur, aData[ 12 ]

   AEval( aData, { |u,i| aData[ i ] := NtoCMonth( i ) } )

   DEFINE CURSOR oCur DRAG
   DEFINE FONT oFont NAME "VERDANA" SIZE 0,-16
   DEFINE DIALOG oDlg SIZE 250,500 PIXEL FONT oFont
   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE aData COLUMNS 1 CELL LINES NOBORDER

   WITH OBJECT oBrw
      :nStretchCol      := 1
      :oDragCursor      := oCur
      :bDragBegin       := { |r,c,f,o| SetDropInfo( { oBrw:nArrayAt, oBrw:aRow } ) }
      :bDropOver        := { |u,r,c,f| oBrw:LButtonDown( r,c ), ;
                                       oBrw:LButtonUp(), ;
                                       aDel( aData, u[ 1 ] ), ;
                                       AIns( aData, oBrw:nArrayAt, u[ 2 ] ), ;
                                       oBrw:Refresh() }

      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont
   RELEASE CURSOR oCur

return nil
 
Maurizio
User avatar
Maurizio
Posts: 705
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Error in last xBrowse with :bDropOver - Solved

Post by Maurizio »

solved
with the new version it is necessary to have in r and c
oBrw:LButtonUp(r,c)

Maurizio
Post Reply