TextBox
TextBox
Draws text which won't be edited void TextBox(text, length, box, justType ); Ptr text ; address of array of characters to draw long length ; number of characters to draw
Rect *box ; in local ( window) coordinates short justType ; 0=left; 1=centered; -1=right
Use TextBox to draw text without having to create an edit record. text is the address of an array of characters.
length is the number of characters to draw.
box is a pointer to a Rect structure, specified in local coordinates, which identifies the location at which the text should be drawn.
justType is a short which must be a justification mode. Using the constant
teForceLeft produces the default behavior of left justification. See
the Notes section below for a list of all the justification modes.
Notes: This is a fast way to display a message. TextBox creates and deletes an edit record internally.
For example:
char msg[]="Hi there!";
TextBox( msg, strlen( msg ), &r, teJustCenter ); Note that no box is drawn. Use FrameRect to make this function do what its name implies.
Justification is performed relative to the left and right side of the
destination rectangle.
Use the following constants to specify the justication mode.
New constant Old constant Description
teFlushRight teJustRight Flush right for all scripts
teFlushLeft teForceLeft Flush left for all scripts
teCenter teJustCenter Centered for all scripts
teFlushDefault teJustLeft Flush according to line direction