spd - Edit menu¶
Note that Copy, Paste, Delete and Restore operations can be carried out by means of a right-mouse click on the object (or, in the case of Paste, at the position where the copied object is to be pasted to.)
Copy selected item¶
Copy the selected item into memory. It may subsequently be pasted into the program by means of the Paste option.
A copied item is retained until overwritten by a subsequent copy operation. Even if the actual item is deleted, the copy remains in memory available for pasting. Note however that opening a new program causes the copied item to be cleared.
Copying a window also copies all the groups, menus, controls and graphics contained in the window, but does not copy child windows.
Copying a group copies all the items in the group and retains the group type: button, radio, checkbox or textbox.
Copying a menu item also copies any submenus attached to the item.
Note
All or part of the definition of an object or objects can be copied to the clipboard by highlighting the text in the source window and pressing CTRL-C. This is a completely separate operation from the Copy menu option. Copy is not a clipboard operation, and using it to copy an item has no effect on the current contents of the clipboard.
Paste selected item¶
Paste the currently copied item into the source file. The item must have been copied by means of the Copy option.
If there is no conflict, the pasted item is given the name of the copied item. This may occur for several reasons: the copied item may have been deleted or renamed since being copied, or the new item may be pasted into a different window or group, causing it to have a distinct long name. If the original name cannot be used without a conflict arising, then the suffix “1” is added if this makes a unique name; otherwise the suffix “2” is tried, and so on until a unique name is found. Note that if the name already ends in a number, that number is increased when creating the new name. That is, a copy of a button named Button1 will be pasted as Button 2, not Button11; a button called Button54 will be pasted as Button55.
The location where the new item is pasted depends both on its type and on the type of the currently selected item.
Temporary variable |
Always pasted into the ‘tmp’ group immediately after the last such variable currently defined in the program code. The currently selected item is irrelevant. |
Window |
Pasted as a top level window after the last window declaration in the program code. The currently selected item is irrelevant. |
Button |
If the selected item is a grouped button or a button group, a button is pasted into that group. Otherwise it is pasted as an ordinary push button in the active window. If a button is pasted into a group of a different type, the type of the button is changed to that of the group. |
Textbox |
If the selected item is a grouped textbox or textbox group, a textbox is pasted into that group. Otherwise it is pasted as a top-level control in the active window. |
Listbox
Table
Static text
OLE control
|
Pasted as a top-level control after all existing controls in the active window. |
Graphic |
Pasted after any existing graphics in the active window. |
Group |
Pasted to the active window, retaining its type. |
Menu item |
If the item to be pasted is a menu item, and the selected item is also a menu item, the item is pasted at the end of the selected item’s menu or submenu. Otherwise the user is asked to select the menu from a list of all menus in the active window, or to create a new menu for the item. |
Note
This is not a clipboard operation. Cutting and pasting in the source code window is, however, a clipboard operation, and uses the standard keys for cut and paste operations. (CTRL-V, CTRL-C, CTRL-X).
Delete selected item¶
Delete the selected item. Deletion is irreversible, so use this option with care. A warning prompt is always issued.
If a window is deleted, all window objects contained in it are also deleted.
If a group is deleted, all the buttons or textboxes in the group are also deleted.
If a menu item is deleted, all its submenu items are also deleted.
If a record structure is deleted, any temporary fields declared within it are deleted automatically.
The only way to restore a deleted item is to exit from the program designer without saving the file. Any other amendments made since the last save will be also be lost.
Note
Menu items may also be deleted by means of the Menu editor.
Restore selected item¶
Restore the currently selected item to the state it was when most recently selected. Any changes made to its properties since then are undone. If the item was newly created, it is restored to its state when created. If more than one item is selected, this option only restores the primary selected item.
Order selected item¶
Change the order of items. The items available for moving depend on the currently selected item, as follows:
Selected Item |
Items to be ordered |
Window |
Groups and top-level controls in the window. |
Group |
Items in the group. |
Top-level control |
Groups and top-level controls in the parent window. |
Grouped control |
Items in the group. |
Graphic |
Graphics in the parent window. |
Temporary record |
The fields in the !record structure. The Record editor can also be used to move record fields. |
Temporary variable |
The fields in the parent !record structure. |
A window opens, listing the items available for re-ordering. An item is selected by clicking on it. Then the Top, Bottom, Up and Down buttons are available to move the item to the top or bottom of the list, or up and down a single line.
Changing an item’s order does not affect its position on the screen, only its position in the source code. In the case of a control, this determines its position in the tab sequence of its parent window. The tab sequence is the order in which controls receive focus when the user presses the TAB key during a dialog. The tab_order clause is used at run time to change a control’s position in the tab order.
Note
To change the order of menu items, use the Menu editor.
Menu Editor¶
This option is only enabled if the selected item is a menu or menu item.
Menu items cannot be selected and edited by the mouse in the same way as other window objects, because the double click and click and drag operations are filtered out by the execution of the generic windows menu system. The menu editor is therefore provided for moving, creating and deleting menu items. The menu editor is the best way to set up a menu structure - it cannot, however, be used to edit properties such as label, style and accelerator key. This must be done using the Property window or Edit window.
Clicking on a bottom-level menu item (one that does not have a submenu attached) causes it to be selected, in the same way as any other window object. Pressing SHIFT-CLICK on a bottom-level menu item selects the item and opens the menu editor. An item with the style WS_DISABLED cannot be selected by clicking on it.
Clicking on a non-bottom-level menu item causes its submenu to open, as if the program were actually running. This enables the user to test the structure and operation of the menu visually.
The menu editor opens with the selected item (if any) highlighted.
The Menu box displays the menu identifier. This may be edited. The change is not reflected to other windows until the Menu editor is closed.
The Parent box displays the identifier of the parent item, if any. All other items in the selected item’s menu or submenu are also displayed, in order of definition. Any displayed item may be selected by clicking on it. The following options are then available:
Open |
Displays the submenu of the currently selected item. The characters -> at the end of the item identifier indicate that it already has subitems defined. Double-clicking an item has the same effect as pressing Open. |
Parent |
Displays the parent menu or submenu of the currently selected item. |
Move up, Move down |
Move the currently selected item up or down one place in the menu. This determines the position in which it will appear. |
Move level up |
Move the selected item one level up in the menu tree. |
Move level down |
Move the selected item one level down in the menu tree. The item becomes a subitem of the item immediately above it in the list. It must therefore be in the correct position before the option is selected. |
Add |
Create a new menu item. The item is placed below the currently selected item, and is given the identifier MenuItem1, MenuItem2, etc (the lowest unused number). The identifier is also assigned as the default label. These can be edited in the Property window or Edit window after exiting the menu editor. |
Delete |
Delete the selected item. Any subitems are also deleted. |
Exit |
Save changes and close the menu editor. |
Record Editor¶
This option is only enabled if the selected item is a temporary record structure (!record).
Temporary record structures are of two types: those which include a file or record structure in their definition, and those that have a field list.
If a file or record structure is included, it must be that of a Sculptor keyed file (![o]file) declared in the program, or of a temporary record structure (!record) that does have a field list, defined in the program. The fields in the new record structure match those in the existing structure, and no field list is necessary. Select the file or record from the drop down list in the File Id box, which lists all suitable keyed files and record structures defined in the program. If a structure is specified, the editing buttons for the field list are disabled; there is no further editing to be done. A structure cannot be selected if any fields have been listed.
If the record structure has a field list, the buttons at the bottom of the editor have the following functions:
Add |
Add a field to the end of any current fields. The field is given the name Temp1, Temp2, Temp3 - the lowest number available - and default size of a20. Both name and type can be edited, using the Edit window or Property window, after the record editor is closed. |
Delete |
Deletes the highlighted field. |
Top |
Moves the selected field to the top of the list. |
Up |
Moves the selected field up one position in the list. |
Down |
Moves the selected field down one position in the list. |
Bottom |
Moves the selected field to the bottom of the list. |
Delete all fields |
Deletes all the fields. The File Id listbox can then be used to select a file or record from which the field list will be taken. |
OK |
Saves changes and closes the record editor. |
Cancel |
Closes the record editor, abandoning changes and restoring the previous values. |
Set insert point¶
This option enables the user to define the position in the source code at which newly created items (other than window objects) will be placed. First set the point by selecting an item in the File tree, then select this menu option. Newly created items will be placed immediately below the selected item.
RELATED TOPICS |