### 5.6 Editing schematics ¶

In order to do any action on some object, you have to select it first. See Selecting objects if you don’t know how to do it.

When editing schematics, you can undo and redo several last actions using Edit → Undo (`Ctrl-Z`, `U`, `Shift-U`, or `E Shift-U`) and Edit → Redo (`Shift-Ctrl-Z`, `Ctrl-Y`, `Shift-R`, or `E Shift-R`). The latter restores the results of the last editing action undone with Edit → Undo. The number of possible actions for undo/redo is limited in the configuration setting undo-levels.

If you need to copy some objects, select them and do Edit → Copy Mode (`C` or `E C`). The objects will be visually duplicated and you will be able to put the copies where you need to by left-clicking on the canvas. This allows one-time copy of the objects. Another option is copying objects multiple times. Select Edit → Multiple Copy Mode or hit `E Y` to switch on the mode. Use left-click to insert the objects. Unlike the former case, copying won’t stop after first insertion. Click once again, and a new copy will be made. The copying process can be stopped by switching to some other mode, for example, by hitting `Esc` to choose the select mode, or by clicking at the net mode button in the toolbar. In both cases (one or multiple copies), the current selection does not change during the process.

The objects on canvas can also be copied or cut to clipboard, and pasted from it using Edit → Copy (`Ctrl-C`), Edit → Cut (`Ctrl-X`), Edit → Paste (`Ctrl-V`) correspondingly. To delete all currently selected objects use Edit → Delete (`Delete`, `D`, or `E D`). If some of the objects are locked, the dialog prompting for deletion of all selected objects or only unlocked ones will appear, in which you can also cancel the deletion.

You can move objects on the canvas using the left mouse button: click on the object you want to move, keep the button depressed, drag the object where you need to and release the button to place the object. The object gets selected after the operation. If you select several objects beforehand, the same operation allows you to move and place them all. Sometimes it is more convenient to switch on move mode to move objects without depressing the mouse button. Select Edit → Move Mode (`M` or `E M`) and move the selected objects where you want to, then use left click once to place them on the canvas.

Edit → Rotate 90 Mode (`E R`) rotates selected objects by 90 degrees counter-clockwise each time. The objects are rotated around the mouse cursor.

Edit → Mirror mode (`E I`) can be used to mirror objects such as components and pictures around the X axis. Mirroring of other, simple objects is supported as well, though it’s rarely useful. Mirroring around the Y axis is not yet supported. However, you can use a sequence of mirrorings and rotations as a workaround to get the look you want.

You can also rotate or mirror objects while moving them, using one of the ways described above, or when inserting a component.

Edit → Object Properties... (`E O`) opens a dialog where you can see and change the properties of primitives such as lines, boxes, pins, text and so on. The editable properties include color, stroke and filling styles, and the type of pins. Changing of a property affects all objects selected if they support it.

If docks are enabled in your configuration, the properties widget will be shown as the first tab in the right dock.

Edit → Rotate 90 Mode (`E R`) rotates selected objects by 90 degrees counter-clockwise each time. The objects are rotated around the mouse cursor.

You can also rotate or mirror objects while moving them, using one of the ways described above, or when inserting a component.

Apart from editing properties of primitive objects for which the Object Properties... dialog described above is used, you can edit text contents of text objects such as plain text and attributes. Use Edit → Edit... (`E E`) to start editing text objects. Depending on what objects are selected, one of the following dialogs will be opened. Edit Attributes dialog is opened for connectible objects which include components, pins, nets, and buses. For non-connectible graphical primitives such as lines, boxes, etc. the action does nothing. For plain attributes, the command opens the Edit Attribute dialog (please note the singular Attribute instead of plural Attributes in the former case). In the dialog you can select and change attribute names, values, and visibility. For plain text objects, the command opens the Edit Text dialog the same way as if you would use by Edit → Edit Text.... If selected objects include a mixed set of plain text objects, attributes, and connectible objects, the program opens the dialog appropriate for the objects selected first so you may end up with not what you really wanted. In such a case, deselect objects, select wanted ones, and try again.

