# 2.9.4 Layers Dialog

Each object is contained in a layer. Objects which are created independently of other objects (such as straight tracks (Section 2.1.6) or text (Section 2.3.7)) are created in the current layer. Objects which are associated with other objects (such as tracks created by the Modify (Section 2.2.7) or Join (Section 2.2.6) commands) are created in the same layer as the associated object(s).

The Layers dialog allows you to change various attributes of each of the 99 possible layers.

Attributes associated with a layout are stored within the associated layout file and apply only to the layout that's open at the time of a change. It is possible to apply attributes from one layout file to another using the Load and Save buttons.

The drop down list at the top of the dialog selects the Layer you are interested in. Non-empty layers are preceded by a `+`.

The Name edit box contains the name of the Layer. This name is listed in the Current Layer drop down list on the Tool-bar (Section 3.1). Also the Name is displayed as the balloon help for the corresponding Layer Button.

The Color button specifies the color of tracks if Color Layers (Section 2.10.3) radio button on the Display dialog is checked.

The Visible check-box controls whether the Layer is drawn on the Main (Section 3.1) window.

The Frozen check-box indicates that tracks in that Layer can not be modified or deleted.

The On Map check-box controls whether the Layer is drawn on the Map (Section 3.2.2) window.

You cannot uncheck Visible or check Frozen for the Current Layer.

The Count field displays the number of objects in the selected Layer.

The Save button stores layer attributes in the `xtrkcad.ini` file so they may be loaded into an existing or new file. Once saved and unless reset to XTrackCAD Default, modified layer information is applied to each new file.

The Load button reads layer attributes from the `xtrkcad.ini` file then applies it to each layer of the current layout file.

The Defaults button restores layer attributes to default XTrackCAD settings.

The bottom of the dialog contains the Number of Layer Buttons integer edit box. This controls the number of Layer Buttons displayed on the Tool-bar (Section 3.1). These buttons make it easy to switch between layers. The maximum number of Layer Buttons that can be displayed is 20. Therefore you should use layers one to twenty for objects which you will be showing and hiding frequently.

The Layer Buttons on the Tool-bar (Section 3.1) control which layer is the current Layer and which Layers are displayed on the Main Canvas. These buttons are a short cut for the Visible check-box on the Layers dialog for the corresponding layer.

The current layer is selected by picking a value from the drop down layer list. If the Layer you've selected was not visible, it will be shown.

You can hide (or show if not visible) the different layers by pushing one of the Layer Buttons on the Tool-bar (if you have configured the tool-bar (Section 2.12.2) to show the Layer buttons). If a layer is not visible then the corresponding layer button will be raised. The active or current layer cannot be hidden.

The color of each layer button shows the color that will be used to draw tracks in that layer, if you select Color Layers (Section 2.10.3) on the Display dialog.

Any selected objects are unselected when the Layer is set to not visible. If a layer is not visible, you cannot select objects in the Layer. It is as if the objects do not exist until you show the layer again.

The Move To Current Layer command on Edit menu (Section 2.4) will move all selected (Section 2.2.14) tracks to the current Layer.

Objects are drawn on the map window, if the Layer they are on has On Map checked.