Suppose that your application needs two windows with similar definitions. One window, w_employee, needs:
A title (Employee Data)
Text that prompts a user to select a file
A drop-down list with a list of available employee files
An Open button with a script that opens the selected file in a multiline edit box
An Exit button with a script that asks the user to confirm that the window should be closed and then closes the window
Figure 10-3 shows how the w_employee window might look.
Figure 10-3: Example window w_employee
The only differences in the second window, w_customer, are that the title is Customer Data, the drop-down list displays customer files instead of employee files, and there is a Delete button so that the user can delete files.
To build these windows, you have three choices:
Build two new windows from scratch as described in “Building a new window”
Build one window from scratch and then modify it and save it under another name
Use inheritance to build two windows that inherit a definition from an ancestor window
To build the two windows using inheritance, follow these steps:
Create an ancestor window, w_ancestor, that contains the text, drop-down list, and the open and exit buttons, and save and close it.
Select File>Inherit, select w_ancestor in the Inherit From dialog box, and click OK.
Add the Employee Data title, specify that the DropDownListBox control display employee files, and save the window as w_employee.
Select File>Inherit, select w_ancestor in the Inherit From dialog box, and click OK.
Add the Customer Data title, specify that the DropDownListBox control display customer files, add the Delete button, and save the window as w_customer.