The action Edit → Edit Text... (`E X`) and the Edit Text dialog box it invokes is intended for editing plain text objects. Thus, unlike the attribute editing dialogs, this dialog displays attributes as strings in the form “name=value”.

If docks are enabled in your configuration, the Edit Text widget will be shown as the second tab in the right dock.

Sometimes a symbol may represent components with different pin numbers without changing it in any other aspect. For example, quad-opamp has four same opamps in one package for which only pin numbers differ on schematic page. Such components are called slotted and there is a special action in `lepton-schematic` to change the slot number quickly. Use Edit → Slot... (`E Shift-S`) and enter the slot number you want. It should be greater than zero but not greater than the value stored in the “numslot” attribute of the symbol. While you can attach the “slot” attribute to any object on the page, slots are useless for graphical primitives, text, and pictures, and are only meaningful for such slotted components. While you can use the attribute for non-slotted components, it won’t add much to your schematics unless you change the component symbol to support slots by adding both “numslots” attribute and “slotdef” attributes which determine how many slots will be used at all and what pin numbers will be used for each particular slot.

Sometimes you want some objects on the page to not get in your way while editing schematics. It is particularly true for big symbols like title blocks (see Title block symbol). Such symbols are intentionally put to background and other symbols are placed over them. The issue here is the selection mechanism of `lepton-schematic`. When you click on an object to select it, and there are several selectable objects under the mouse cursor, the program will select each of them one by one to let you choose the wanted one. Locked symbols are to be excluded from such a sequence since it would be annoying to, say, every time select the title block symbol when you merely want to select any other object within it. Select symbols you want to be locked and use Edit → Lock (`E L`) to lock them. (By the way, you rarely need this for title blocks as they usually are added as already locked when a new schematic is created. See Title block symbol for more information.) In order to unlock a symbol, select it using box selection (see Box selection) and use Edit → Unlock (`E Shift-L`).

> Note: Locking and unlocking actions affect not only components but also all the attributes attached to them. You don’t have to select each one of them individually, it is sufficient to select just the component they are attached to.

> Note: Primitive objects (not components) cannot be locked or unlocked, it is not supported in the current file format (see gEDA/gaf File Format Document). However, a Scheme extension may be used in Lepton to achieve that.

There are two special actions that allow you to save data of a component or a picture within schematic or undo such a change. Edit → Embed Component/Picture (`E B`) embeds the data of selected component or picture into schematic. This may make sense in case you want to distribute your schematic as one file and/or prevent data loss or corruption due to different set of symbols available at the target and destination locations. Currently, you have to embed each component or picture instance if you have several of them in your schematic. Otherwise, not embedded objects won’t be present in the schematic if you don’t include libraries with appropriate symbols into your project. This is limitation of the current file format. See gEDA/gaf File Format Document for more information. Embedding objects makes thus the file size bigger (sometimes, much bigger), and after you made sure anything is OK, and necessary symbols or pictures are in place, you may want to unembed the objects. The action Edit → Unembed Component/Picture (`E Shift-B`) does just that. It unembeds a component or picture embedded by the menu item action described above. Note that the command will be ignored if you don’t have the symbol or image corresponding to your unembeddable object in one of the libraries available for your schematic. Remember to open the log window and see what could went wrong if your schematic file did not change after this action and saving it.

If you edit a symbol and save it, schematics containing it are not updated automatically. You have to update component instances manually. Select the components you want to update and use Edit → Update Component (`E U`) to actually do it.

Another useful action is translation of the page contents to origin, that is, to the coordinate (0, 0) of the page. It is usually necessary when you create or edit a symbol. The origin defines the anchor of the symbol. When you insert the symbol from the component library, this point in the symbol corresponds to the position of the mouse cursor, so the visible contents of your component will be positioned around the mouse cursor at the same distance the contents of the corresponding symbol is positioned around the origin within it. Usually, it is the left-bottom point of a symbol. However you can define it anywhere. If you want, for example, the anchor to be located at the center of your symbol, move the symbol contents to lay around the origin. Use Edit → Symbol Translate... (`E T`) to translate the symbol you edit to origin and then place its contents the way you wish.

> Note: If the contents of your symbol is too far from origin, you may even not see the symbol when inserting. Zoom out to see if this is the case then.