TFormattable classes

When you derive classes from TFormattable, in addition to providing the standard constructor, destructor, and operator functions, override the following member functions:

CanAssignTo checks whether instances of this TFormattable derived class can be assigned to another TFormattable. This is typically True when this TFormattable derives from the target TFormattable.

DescendsFrom checks whether this TFormattable derived class descends from another TFormattable subclass. Implement this check by comparing the class names, and if they do not match, calling the DescendsFrom function of the base class.

GetChoiceValue is called by TChoiceFormatter during the formatting operation. This function returns a number, based on the data wrapped by this formattable, indicating the correct TParameterFormatter instance to use.

SetChoiceValue is called by TChoiceFormatter during the scanning operation. This function sets the data in this formattable based on the number of the TParameterFormatter instance that provided the best match during the text scanning.

Name returns the class name.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker