Menu

#1169 Request feature - dragging files to management folders and virtual folders

Undefined
fixed
Feature_Request
2022-01-20
2021-12-24
Elena
No

I would like to be able to drag files (sources and includes) directly from Windows into the various management folders and virtual folders to add them to a project, without having to add them manually by the apposite menu, and then removing them from the folder CB automatically places them in to place them in the folders or virtual folders I like. Thanks.

Discussion

  • bluehazzard

    bluehazzard - 2021-12-25

    And copy the file?
    Codeblocks folders (not virtual) are a representation of the local file system.
    So when you drag a file in codeblocks in a folder that does not represent the file system what should happen?

     
  • Elena

    Elena - 2021-12-25

    Imhho and following my logic, a file should never be copied when dragged to the management window. Dragging should have the same effect (in a more convenient way) as adding a file to the project. And when you add a file to the project it is not phIsically copied to the project folder... that also happens frequently to files external to the project dir and which are not meant to be copied like headers or sources of an extrrnal sdk or library. And with files internal to the project folder it often happens you have to create a new header or source by copying/pasting an existing one in Windows, then you want to add it to your project... and dragging it to the preferred folder or virtual folder is definitely handier than using the menu "add files to project" and then drag it/them from the default folder to the desired place

     
  • bluehazzard

    bluehazzard - 2022-01-05

    Should the drop target be a specific folder in the tree control? Or generally when you drop a file in the project manager pane it should be added to the current active project?

    I looked into this, and from my point of view it is quite difficult to create a drop target on a tree control item in wxWidgets. It has to be done by hand as far as i can see.
    It is not difficult to drop a file to the whole control, just on one specific entry it is difficult,

     
  • Elena

    Elena - 2022-01-06

    It would have been very handy to allow dropping to a specific virtual folder. But if it really can't be done, even just dropping to the current project would be better than nothing. One then shall drag the file manually from the default folder where CB places it to the desired place.
    Please also check that other annoyance I mentioned here... while dragging a file in the management window, if you hover by mistake on the editor area, the mouse pointer changes to a forbidden state but it does not get back to normal when you return to the management window, therefore you have to repeat the dragging. Try playing with it a bit, you will surely notice what I am referring to. Thanks

     
  • bluehazzard

    bluehazzard - 2022-01-07

    This is a first patch for adding drag and drop support in two cases:
    1) if a file is d&d to the project tree the files are added to the current project
    2) if a file is d&d in the editor ctrl a new editor is opened. At the moment it is not possible to drop files in the editor

    about the drag and drop bug where dragging a file in the virtual folder, moving in the editor and back i am working on it...

    comments?

     
  • bluehazzard

    bluehazzard - 2022-01-07
    • assigned_to: bluehazzard
     
  • Elena

    Elena - 2022-01-07

    Thanks Bluehazzard! Unfortunately I am outdoors now, I will try the patch tomorrow and will let you know...

     
  • bluehazzard

    bluehazzard - 2022-01-08

    Just one comment for future me:
    use treectrl as drop target not notebook ctrl...

     
  • bluehazzard

    bluehazzard - 2022-01-08

    I just realised, my changes for dropping files to editor break dragging text in the editor too :/

     
  • bluehazzard

    bluehazzard - 2022-01-09

    This patch should fix the drag and drop error when dragging objects outside the tree and then back in, and also the text dragging bug introduced with the other patch.

    Letting objects drag directly to virtual folders is quite difficult to implement at the moment...

    @other devs: Any comments? D&D code is not really well documented in wxWidgets...

    [edit:] untested in linux and osx
    osx can probably lead to problems here....

     

    Last edit: bluehazzard 2022-01-09
  • Elena

    Elena - 2022-01-09

    Thx Bluehazzard, sadly I am still outdoors but I will try it once I am back home.
    Btw, which is the simplest way to apply a .patch under windows ? Sorry lol but it is something I never did ;)

     
  • bluehazzard

    bluehazzard - 2022-01-09

    You will have to compile codeblocks by yourself, not an "easy" task.

    If you can compile cb by yourself, then you can use tortoirsvn to apply the patch

    I would probably wait until the next nightly. I will apply the patch as soon to trunk and then a nightly will be made. I just want to wait if some other dev has some ideas about this.

     
  • Elena

    Elena - 2022-01-10

    Ah ok sorry I thought it was a patch to the executable! I will wait for the next nighly build, there is no hurry !

     
  • bluehazzard

    bluehazzard - 2022-01-14

    Just to give some update, i tested this on linux and found some problems... Still need more investigation why it does not work there...

     
  • Elena

    Elena - 2022-01-14

    Sorry BlueHazzard for having caused so much of troubles with my request and thanks for your efforts. Well maybe you are facing some unexpected bugs with wxwidgets which would have never been discovered otherwise...

     
  • bluehazzard

    bluehazzard - 2022-01-17

    I added the fix to [r12660]

    it should be available in the next nightly

    Adding files to a specific project would probably be possible now...
    I will look into it, after some time has gone with testing the current implementation.

     

    Related

    Commit: [r12660]

  • bluehazzard

    bluehazzard - 2022-01-20
    • labels: --> projectTree, dnd
    • status: open --> fixed
     
  • bluehazzard

    bluehazzard - 2022-01-20

    fixed and all implemented in [r12665]

     

    Related

    Commit: [r12665]


Log in to post a comment.