'\"!  tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | eqn | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | tbl | eqn | tbl | tbl | tbl | mmdoc
'\"macro stdmacro
.if n .pH g3w.olStaticText @(#)olStaticText	40.3 of 1/8/90
.SO BP.HEADER \" This header enables use of .BP macro for PostScript graphics
.ig
Modified 10/18/89 by lmh
..
.ds cW STATICTEXT
.ds rW StaticText
.ds nW StaticText
.ds wW staticText
.ds bW \fB\*(rW\fP
.ds iW \fI\*(rW\fP
.ds oS \*(cW
.nr oN 0
.nr X
.if \nX=0 .ds x} ""STATICTEXT WIDGET" 3W "\&"
.if \nX=1 .ds x} ""STATICTEXT WIDGET" 3W
.if \nX=2 .ds x} ""STATICTEXT WIDGET" "" "\&"
.if \nX=3 .ds x} ""STATICTEXT "" "" "\&"
.TH \*(x}
.SH "WIDGET CLASS NAME"
\*(bW
.SH "SYNOPSIS"
.nf
\s-1\f4#include <Intrinsic.h>
#include <StringDefs.h>
#include <OpenLook.h>
#include <\*(nW.h>\f1\s+1\f1
.fi
.P
.nf
\s-1\f4widget = XtCreateWidget(\fIname\fP, \*(wWWidgetClass, ...);\f1\s+1
.fi
.SH "DESCRIPTION"
The \*(bW widget provides a way to present an uneditable block
of text using a few simple layout controls.
.sp
\f3Word Wrapping\f1
.P
If the text is too long to fit in the width provided by the
\*(bW widget,
the text may be "wrapped" if the application requests it.
The wrapping occurs at a space between words,
if possible,
leaving as many words on a line as will fit.
If a word is too long for the width,
it is wrapped between characters.
An embedded newline will always cause a wrap.
.sp
\f3Text Clipping\(emIn Width\f1
.P
If the text is not wrapped,
it will be truncated if it cannot fit in the width of the \*(bW
widget.
The application can choose whether the truncation occurs on the
left, right, or evenly on both sides of each line of the text.
.sp
\f3Text Clipping\(emIn Height\f1
.P
If the text is too large to fit in the height provided by the
\*(bW widget,
the text is clipped on the bottom.
The clipping falls on a pixel boundary,
not between lines,
so that it is possible that only the upper part of the last
line of text may be visible.
.sp
.ig
\f3Centering Text in Large Width/Height\f1
.P
If the \f3StaticText\f1 widget is directed to become larger than is
needed for the text,
the text will be centered in the window.
The text will retain the specified alignment.
.sp
..
\f3Stripping of Spaces\f1
.P
The application can choose to have leading spaces, trailing
spaces, or both leading and trailing space stripped from the
text before display,
or can choose to have no stripping done.
.sp
\f3Selecting and Operating on the Text\f1
.P
The \*(bW widget allows text to be selected in several ways
and then copied.  See \fBText Selection\fP earlier in this
manual for the description of these operations.
.sp
\f3\*(rW Coloration\f1
.P
Figure 1 illustrates the resources that affect the coloration
of the \*(bW widget.
.br
.ne 3.5i
.BP PSART/ps.static1
.P
.ce
\f3Figure 1.\f1  Static Text Coloration
.sp
.SH "RESOURCES"
.TS
allbox;
cB s s s s.
\*(bW Resource Set
.T&
lBp-2 lBp-2 lBp-2 lBp-2 lBp-2.
Name	Class	Type	Default	Access
_
.T&
lp-2 lp-2 lp-2 lp-2 lp-2.
XtNalignment	XtCAlignment	OlDefine	OL_LEFT	SGI
XtNancestorSensitive	XtCSenstitive	Boolean	TRUE	G*
XtNbackground	XtCBackground	Pixel	White	SGI\(dg
XtNbackgroundPixmap	XtCPixmap	Pixmap	(none)	SGI\(dg
XtNborderColor	XtCBorderColor	Pixel	Black	SGI\(dg
XtNborderPixmap	XtCPixmap	Pixmap	(none)	SGI\(dg
XtNborderWidth	XtCBorderWidth	Dimension	0	SGI
XtNdepth	XtCDepth	int	(parent's)	GI
XtNdestroyCallback	XtCCallback	XtCallbackList	NULL	SI
XtNfont	XtCFont	XFontStruct *	(OPEN LOOK font)	SI
XtNfontColor	XtCFontColor	Pixel	(see below)	SGI
XtNforeground	XtCForeground	Pixel	Black	SGI\(dg
.TE
.bp
.TS
allbox;
cB s s s s.
\*(bW Resource Set (cont.)
.T&
lBp-2 lBp-2 lBp-2 lBp-2 lBp-2.
Name	Class	Type	Default	Access
_
.T&
lp-2 lp-2 lp-2 lp-2 lp-2.
XtNgravity	XtCGravity	OlDefine	WestGravity	SGI
XtNheight	XtCHeight	OlDefine	(calculated)	SGI
XtNlineSpace	XtCLineSpace	int	0	SGI
XtNmappedWhenManaged	XtCMappedWhenManaged	Boolean	TRUE	SGI
XtNrecomputeSize	XtCRecomputeSize	Boolean	TRUE	SGI
XtNsensitive	XtCSensitive	Boolean	TRUE	GI*
XtNstring	XtCString	String	NULL	SGI
XtNstrip	XtCStrip	Boolean	TRUE	SGI
XtNuserData	XtCUserData	XtPointer	NULL	SGI
XtNwidth	XtCWidth	Dimension	(calculated)	SGI
XtNwrap	XtCWrap	Boolean	TRUE	SGI
XtNx	XtCPosition	Position	0	SGI
XtNy	XtCPosition	Position	0	SGI
.TE
\f3XtNalignment\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4OL_LEFT/"left"
OL_CENTER/"center"
OL_RIGHT/"right"\f1
.in -5
.fi
.PP
This specifies the alignment to be applied when drawing the
text,
as described below:
.IP "\f4OL_LEFT\f1" 12
causes the left sides of the lines to be vertically aligned;
.IP "\f4OL_CENTER\f1" 12
causes the centers of the lines to be vertically aligned;
.IP "\f4OL_RIGHT\f1" 12
causes the right sides of the lines to be vertically aligned.
.P
.sp
\f3XtNfont\f1
.PP
Range of Values:
.br
.in +5
(any valid return from \f4XLoadQueryFont()\f1)
.in 0
.P
Default:
.P
.in +5
(chosen to match the scale and screen resolution)
.in -5
.fi
.PP
This resource identifies the font to be used to display the
text.
.P
The default value points to a cached font structure;
an application should not expect to get this value with a call to
\f4XtGetValues()\f1
and use it reliably thereafter.
.sp
\f3XtNfontColor\f1
.PP
Range of Values:
.br
.in +5
(any \f4Pixel \f1value valid for the current display)/(any name from the \f4rgb.txt \f1file)
.in -5
.PP
Default:
.br
.in +5
value of \f4XtNforeground\f1
.in -5
.PP
This resource specifies the color for the font.
If not set,
the color from the
\f4XtNforeground\f1
resource,
if available,
is used for the font.
.sp
See the note about the interaction of this resource with other
color resources under the description of the
\f4XtNbackground\f1
resource in \f3CORE(3W)\f1.
.sp
\f3XtNforeground\f1
.P
This resource defines the foreground color for the widget.
.P
See the note about the interaction of this resource with other
color resources under the description of the
\f4XtNbackground\f1
resource in \f3CORE(3W)\f1.
.sp
\f3XtNgravity\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4CenterGravity
NorthGravity
SouthGravity
EastGravity
WestGravity
NorthWestGravity
NorthEastGravity
SouthWestGravity
SouthEastGravity\f1
.in -5
.fi
.PP
The application can set a width and height to the \*(bW widget
that exceeds the size needed to display the string.
This resource controls the use of any extra space with the
\*(bW widget:
.IP "\f4CenterGravity\f1" 8
The string is centered vertically and horizontally in the extra
space.
.IP "\f4North\f1" 8
The top edge of the string is aligned with the top edge of the
space and centered horizontally.
.IP "\f4South\f1" 8
The bottom edge of the string is aligned with the bottom edge
of the space and centered horizontally.
.IP "\f4East\f1" 8
The right edge of the string is aligned with the right edge of
the space and centered vertically.
.IP "\f4West\f1" 8
The left edge of the string is aligned with the left edge of
the space and centered vertically.
.IP "\f4NorthWest\f1" 8
The top and left edges of the string are aligned with the top
and left edges of the space.
.IP "\f4NorthEast\f1" 8
The top and right edges of the string are aligned with the top
and right edges of the space.
.IP "\f4SouthWest\f1" 8
The bottom and left edges of the string are aligned with the
bottom and left edges of the space.
.IP "\f4SouthEast\f1" 8
The bottom and right edges of the string are aligned with the
bottom and right edges of the space.
.P
.sp
\f3XtNlineSpace\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4-100 \(<= XtNlineSpace\f1
.in -5
.fi
.PP
This resource controls the amount of space between lines of
text.
It is specified as a percentage of the font height,
and is the distance between the baseline of one text line and
the top of the next font line.
Thus, the distance between successive text baselines,
in percentage of the font height,
is
.P
.ce
\f4XtNlineSpace+100\f1
.sp
\f3XtNrecomputeSize\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4TRUE
FALSE\f1
.in -5
.fi
.PP
This resource indicates whether the \*(bW widget should
calculate its size and automatically set the
\f4XtNheight\f1
and
\f4XtNwidth\f1
resources.
If set to
\f4TRUE\f1,
the \*(bW widget will do normal size calculations that may
cause its geometry to change.
If set to
\f4FALSE\f1,
the \*(bW widget will leave its size alone;
this may cause truncation of the visible image being shown by
the \*(bW widget if the fixed size is too small,
or may cause centering if the fixed size is too large.
.sp
\f3XtNstring\f1
.P
This resource is the string that will be drawn.
The string must be null terminated.
.sp
\f3XtNstrip\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4TRUE
FALSE\f1
.in -5
.fi
.P
This resource controls the stripping of leading and trailing
spaces during the layout of the text string.
.TS
center, box;
lB | lB | l.
XtNstrip	XtNalignment	Spaces stripped
=
.T&
l | l | l.
TRUE	\f4OL_LEFT\f1	Leading spaces stripped.
\^	_	_
\^	\f4OL_RIGHT\f1	Trailing spaces stripped.
\^	_	_
\^	\f4OL_CENTER\f1	Both leading and trailing spaces stripped.
_
FALSE	(any)	None.
.TE
.bp
\f3XtNwrap\f1
.PP
Range of Values:
.br
.in +5
.nf
\f4TRUE
FALSE\f1
.in -5
.fi
.PP
This resource controls the wrapping of lines that are too long
to fit in the width of the \*(bW widget.
.TS
center, box;
lB | lB | l.
XtNwrap	XtNalignment	Wrap action
=
.T&
l | l | l.
FALSE	\f4OL_LEFT\f1	Clipped on the right
\^	_	_
\^	\f4OL_RIGHT\f1	Clipped on the left
\^	_	_
\^	\f4OL_CENTER\f1	Clipped equally on both left and right
_
TRUE	(any)	Long text is broken at spaces between words
\^	\^	so that each line of the displayed text has 
\^	\^	as many words as can fit.
.TE
