Merge modules

You may add a new module to an existing module, but how may I aggregate an already existing module to a new one?
Dragging don’t seem to work.

Copy and paste is your friend.

Copy and Paste don’t seem to work

Copy and paste of multiple items is a bit tricky in Xojo.

  • You need to make sure that you have a blue and not a grey background when doing the copy. The blue means that the method is selected and the method is not in edit mode. Which would be the grey background.
  • For whatever reason you can mostly do the paste only when you already have a method or a property. Make an empty method and then do the paste.

??? what do you mean

I see that if the module I want to copy is empty then I’m able to add it to an already existing module, but if it has something defined (like a property) it refuses to be inserted.

I tried to inserting an empty module and then copy the items from my module one by one ( methods, properties…) but then when Analize project I get the error:
SQLModules contains MainSql, but this is not supported.

If you have a grey background and try to copy then you get a beep:

You need to have a blue background and then you can copy:

But I think you have a different problem. Can you post your module somewhere?

I do not know how to get the blue background I never saw it before. and I’m able to copy items, classes and modules from one project to another…

But I make the following:
Create a new module: module1
Select the module1, add a new module: OK, module2 is in module1
UnSelect all, create new module: module3 is create.
Drag module3 to modules inside module1: ok
UnSelect all create new module: module4
add a property to module4: ID as integer (for example)
then you cannot drag the module4 inside the module anymore

link text

Click an item in the left column. Then click it again.

I see the difference, in my computer it changes from light gray to a little more dark gray.
Either way I’m not able to copy in another Module.

Has it was only for cleaning, I’ll use a folder and put inside the modules.

You are copying one module INTO another. And then you run into a namespace problem. That’s something totally different than you described in the beginning.

@Enric: what is the background color of a selected word in Xojo’s Code Editor ?

A good explanation of the actual difference between and the purposes of the “lightly selected” and “strongly selected” states of an item in the navigation pane would be favourite.

Yes Beatrix you’re right, as I’ve never changed this preference and as default the difference is from light to less dark gay I did be aware of the difference. In either case I’m able to copy and paste items from to objects.

Either way I cannot copy or drag an existing module (with items) inside another one. As it was a just a cleaning purpose I’ll create a folder and put those In/Out modules inside.

I never changed this and I see that there is little difference.

It is blue by default in macOS. Linux and Windows: I forgot.


Grey: in code edition mode
Blue *: Object is selected.

  • Or any color you set the selection color to. Some people change that color from another to some fancy color.


Why is it important ? You may be able to copy in Grey mode, but in Blue mode, you copy and paste the whole selection(s), not just the selected word(s).

Make some tries.

[quote=444728:@Emile Schwarz]It is blue by default in macOS. Linux and Windows: I forgot.


Grey: in code edition mode[/quote]

Grey appears to be not just for code editing mode. It seems to be for editing anything. I selected a control in the navigation pane: blue. I then click on the control itself: grey.

The original question was: It’s possible to copy a module (not empty) INTO another module?

Whatever works for you

Here, if the Event is grey and no code is selected, using Copy do nothing.

Of course, If you are searching on the menus or ContextualMenu, your experience may vary.

In Code Editor, if you select all and copy (while in Grey mode), you copy the Code.
If you are in Blue mode, you get the Event Name and parameter(s) / and End <something> at the bottom.

But who am I to write those ?

Get an eye on the on line LR to get the definitive words from the creators:

at last this have two videos included:

And the answer is yes: use two clicks and Copy.

Well, this do not work in my IDE