Drag 'n' Drop support
Drag 'n' Drop support
Hello,
I am watching the drag'n'drop support in five win and have some notes:
* bDropOver receives the nRow and nCol relatives of sender control
* There is no callback for receiver during mouse move
In my application I am dropping in a list, and I want that the position in the list is based on mouse release position.
I want too draw a line where this new element will be placed.
Now it is not possible.
Regards,
Perry
I am watching the drag'n'drop support in five win and have some notes:
* bDropOver receives the nRow and nCol relatives of sender control
* There is no callback for receiver during mouse move
In my application I am dropping in a list, and I want that the position in the list is based on mouse release position.
I want too draw a line where this new element will be placed.
Now it is not possible.
Regards,
Perry
Re: Drag 'n' Drop support
Hello,
I modified fiveWin for a IMHO better support for drag'n'drop:
On window.prg
changed
in
On control.prg
Added:
Changed
In
in this way dropOver receives screen coordinate.
changed
in
and
in
In this way receiver has callbacks: bCanDrop on mouse move and decide if receive or not the callback and bDropOut when dropping going out.
I modified fiveWin for a IMHO better support for drag'n'drop:
On window.prg
changed
Code: Select all
DATA bCommNotify, bMenuSelect, bZip, bUnZip, bDropOver
Code: Select all
DATA bCommNotify, bMenuSelect, bZip, bUnZip, bDropOver, bCanDrop, bDropOut
Added:
Code: Select all
DATA oWndOldOver // DropOver destination window last mousemove
Code: Select all
SendMessage( WindowFromPoint( aPoint[ 2 ], aPoint[ 1 ] ),;
FM_DROPOVER, nKeyFlags, nMakeLong( nRow, nCol ) )
Code: Select all
SendMessage( WindowFromPoint( aPoint[ 2 ], aPoint[ 1 ] ),;
FM_DROPOVER, nKeyFlags, nMakeLong( aPoint[ 1 ], aPoint[ 2 ] ) )
changed
Code: Select all
local nOldRow, nOldCol, hOver, oWndOver, aPoint
Code: Select all
local nOldRow, nOldCol, hOver, oWndOver, aPoint, lCanDrop
Code: Select all
hOver = WindowFromPoint( aPoint[ 2 ], aPoint[ 1 ] )
if hOver == ::hWnd
SetCursor( ::oDragCursor:hCursor )
else
oWndOver = oWndFromHWnd( hOver )
if oWndOver == nil .or. oWndOver:bDropOver == nil
CursorNO()
else
SetCursor( ::oDragCursor:hCursor )
endif
endif
Code: Select all
hOver = WindowFromPoint( aPoint[ 2 ], aPoint[ 1 ] )
oWndOver = nil
lCanDrop := .T.
if hOver != ::hWnd
oWndOver = oWndFromHWnd( hOver )
if oWndOver == nil .or. ( oWndOver:bCanDrop == nil .and. oWndOver:bDropOver == nil )
lCanDrop := .F.
else
if oWndOver:bCanDrop != nil
lCanDrop := Eval( oWndOver:bCanDrop, aPoint[1], aPoint[2], nKeyFlags )
endif
endif
endif
if ::oWndOldOver!=nil .and. hOver != ::oWndOldOver:hWnd .and. ::oWndOldOver:bDropOut != nil
Eval( ::oWndOldOver:bDropOut, aPoint[1], aPoint[2], nKeyFlags )
ENDIF
::oWndOldOver := oWndOver
if lCanDrop
SetCursor( ::oDragCursor:hCursor )
else
CursorNO()
endif
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Drag 'n' Drop support
Antonino,
Many thanks!
have you checked if your changes are backwards compatible ?
Many thanks!
have you checked if your changes are backwards compatible ?
Re: Drag 'n' Drop support
Yes, I tried some samples by fivewin.
When i have time i will post an example with drag'n'drop with listview and insertionMark.
When i have time i will post an example with drag'n'drop with listview and insertionMark.
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Drag 'n' Drop support
Problem is backward compatibility.
All earlier software need to be modified
All earlier software need to be modified
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Drag 'n' Drop support
Hello,
I removed all my modifications on FiveWin code, put a good drag'n'drop support is too complicated.
In my program I do it in mouse events. In this way I have all control I need,
Regards,
Antonino Perricone
I removed all my modifications on FiveWin code, put a good drag'n'drop support is too complicated.
In my program I do it in mouse events. In this way I have all control I need,
Regards,
Antonino Perricone
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Drag 'n' Drop support
Antonino,
Thanks anyhow
Thanks anyhow
Re: Drag 'n' Drop support
AntoninoP wrote:Yes, I tried some samples by fivewin.
When i have time i will post an example with drag'n'drop with listview and insertionMark.
Regards, Greetings
Try FWH. You will enjoy it's simplicity and power.!
Try FWH. You will enjoy it's simplicity and power.!