LCaption is a PowerPlant class that is used for displaying static text.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
This class uses a text traits resource to specify characteristics such as font, size, style, color, and justification. LCaption uses the UTextDrawing class to draw text.
You can configure the text and the text traits resource in the Constructor resource editor, or you can may these characteristics at runtime.
It is possible that you will encounter a drawing problem if you modify the contents of the caption at runtime. DrawSelf() uses the DrawWithJustification() method of UTextDrawing, that does not erase the previous contents of the caption. The best way to erase the contents is to attach an LEraseAttachment object to the caption.
Source files:
See also:
Purpose:
The constructors create the object from the passed-in parameters.
Access:
Prototype:
LCaption();
LCaption( const LCaption &inOriginal );
LCaption( const SPaneInfo &inPaneInfo,
ConstStringPtr inString,
ResIDT inTextTraitsID );
LCaption( LStream *inStream );Parameters:
The parameters for these constructors are:
Purpose:
The destructor destroys the object.
Access:
Prototype:
virtual ~LCaption();Parameters:
Purpose:
Draw the caption using the colors and traits specified.
Access:
Prototype:
virtual void DrawSelf();Parameters:
Return:
Purpose:
Return contents of the caption as a string.
Access:
Prototype:
virtual StringPtr GetDescriptor(Parameters:
Str255 outDescriptor) const;
The parameter for this method is:
Return:
A pointer to a string, using the StringPtr type.
Purpose:
This method returns the value of the mTxtrID data member.
Access:
Prototype:
ResIDT GetTextTraitsID() const;Parameters :
Return:
A resource ID, using the ResIDT type.
Purpose:
Return the integer value represented by the text of the caption, held in the mText data member.
Access:
Prototype:
virtual SInt32 GetValue() const;Parameters:
Return:
SInt32 containing the value of mText.
Purpose:
Set contents of the caption from a string.
Access:
Prototype:
virtual void SetDescriptor(Parameters:
ConstStringPtr inDescriptor);
The parameter for this method is:
Return:
Purpose:
This member sets the value of the mTxtrID data member to a resource ID for a resource containing the text traits information.
Access:
Prototype:
void SetTextTraitsID( ResIDT inTxtrID );Parameters:
The parameter for this method is:
|
Return:
Purpose:
Set a caption to the text representation of an integer value.
Access:
Prototype:
virtual void SetValue( SInt32 inValue );Parameters:
The parameter for this method is:
Return:
Purpose:
This data member contains the caption string.
Access:
Prototype:
LStr255 mText;
Purpose:
This data member contains a resource ID for a resource that contains the text traits information for the caption.
Access:
Prototype:
ResIDT mTxtrID;