9.8.  Exercise: Input Forms

[ fromfile: forms-labs.xml id: forms-labs ]

  1. Implement the missing methods from the OrderForm class, to construct an input dialog form for Order objects. A starting point is provided in src/handouts/forms/manual. The dialog should look something like Figure 9.21.

    Figure 9.21.  Order Form Dialog

    Order Form Dialog

    The code goes in orderform.cpp.

    The user should click Ok to send data into the Order, or Cancel to dismiss the dialog and do nothing to the Order.

    The totalPrice field should be read-only, and calculated based on the quantity and unitPrice.

  2. Next, use Designer to create the same input dialog, and integrate it with your code using either delegation or multiple inheritance, as described in Section 9.7.