<!-- $XConsortium: CvtSt.sgm /main/9 1996/09/08 20:37:28 rws $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->

<RefEntry Id="CDEMMA.MAN119.rsml.1">
<RefMeta>
<RefEntryTitle>XmConvertStringToUnits</RefEntryTitle>
<ManVolNum>library call</ManVolNum>
</RefMeta>
<RefNameDiv>
<RefName><Function>XmConvertStringToUnits</Function></RefName>
<RefPurpose>A function that converts a string specification to a unit value
<IndexTerm>
<Primary>XmConvertStringToUnits</Primary>
</IndexTerm></RefPurpose>
</RefNameDiv>
<!-- @OSF_COPYRIGHT@-->
<!-- COPYRIGHT NOTICE-->
<!-- Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.-->
<!-- ALL RIGHTS RESERVED (MOTIF). See the file named COPY.MOTIF.DOC for-->
<!-- the full copyright text.-->
<!-- -->
<!-- HISTORY-->
<RefSynopsisDiv>
<FuncSynopsis>
<FuncSynopsisInfo>#include &lt;Xm/Xm.h>
</FuncSynopsisInfo>
<FuncDef>int <Function>XmConvertStringToUnits</Function></FuncDef>
<!--<ParamDef><Replaceable>screen, spec, orientation, to_type, parse_error</Replaceable></ParamDef>-->
<ParamDef>Screen *<Parameter>screen</Parameter></ParamDef>
<ParamDef>String <Parameter>spec</Parameter></ParamDef>
<ParamDef>int <Parameter>orientation</Parameter></ParamDef>
<ParamDef>int <Parameter>to_type</Parameter></ParamDef>
<ParamDef>XtEnum *<Parameter>parse_error</Parameter></ParamDef>
</FuncSynopsis>
</RefSynopsisDiv>
<RefSect1>
<Title>DESCRIPTION</Title>
<Para><Function>XmConvertStringToUnits</Function> converts a string specification value and
returns the converted value as the return value from the function.
This function uses the specified screen's resolution to compute the
number of units for the string specification.
</Para>
<VariableList>
<VarListEntry>
<Term><Symbol Role="Variable">screen</Symbol></Term>
<ListItem>
<Para>Specifies the screen whose resolution is to be used for the computation.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">spec</Symbol></Term>
<ListItem>
<Para>Specifies the string, in <Symbol Role="Variable">&lt;floating value>&lt;unit></Symbol> format, to be
converted.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">orientation</Symbol></Term>
<ListItem>
<Para>Specifies whether the converter uses the horizontal or vertical screen
resolution when performing the conversion. The <Symbol Role="Variable">orientation</Symbol>
parameter can have values of <SystemItem Class="Constant">XmHORIZONTAL</SystemItem> or <SystemItem Class="Constant">XmVERTICAL</SystemItem>.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">to_type</Symbol></Term>
<ListItem>
<Para>Converts the value to the unit type specified.
Refer to the <SystemItem Class="Resource">XmNunitType</SystemItem> resource of the
<Classname>XmGadget</Classname>, <Classname>XmManager</Classname>, or <Classname>XmPrimitive</Classname> reference page.
This parameter can have one of
the following values:
</Para>
<VariableList>
<VarListEntry>
<Term><SystemItem Class="Constant">XmPIXELS</SystemItem></Term>
<ListItem>
<Para>The returned value will be the number of pixels.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmMILLIMETERS</SystemItem></Term>
<ListItem>
<Para>The returned value will be the number of millimeters.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm100TH_MILLIMETERS</Symbol></Term>
<ListItem>
<Para>The returned values will be the number of 1/100 millimeters.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmCENTIMETERS</SystemItem></Term>
<ListItem>
<Para>The returned values will be the number of centimeters.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmINCHES</SystemItem></Term>
<ListItem>
<Para>The returned values will be the number of inches.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm1000TH_INCHES</Symbol></Term>
<ListItem>
<Para>The returned values will be the number of 1/100 inches.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmPOINTS</SystemItem></Term>
<ListItem>
<Para>The returned values will be the number of points.
A point is a text processing unit
defined as 1/72 of an inch.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm100TH_POINTS</Symbol></Term>
<ListItem>
<Para>The returned values will be the number of 1/100 points.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><SystemItem Class="Constant">XmFONT_UNITS</SystemItem></Term>
<ListItem>
<Para>All values provided to the widget are treated as font
units. A font unit has horizontal and vertical components.
These are the values of the XmScreen resources <SystemItem Class="Resource">XmNhorizontalFontUnit</SystemItem>
and <SystemItem Class="Resource">XmNverticalFontUnit</SystemItem>.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>Xm100TH_FONT_UNITS</Symbol></Term>
<ListItem>
<Para>All values provided to the widget are
treated as 1/100 of a font unit.
A font unit has horizontal and vertical components.
These are the values of the XmScreen resources <SystemItem Class="Resource">XmNhorizontalFontUnit</SystemItem>
and <SystemItem Class="Resource">XmNverticalFontUnit</SystemItem>.
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">parse_error</Symbol></Term>
<ListItem>
<Para>Specifies if a parsing error occurred. This is set to a value of True
indicates that an error occurred, a value of False to indicate no error.
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</RefSect1>
<RefSect1>
<Title>RETURN</Title>
<Para>Returns the converted value.
If a NULL screen, incorrect <Symbol Role="Variable">orientation</Symbol>,
or incorrect <Symbol Role="Variable">unit_type</Symbol>
is supplied as parameter data, or if a parsing error occurred, 0
(zero) is returned.
</Para>
</RefSect1>
<RefSect1>
<Title>RELATED</Title>
<Para>&cdeman.XmConvertUnits;, &cdeman.XmSetFontUnits;, and &cdeman.XmScreen;.
</Para>
</RefSect1>
</RefEntry>
<!--fickle 1.09 7/2/95-->
