FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Drag and Drop
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Drag and Drop

Posted: Mon Jan 25, 2016 09:14 AM
Hi,

I use Fwh 15.07 and harbour 3.2.0dev(r1506171039) and msvc 2013.

I have tried testdrop.prg in sample directory. And there is no problem. It works.


I have tried in my application like this. First of all, I use in DIALOG.


Code (fw): Select all Collapse
  @ 60, 10 LISTBOX oLbx2 var cItem OF oDlg PIXEL;
      ITEMS {} size 60,60   
    oLbx2:bDropOver = { | uDropInfo, nRow, nCol, nKeyFlags | ;
                      IICBELGE_Drag( uDropInfo ), MsgBeep() }


FUNCTION IICBELGE_Drag(aFiles)
   ? "I AM HERE"
RETURN


I can compile my app with above lines. But When I drag and drop a file to mt LISTBOX. There is no "I AM HERE" message.

Is there a way to activate drag and drop facilities in application.

Thanks
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM

Re: Drag and Drop

Posted: Mon Jan 25, 2016 03:01 PM

bDropOver and bDragBegin are meant only for drag and drop within FWH application.

For dropping files from file explorer over to FWH application you need to use DROFILES clause while activating the main window.

For both you can refer to fwh samples folder.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: Drag and Drop

Posted: Mon Jan 25, 2016 04:12 PM

Thank you Mr. Rao,

My main window is TWindow. But I like to use it within TDialog.

Is it possible?. DROPFILES is available only for TWINDOW.

Thanks

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM

Re: Drag and Drop

Posted: Mon Jan 25, 2016 09:04 PM
In Fivedit, I have implemented it so ( folderex with dialogs )

Code (fw): Select all Collapse
   // ::oEditor is a Control TScintilla derived from TControl

   DragAcceptFiles( ::oEditor:hWnd, .T. )
   ::oEditor:oDragCursor  := oCrs
   ::oEditor:bDropFiles   := { | nRow, nCol, uDropInfo | ;
                                 Self:SetDropFiles( nRow, nCol, uDropInfo ) }
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM

Re: Drag and Drop

Posted: Tue Jan 26, 2016 07:23 AM
Thank you Mr. Navarro.

I put these line to ONINIT Procedure. It worked.

Code (fw): Select all Collapse
    DragAcceptFiles( oDlg:hWnd, .T. )
    oDlg:oDragCursor    := oCrs
    oDlg:bDropFiles:={|nRow,nCol,uDropInfo|IICBELGE_Drag(nRow,nCol,uDropInfo)}
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06

Continue the discussion