Author Topic: The 29 April 2018 build (11386) is out.  (Read 7266 times)

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1920
Re: The 29 April 2018 build (11386) is out.
« Reply #30 on: May 15, 2018, 01:13:10 am »
I have investigated future about the drag and drop thing. In my opinion this should be implemented the right way (implement proper Drag Objects for project files ecc.), but this is tons of work. I can try to do it but first i want to know if the implementation for the fix i suggested a few posts above is really a problem (also on other platforms like mac or unix)

Offline Xaviou

  • Regular
  • ***
  • Posts: 276
    • X@v's wxStuff
Re: The 29 April 2018 build (11386) is out.
« Reply #31 on: May 15, 2018, 02:35:34 pm »
Hi
I can try to do it but first i want to know if the implementation for the fix i suggested a few posts above is really a problem (also on other platforms like mac or unix)
I've tested (OS-X and Windows) : it is not really a problem if you know how it works (especially on OS-X where the "forbidden" icon isn't shown).
But it is really an unusual behavior and I think it shouldn't stay "as is".

Regards
Xav'
The french wxWidgets site : http://www.wxdev.fr
My wxWidgets's stuff : https://wxstuff.xaviou.fr/

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2101
Re: The 29 April 2018 build (11386) is out.
« Reply #32 on: May 24, 2018, 05:32:33 pm »
I have temporary disabled external drag and drop from projectmanagerui.
External drag and drop is incompatible with wxTreeCtrl internal use of drag and drop.

We can use one or the other, but not both in a wxTreeCtrl.

This means that the Snippets plugin will not be able to drag items out of the project tree. However, it can copy and paste them.

I will look for or create a solution that allows external drag and drop from a wx tree control.

This should fix the issue

Code: [Select]
diff --git a/src/src/projectmanagerui.cpp b/src/src/projectmanagerui.cpp
index cbd93a6fe..6ca7d0926 100644
--- a/src/src/projectmanagerui.cpp
+++ b/src/src/projectmanagerui.cpp
@@ -977,11 +977,8 @@ void ProjectManagerUI::OnTreeBeginDrag(wxTreeEvent& event)
         wxDropSource dragSource(m_pTree);
         dragSource.SetData(dropObject);
         dragSource.DoDragDrop();
-        // we disallow the drag of files within the project tree
-        return;
     }
-
-    // allowed
+    // Allow drag and drop within the project tree
     event.Allow();
 }

On windows the handling is somehow bugged: If you drag a file the "forbidden" cursor will be shown as long as you hold the mouse button. As soon you release the button the normal "drag&drop" cursor will appear and drag and drop is possible...
It works, but i still will look further...

Offline BlueHazzard

  • Lives here!
  • ****
  • Posts: 1920
Re: The 29 April 2018 build (11386) is out.
« Reply #33 on: May 24, 2018, 08:04:27 pm »
Quote
I have temporary disabled external drag and drop from projectmanagerui.
External drag and drop is incompatible with wxTreeCtrl internal use of drag and drop.
We can use one or the other, but not both in a wxTreeCtrl.

i have started to work on a implementation with dedicated drag and drop objects, but this is a lot work because the whole logic (moving files between virtual folders without the internal tree control api ecc....) has to be rewritten. And i have no time for this at the moment....

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2101
Re: The 29 April 2018 build (11386) is out.
« Reply #34 on: May 24, 2018, 09:55:08 pm »
I believe I've just solved this issue, but I want to test it for awhile.
I'll commit in a day or two.

Quote
I have temporary disabled external drag and drop from projectmanagerui.
External drag and drop is incompatible with wxTreeCtrl internal use of drag and drop.
We can use one or the other, but not both in a wxTreeCtrl.

i have started to work on a implementation with dedicated drag and drop objects, but this is a lot work because the whole logic (moving files between virtual folders without the internal tree control api ecc....) has to be rewritten. And i have no time for this at the moment....

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2101
Re: The 29 April 2018 build (11386) is out.
« Reply #35 on: May 28, 2018, 05:46:25 pm »
ProjectManagerUI external drag and drop fixed rev 11413