Scroll the Local and Remote List Views During Drag & Drop

Moderator: Project members

Post Reply
Message
Author
tateu
450 Internal Error
Posts: 38
Joined: 2004-11-13 01:19

Scroll the Local and Remote List Views During Drag & Drop

#1 Post by tateu » 2012-03-23 21:10

Here is a patch that allows the local and remote file list views to scroll up when you a drag a file over the top item in the list and scroll down when you drag a file over the bottom item in the list.
Attachments
filezilla-3.5.3_Drag_Drop_Scroll_List_View01a.diff.txt
(2.51 KiB) Downloaded 235 times

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Scroll the Local and Remote List Views During Drag & Dro

#2 Post by botg » 2012-03-24 11:15

Thanks. While I like the general idea, the Sleep(50) is unacceptable. Please use a timer if you need to delay things.

Also, would it be possible to move the common code into listctrlex.cpp?

tateu
450 Internal Error
Posts: 38
Joined: 2004-11-13 01:19

Re: Scroll the Local and Remote List Views During Drag & Dro

#3 Post by tateu » 2012-03-24 20:52

Maybe more like this?
Attachments
FileZilla_3.5.3_Drag_Drop_Scroll_List_View01b.diff.txt
(3.16 KiB) Downloaded 233 times

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Scroll the Local and Remote List Views During Drag & Dro

#4 Post by botg » 2012-04-01 08:37

Thanks, it's in the repository now.

I've made a couple of changes so that it works without remembering the exact item, as the list might change underneath while doing a drag&drop operation, e.g. as result of a successful transfer. Also refactored the code into a new class so that it can be easily adapted to scroll the directory trees as well.

tateu
450 Internal Error
Posts: 38
Joined: 2004-11-13 01:19

Re: Scroll the Local and Remote List Views During Drag & Dro

#5 Post by tateu » 2012-04-02 21:42

Directory trees seem to be a little bit harder since they can be expanded or collapsed. I think I have scroll down working but I need to add one more looping function call on scroll up to get the last child of the previous sibling.

Although it seems to be almost working, I don't think the code is going to be as efficiently written as you will want.

tateu
450 Internal Error
Posts: 38
Joined: 2004-11-13 01:19

Re: Scroll the Local and Remote List Views During Drag & Dro

#6 Post by tateu » 2012-04-03 21:16

So, this seems to get the job done: scrolls both the remote and local tree views during drag & drop.
Attachments
FileZilla_3.5.3.0_Drag_Drop_Scroll_Tree_View01a.diff.txt
(9.9 KiB) Downloaded 225 times

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Scroll the Local and Remote List Views During Drag & Dro

#7 Post by botg » 2012-04-03 22:09

Thanks, looking promising. One further request though: There's lots of similar logic between the drop targets for lists and trees. Would it be possible to move the common functionality into a common base class?

Also, there's something in the patch that tells me that you didn't try it under a non-Windows system.

Post Reply