Jump to content
Sign in to follow this  
Der schöne Günther

Can MMX move a class to another unit?

Recommended Posts

The IDE offers to relocate a class to another unit by right-clicking under "Refactoring" but - surprise! - it never works.

 

Does MMX have this feature? I see it has elaborate ways to add to an existing class or even move things around within the class declaration. But so far, I have not been able to find anything that allows me to move a class (declaration and implementation) to another unit. Is that correct?

Edited by Der schöne Günther

Share this post


Link to post

You can use C&P from unit to unit in the mmx-explorer. And after all a delete in the mmx-explorer for the old unit.

Edited by Jasocul

Share this post


Link to post

Select the class declaration (either in the MMX tab or in the editor) and then do a simple right click - MMX commands - Clipboard - Cut entity (in the source unit), then go to the target unit and perform MMX Commands - Clipboard - Paste entity.

Share this post


Link to post
On 10/30/2018 at 1:45 PM, Alexander Elagin said:

Select the class declaration (either in the MMX tab or in the editor) and then do a simple right click - MMX commands - Clipboard - Cut entity (in the source unit), then go to the target unit and perform MMX Commands - Clipboard - Paste entity.

Will all code which used the entity also be updated automatically?

Share this post


Link to post

For example, some third unit3 used TClass1 from the unit1 from which we moving TClass1 to unit2. In order to keep the code correct we need to update unit3 accordingly.

Edited by Georgge Bakh

Share this post


Link to post
12 minutes ago, Georgge Bakh said:

For example, some third unit3 used TClass1 from the unit1 from which we moving TClass1 to unit2. In order to keep the code correct we need to update unit3 accordingly.

No, you have to add unit2 to the uses clause of unit3 manually. You might also be able to remove unit1 from the uses clause.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×