Drag and Drop

Drag and Drop

Postby Horizon » Mon Jan 25, 2016 9: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: Select all  Expand view
 @ 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.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: Drag and Drop

Postby nageswaragunupudi » Mon Jan 25, 2016 3: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Drag and Drop

Postby Horizon » Mon Jan 25, 2016 4: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.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: Drag and Drop

Postby cnavarro » Mon Jan 25, 2016 9:04 pm

In Fivedit, I have implemented it so ( folderex with dialogs )

Code: Select all  Expand view


   // ::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
User avatar
cnavarro
 
Posts: 6500
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Drag and Drop

Postby Horizon » Tue Jan 26, 2016 7:23 am

Thank you Mr. Navarro.

I put these line to ONINIT Procedure. It worked.

Code: Select all  Expand view
    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.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Rick Lipkin and 81 guests