Error in last xBrowse with :bDropOver - Solved

Error in last xBrowse with :bDropOver - Solved

Postby Maurizio » Fri Aug 07, 2020 2:54 pm

Hello
I have this error
Code: Select all  Expand view  RUN
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  Expand view  RUN

#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: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: Error in last xBrowse with :bDropOver - Solved

Postby Maurizio » Fri Aug 07, 2020 3:17 pm

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

Maurizio
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests