Try OpenEdge Now
skip to main content
Introducing the Progress Developer Studio for OpenEdge Visual Designer
Creating the Sports Window : Modifying the functionality of menu and toolbar items : Modifying the Open menu item
 

Modifying the Open menu item

For the Open menu item, you must remove the default functionality and add new features. With the following procedure, you add the ability to open the Customer, Department, and Purchase Order forms from sub-menus of the Open menu.
To modify the File > Open menu item:
1. With sportsForm.cls open in the Visual Designer, right-click on the Open item in the File menu in the Sports 2000 menu.
2. Deselect Show Shortcut Keys, which removes Ctrl+O from the menu item label.
Note: Another method for removing shortcut keys from menu item labels is to select the menu item and then delete the value of the ShortcutKeys property in the Properties view.
3. With the Open item selected, find the Click event in the Properties view.
4. Remove the value OpenFile from the Click event.
Note: The OpenFile() method still exists in the sportsForm.cls file, although the Click event no longer calls it. You can remove or comment out OpenFile(), but there are no adverse consequences if you leave it as is.
5. Click on the Open menu item and add Customer, Purchase Order, and Department to the Type Here fields of the sub-menu.
The Sports 2000 Open menu looks similar to the following illustration:
6. Select the Customer item in the submenu.
7. In the Properties view, add showCustomerForm as the Click event handler. The Properties view looks similar to the following illustration:
8. Select the Purchase Order item in the submenu.
9. In the Properties view, add showPurchOrderForm as the Click event handler.
10. Select the Department item in the submenu.
11. In the Properties view, add showDepartmentForm as the Click event handler.
12. Save sportsForm.cls.