Several predesigned menus, or menu templates, contain frequently used commands. You can use these menus in your applications without modifying them (except to write code), or you can use them as a starting point, customizing them as you would a menu you originally designed yourself. Menu templates do not contain any event handler code.
The menu templates are stored in the BIN subdirectory in a default installation and have a .dmt extension.
You can also save as a template any menu that you design using the Menu Designer. After saving a menu as a template, you can use it as you would any predesigned menu. If you decide you no longer want a particular menu template, you can delete it from the list.
To add a menu template to your application
- Right-click the Menu Designer and choose Insert From Template. (If there are no templates, the Insert From Template option appears dimmed in the context menu.) The Insert Template dialog box opens, displaying a list of available menu templates.
- Select the menu template you want to insert, then press Enter or choose OK. This inserts the menu into your form at the cursor's location. For example, if your cursor is on a menu item in a list, the menu template is inserted above the selected item. If your cursor is on the menu bar, the menu template is inserted to the left of the cursor.
To delete a menu template
- Right-click the Menu Designer and choose Delete Templates. (If there are no templates, the Delete Templates option appears dimmed in the context menu.) The Delete Templates dialog box opens, displaying a list of available templates.
- Select the menu template you want to delete, and press Del. Delphi deletes the template from the templates list and from your hard disk.