Copyright © 1998 Sailmaker Software Ltd. All rights reserved.
			<mailto:richardb@sailmaker.co.uk>
			<http://www.sailmaker.co.uk/>


Installation:
-------------

1.	Quit Constructor if it's running.
2.	Put "Decimal format panes.CTYP" or an alias to it in Constructor's "Custom
	Types" folder.
3.	Put "Decimal Panes source" wherever you like to keep third party source
	code.
4.	Put "Example application" wherever you like to keep example projects.
5.	Get the FMAT resource editor from Apple's developer web site or developer
	CDs. If you have any trouble finding it, I keep a copy at
	<http://www.sailmaker.co.uk/newfiles/FMAT_Editor.sit.hqx>.
6.	Install the FMAT resource editor into ResEdit as per its documentation.

How to Use:
-----------

1.	Use ResEdit to create a FMAT resource that describes the number format you
	want.
2.	In Constructor, create whichever type of pane you need (out of
	CDecimalStaticText, CDecimalCaption, CDecimalEditText and CDecimalEditField).
3.	In Constuctor, set the pane's FMAT resource ID to whatever resource you
	created in step 1.
4.	You get and set the panes' values with GetDoubleValue() and
	SetDoubleValue(), just as you would use GetValue() and SetValue().
5.	The editable panes broadcast when changed. CDecimalEditText broadcasts its
	value message and CDecimalEditField broadcasts its pane ID. The example app
	shows how to use this to link two panes and a slider together.


Tips:
-----

To get a feel for how format strings work, look that the documentation for the
FMAT resource editor and chapter 5 of Inside Mac:Text, especially the section
"Working with Numeric Strings" that starts on page 5-35.

The scheme I've chosen is that all the formatting work is encapsulated in
CDecimalDescription, which is a mix-in class. CDecimalStaticText,
CDecimalCaption, CDecimalEditText and CDecimalEditField mix this class in with
the standard PowerPlant classes.

This means you can easily mix CDecimalDescription in with any other class that
needs to do decimal formatting.

CDecimalStaticText and CDecimalCaption have pretty simple implementations and are
the best place to start if you want to dissect what's going on.

CDecimalEditText and CDecimalEditField are rather more complicated. I do some
extra work to (a) conform the format after the user edits them and (b) maintain
the underlying value at full precision regardless of the precision of the display
format. (b) isn't really necessary for vanilla usage, but becomes useful if for
example you need to subclass them further, eg to handle conversions between
physical measurement units (mail me if you need to do that: I have some code that
may help).

CDecimalDescription also has a couple of utility functions, ToExtended80() and
ToDouble(), for converting between double and extended80 formats, regardless of
whether you're targeting PPC, 68K SANE or 68K with FPU. They're static members,
so you don't actually need to instantiate a CDecimalDescription object to use
them.


Conditions of Use
-----------------

This source code is freeware, but not in the public domain. Sailmaker
Software Limited retains all rights to it.
Redistribution is permitted, but only in a complete and unmodified form.

Comments and questions are welcomed at freeware@sailmaker.co.uk

This source code is distributed AS IS in the hope that it may be useful,
however it is your responsibility to determine its fitness for your
particular purpose and you use it entirely at your own risk.
Sailmaker Software Ltd hereby disclaims all warranties relating to this
software, whether express or implied, including without limitation any
implied warranties of merchantability or fitness for a particular purpose. 
Sailmaker Software Ltd will not be liable for any special, incidental,
consequential, indirect or similar damages due to loss of data or any other
reason, even if Sailmaker Software Ltd or an agent of its has been advised of
the possibility of such damages.  In no event shall Sailmaker Software Ltd be
liable for any damages, regardless of the form of the claim.  The person
using the software bears all risk as to the quality and performance of the
software.

US Government: 
Government End Users:  If you are acquiring this software on behalf of any unit
or agency of the United States Government, the following provisions apply.  The
Government agrees: (i) if this software is supplied to the Department of Defense
(DoD), the software is classified as "Commercial Computer Software" and the
Government is acquiring only "restricted rights" in the software, its
documentation and fonts as that term is defined in Clause 252.227-7013(c)(1) of
the DFARS; and (ii) if the software is supplied to any unit or agency of the
United States Government other than DoD, the Government's rights in the software,
its documentation and fonts will be as defined in Clause 52.227-19(c)(2) of the
FAR or, in the case of NASA, in Clause 18-52.227-86(d) of the NASA Supplement to
the FAR.

So there.
