Invalid path message when dropping a file on Separate Tree

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Invalid path message when dropping a file on Separate Tree

Post by *ts4242 »

To reproduce:
1. Show separate tree
2. Drag a file to any folder that has some subfolders
3. Press <Enter> or <Space> to expand. (Be sure that the mouse cursor remains above the same folder after expanding it)
4. Drop the file.
A message box popup says "The given target path ? is invalid!" after pressing OK, the folder remains highlighted until the next drag operation

Another way to reproduce:
1. Show separate tree
2. Drag a file to an already expanded folder or to a folder that has not any subfolders.
3. Press <Enter> or <Space>
4. Drop the file.

TC 7.02a/ Win XP sp2
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed you must move the mouse cursor after pressing space or Enter, the target item is cleared when you press space or enter for security reasons until the mouse is moved again. This is done because by expanding the tree the top item and therefore the item under the mouse cursor can change (e.g. when expanding a directory near the bottom of the panel, or with many subdirs).
Author of Total Commander
https://www.ghisler.com
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

ghisler(Author) wrote:Indeed you must move the mouse cursor after pressing space or Enter,
I noticed that too, moving mouse cursor just one pixel solve the problem therefore i have two suggestions:
1. After pressing <Enter> key, auto move the mouse cursor some pixels to left then back it again to the original position, by this way the folder under the cursor will auto highlighted

2. After pressing <Enter> key, auto center the mouse cursor above the target folder (as you did when expanding folder by double click)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Keeping the target on the previously selected file or moving it to the one which is now under the cursor would be no problem at all, but I'm not doing this because I think that it's too risky! The user may assume that the other file now has the focus, and drop the files on the wrong one...
Author of Total Commander
https://www.ghisler.com
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

ghisler(Author) wrote:Keeping the target on the previously selected file or moving it to the one which is now under the cursor would be no problem at all, but I'm not doing this because I think that it's too risky!
There is no risky at all as far as the target folder is always highlighted.
The first suggestion is better and easy to implement, with VB just 3 lines of code

Code: Select all

GetCursorPos Point
SetCursorPos Point.X - 1, Point.Y
SetCursorPos Point.X, Point.Y
for test purpose, I made a program run in the background using above code inside a timer procedure and the problem is solved
Please give it try
Post Reply