Release 1.0  Copyright ã1994 by Don Yacktman.  All Rights Reserved.

MiscOrderForm

Inherits From:	Object

Declared In:	<misckit/MiscOrderForm.h>

Class Description

The MiscOrderForm implements a very simple order form.  The order form should be laid out with several TextFields and other AppKit and MiscKit controls to be filled in by the user, which then may be printed by pressing a button on the panel.  Once the user presses the print button, the final extended cost of the ordered licenses is calculated and placed in the panel.  If the total cost field needs to be updated more frequently, then this should be arranged for by the programmer; the MiscOrderForm only updates this information when it gets a ±costCalc: message, which is sent whenever printing is initiated with ±printOrderForm:.  The current cost calculation multiplies the values in the costPerLicenseText and numLicensesText fields and places the result in the totalCostText field.  These three fields should be TextFields on the Order Form... panel.

The actual panel may be obtained with ±orderFormPanel and the panel is placed on the screen by the ±orderForm: method.  The ±setController: and ±init methods are called when initializing the MiscOrderForm object.

An appropriate .nib file will be named OrderForm.nib and have a MiscOrderForm object as the file's owner.  Look at the example .nib file in the MiscKit examples for a sample .nib file.

Instance Variables

id controller;
id orderFormPanel;
id costPerLicenseText;
id numLicensesText;
id totalCostText;

controller	Points to the Applications's MiscInfoController.

orderFormPanel	The Panel object which is the Order Form... panel.

costPerLicenseText	Diabled TextField which contains the cost per license.

numLicensesText	TextField where the user is expected to enter the number of licenses desired.

totalCostText	Disabled TextField where the total cost of the ordered licenses appears.

Method Types

Manipulating the Order Form panel	- costCalc:
	- orderForm:
	- orderFormPanel
	- printOrderForm:

Other Methods	- init
	- setController:

Instance Methods

costCalc:
-  costCalc:sender

This message should be overridden to do any calculations necessary to place the proper total cost of all licenses ordered in the Order Form... panel.  The default implementation multiplies the values in the costPerLicenseText and numLicensesText fields and places the result in the totalCostText field.  The number of licenses is taken to be an integer, and should be entered by the user.  The other two values should be in disabled text fields and are taken to be floating point values.  Returns self.

See also:  ±printOrderForm:

init
-  init

Initializes a new instance of MiscOrderForm.  Returns self.

orderForm:
-  orderForm:sender

Loads the Order Form... panel if necessary and then places it on the screen.  Returns self.

See also:  ±orderFormPanel

orderFormPanel
-  orderFormPanel

Returns the Order Form... panel, loading it first if necessary.

See also:  ±orderForm:

printOrderForm:
-  printOrderForm:sender

Prints out the order form via the stardard NeXT Print... panel using the ±smartPrintPSCode: method of the Window class.  Before the panel is printed, the cost fields are updated to make sure that they reflect the correct amounts for the number of licenses ordered.  Returns self.

See also:  ±costCalc:

setController:
-  setController:sender

Sets the controller of the receiving MiscOrderForm instance.  Sender is assumed to be a MiscInfoController instance.  Returns self.  Note that the default implementation does not actually use the controller instance variable, but a subclass might want to send messages to the controller.