TablePrinter Palette
By Eric T. Seymour
NeXT Premium Developer Support

Not valid for 3.0
Valid for 3.1 or better

What is it?
TablePrinter Palette is an Interface Builder palette which nicely formats and prints DBTableViews.

How do I use it?
First the obvious: build TablePrinter.palette and  load it into InterfaceBuilder.
	
Second, for simple operation, just drag a TablePrinter into your nib and connect its tableView outlet to the desired DBTableView.  Then make the new TablePrinter instance the target of the "Print..." Button and ±printPSCode: the action.

How do I adjust print parameters?
TablePrinter 's Inspector can be used to alter the print parameters.  Additionally, user interface objects like switch Buttons and ColorWells can target the TablePrinter object to change print parameters at run time.  For example, you could build an accessory view to the PrintPanel which lets the user adjust the look of the output.  See the TablePrinter.rtf documentation for details.

For example, to allow the user to toggle page number printing On/Off, drag a switch Button into the nib and drag a connection from it to the TablePrinter instance. Select the method ±pageNumbersToggle:.  To allow the user to change the color of the page number, drag a ColorWell into the nib and drag a connection from it to the TablePrinter instance.  Select the method ±pageNumColor:.  To allow the user to specify the starting page number, drag an editable TextField into the nib and drag a connection from it to the TablePrinter instance.  Select the method ±startPageNum:.

What does the TablePrinter.palette source code demonstrate?
·	Palette writing.
·	Creating and managing an off screen window through a cover object.
·	Having DBFormatters draw in a non-DBTableView  object.
·	A PrintPanel subclass which adjusts the From-To numbers to reflect compound pages.  For example,  if you ask to print from 2 to 2 on a table that is three pages wide, It will set PrintInfo to print 4 through 6.
·	Other drawing and related stuff with Cells.  Note: the drawing algorithm is not necessarily the best method, but it works.
·	Makefile extensions to build the palette's link library.

KUDOS:
Special thanks go to Mai Nguyen for her help with DBFormatter printing.  Also, special thanks go to Thomas Burkholder, for his transfer of IB Palette knowledge, for writing TTools, and for the makefile examples.

Disclaimer:
You may freely copy, distribute, and reuse the code in this example.  NeXT disclaims any warranty of any kind, expressed or implied, as to its fitness for any particular use.