Building two windows with similar definitions

Assume your application needs two windows with similar definitions. One window, w_employee, needs:

The window looks like this:

Shown is a sample window with the title Employee Data. There is a Select a file drop down list box with an Open button. At bottom is a rectangular box for editing script and an Exit button.

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 the user can delete files.

Your choices

To build these windows, you have three choices:

Using inheritance

To build the two windows using inheritance, follow these steps:

  1. Create an ancestor window, w_ancestor, that contains the text, drop-down list, and the open and exit buttons, and save and close it.

    NoteYou cannot inherit a window from an existing window when the existing window is open, and you cannot open a window when its ancestor or descendant is open.

  2. Select File>Inherit, select w_ancestor in the Inherit From dialog box, and click OK.

  3. Add the Employee Data title, specify that the DropDownListBox control displays employee files, and save the window as w_employee.

  4. Select File>Inherit, select w_ancestor in the Inherit From dialog box, and click OK.

  5. Add the Customer Data title, specify that the DropDownListBox control displays customer files, add the Delete button, and save the window as w_customer.