transferring a module from one project to another

This forum is meant for questions and discussions about the X# language and tools
Komar
Posts: 13
Joined: Tue Sep 29, 2015 9:24 am
Location: Ukraine

transferring a module from one project to another

Post by Komar »

Hi all
In the project XIDE, when you right-click the mouse, it is possible to export the module to '.VIMEF', but I have not found anywhere how to import it. Please tell me how to transfer a module from one project to another.
User avatar
wriedmann
Posts: 3690
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: transferring a module from one project to another

Post by wriedmann »

Hi Komar,
I have searched now to, and could not find anything.
To not stop your work: cou can copy the prg file simply from one project folder to another one, and then use the "Add" menu choice to add that file to your project. I'm doing that very often.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Komar
Posts: 13
Joined: Tue Sep 29, 2015 9:24 am
Location: Ukraine

Re: transferring a module from one project to another

Post by Komar »

Wolfgang, thanks for the advice. Of course, I saw how to add a '.prg' file to the project. However, I was hoping for a hint: how to add the entire module, together with the window designer object or menu editor.
User avatar
wriedmann
Posts: 3690
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: transferring a module from one project to another

Post by wriedmann »

Hi Komar,
if you copy also the .wed file, it is automatically added.
And then you can add a designer.prg file with the option in the context menu.
I'm doing that very often when copying windows or tab pages in the same application.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4664
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: transferring a module from one project to another

Post by Chris »

Guys,

Sorry, thsi is indeed not very intuitive, but in order to import a module, you need to select Create New File, then in the new file dialog choose the button at the left bottom, "Load Template". Then pick the exported module and select it.

Now that I am thinking about it, I have no idea why I implemented it in such a complicated way... :)
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Komar
Posts: 13
Joined: Tue Sep 29, 2015 9:24 am
Location: Ukraine

Re: transferring a module from one project to another

Post by Komar »

Chris, thank you. Everything worked out. It's impossible to guess on your own.
User avatar
wriedmann
Posts: 3690
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: transferring a module from one project to another

Post by wriedmann »

Hi Chris,
if you are thinking about a better possibility to handle the import of a module, a function to duplicate an existent module would be very helpful and a timesaver.
As I described before in this thread, currently I'm working around be copying files around and renaming them.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Komar
Posts: 13
Joined: Tue Sep 29, 2015 9:24 am
Location: Ukraine

Re: transferring a module from one project to another

Post by Komar »

Wolfgang, thank you. The method you suggested for adding a module to a project works and is simpler than using '.VIMEF'.
User avatar
Chris
Posts: 4664
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: transferring a module from one project to another

Post by Chris »

Hi Wolfgang,
wriedmann wrote: Fri Nov 03, 2023 5:16 pm
if you are thinking about a better possibility to handle the import of a module, a function to duplicate an existent module would be very helpful and a timesaver.
As I described before in this thread, currently I'm working around be copying files around and renaming them.
This sounds like a very good idea for a plugin :)

Seriously, I think it's better if you just implement this functionality in your plugin, as you can make it work exactly as you like this way...And then share your plugin so others can use it as well (I am still using yours for opening the Bin folder of a project!). But if you prefer, I can implement it in base XIDE as well, just please let me know exactly how you want it to work, should it just create another file, like file2.prg in the same folder as the source file and add it to the same app?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3690
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: transferring a module from one project to another

Post by wriedmann »

Hi Chris,
of course I can add it to a plugin.... but I think it would be better to have it in the core version of XIDE (or, if you think is it better, I can write it in a plugin and you can deliver that with XIDE).
IMHO the best way would be to implement it in the right click menu in the project treeview as "duplicate module" and then either ask for the new name, or simply add it with a " (2)" behind the name like the Windows Explorer does. Then the user/programmer could rename it and move it to the target folder.
It seems to be relatively easy, and could save time (specially when working on Windows Forms forms or VO style Windows).
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Post Reply