FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse drag and drop
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Xbrowse drag and drop
Posted: Wed Feb 25, 2015 07:54 PM
Dear Nages only you can hel me !!!!

I have a big xbrowse you Know with 64 columns as you can see on this picture ( a piece) :





the final user ask me if is possible to drag a value of a cell and move it into another cell and save the result ...

how I can make it ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Xbrowse drag and drop
Posted: Fri Feb 27, 2015 03:48 PM
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse drag and drop
Posted: Sat Feb 28, 2015 12:13 AM
Code (fw): Select all Collapse
function xbr_array_dragdrop

   local oDlg, oFont, oBrw, oDragCur
   local aData[30,26]
   local i, j

   for i := 1 to Len( aData )
      for j := 1 to Len( aData[ i ] )
         aData[ i, j ] := HB_RandomInt( 10,99 )
      next j
   next i

   DEFINE CURSOR oDragCur DRAG
   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
   DEFINE DIALOG oDlg SIZE 790,400 PIXEL FONT oFont

   @ 10,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
      DATASOURCE aData AUTOCOLS CELL LINES NOBORDER

   WITH OBJECT oBrw
      :nWidths       := 40
      //
      :oDragCursor   := oDragCur
      :bDragBegin    := { |r,c,f,o| SetDropInfo( o:SelectedCol():Value ) }
      :bDropOver     := { |u,r,c,f| oBrw:SetPos( r, c, .t. ), oBrw:SelectedCol():VarPut( u ) }
      //
      :CreateFromCode()
   END

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oFont

return nil
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Xbrowse drag and drop
Posted: Mon Mar 02, 2015 12:47 PM

thanks Mr Nages,
I wish ... if the user move a value of a cell A into Cell b then the value of cell B must go to cell A...is possible ?
and How I can save all datas ?
I have a array but I read a dbf...

I saw also if I use this command

oApp():oGrid:aCols[ nI ]:bToolTip := { | brw,r,c,f,oMouseCol,nMouseRow| MyColToolTip( brw,r,c,f,oMouseCol,nMouseRow ) }

then the drag and drop not run !!

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion