Change Order of Layers

Can anyone help with changing the order in which layers appear in the tab on the left hand side?

@Lazza I do not see any way to rearrange the order in the docs:

Using Layers

Why do you need to reorder them? If you provide more info, maybe there is some other way to achieve your goal.

Hi beppe,

Thanks for your reply.

I have also checked the documentation and can't find anything.

I am a long term user of AB and have quite a few layers which are ordered and have been for quite some time. I have recently added some more layers and would like to place them with others for ease of use.

I have a feeling that there was a way to order the display of the layers in the window but it is quite some time a go since I needed to do so and have forgotten how o do it (if it is possible).

I have added a screenshot.

image

@Lazza, in the main directory of the AmiBroker application there is a plain text file named broker.layers.
This is the kind of file that is automatically updated by the application when you change your layers configuration.
So, normally, a user should not attempt to modify it directly but… with the application CLOSED (not running) you can try to edit it anyway with a text editor.
(Save a copy before to be sure to have a working backup copy in case you’ll do something wrong).
After the first 2 lines, each layer is defined in a block of 4 lines. Try to reorder these blocks and see if you achieve what you have in mind.
Worst case: restore the backup copy!

Thanks beppe.

Tried what you suggested and the position of the name changes in the tree but the drawings of the layer stay at the same place with the name shifted down e.g. S/R Monthly drawings are now S/R Weekly drawings because I pasted a layer higher than them in the broker.layers file.

@Lazza so it does not work (probably AB, for each drawing element, store a positional reference to associated layers).
I’m sorry for the poor suggestion.

Editing broker.layers file will change the names only, but won’t change the drawings because drawings use numbers not names and you won’t change the numerical value of layer. You would just mess things up as names would not sync with the original “meaning”.
The order of layers is the creation order. They appear in the order in which they were created.

But the order of layers DOES NOT control the order in which drawings are painted on screen. This is separately controlled by Z-order (property of drawing).

1 Like

No problem. Thanks for attempting.

1 Like

Thank you very much Tomasz.

EXCELLENT! Finding yet again something new (to me) in Amibroker! This may help me with something I had been wondering about awhile now so I look forward to experimenting this weekend.