Customizing the menu and toolbar
-
Adding a menu item
-
From the main menu select Edit/Customize User Interface
-
In the shortcut bar on the left side of the dialog click the item labeled 'Main Menu'. (note: the labels will appear when you move the mouse over each item)
-
In the treeview, right click the 'MainMenu' node and in the context menu select 'New'. This will show a menu containing all the items that can be created as children of this node. Select 'Menu' and notice that the main menu now has a new top level menu.
-
Now in the treeview select the menu you just created to display its properties in the property browser. Give the menu a new name, if the name contains spaces you should give it a name without spaces and fill in the the Caption property with the desired name. Proper naming ensures that the item will be accessible from script.
-
Right click the newly created menu and select New/MenuItem/MenuItem. This will add a menu item to the menu. Set it's name and caption and optionally its IconFile in the same manner as the previous step.
-
The Script property is the next and most important part of the menu item since this controls what the item does when it's selected. Select the Script property and click the ... button. This will display a dialog that allows you to select a user interface script object. (see Creating UI Scripts)
-
Adding a tool button
-
From the main menu select Edit/Customize User Interface
-
In the shortcut bar on the left side of the dialog click the item labeled 'Main Toolbar'.
-
In the treeview, right click the 'MainToolbar' node and in the context menu select 'New'. This will show a menu containing all the items that can be created as children of this node. Select ToolButton/ToolButton.
-
Now in the treeview select the button you just created to display its properties in the property browser. Give the button a name and assign an IconFile.
-
The Script property is the next and most important part of the tool button since this controls what the item does when it's clicked. Select the Script property and click the ... button. This will display a dialog that allows you to select a user interface script object. (see Creating UI Scripts)
-
Adding a context menu
-
From the main menu select Edit/Customize User Interface
-
In the shortcut bar on the left side of the dialog click the item labeled 'Context Menus'.
-
In the treeview, right click the 'ContextMenus' node and in the context menu select 'New'. This will show a menu containing all the items that can be created as children of this node. Select ContextMenu.
-
Now in the treeview select the context menu you just created to display its properties in the property browser. Give the menu a name and assign an IconFile. The TargetClass is the name of a class whose instances will have this menu appended to its default context menu.
-
Menu items can be added to the context menu in the same manner as the main menu. All items in the menu will be displayed in context menus shown for instances of the TargetClass.
Copyright © 2004 Fragmosoft