[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]
Motif 2.1 Programmer's Reference
XmConvertStringToUnits
A function that converts a string specification to a unit value
Format
#include <Xm/Xm.h>
int XmConvertStringToUnits
Screen
*screenString specint
orientationint to_typeXtEnum
*parse_error
DESCRIPTION
XmConvertStringToUnits 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.
screenSpecifies the screen whose resolution is to be used for the computation.
specSpecifies the string, in <floating value><unit> format, to
be converted.
orientationSpecifies whether the converter uses the horizontal or vertical screen
resolution when performing the conversion. The orientation parameter
can have values of XmHORIZONTAL or XmVERTICAL.
to_typeConverts the value to the unit type specified. Refer to the XmNunitType
resource of the XmGadget, XmManager, or XmPrimitive reference page. This
parameter can have one of the following values:
XmPIXELSThe returned value will be the number of pixels.
XmMILLIMETERSThe returned value will be the number of millimeters.
Xm100TH_MILLIMETERSThe returned values will be the number of 1/100 millimeters.
XmCENTIMETERSThe returned values will be the number of centimeters.
XmINCHESThe returned values will be the number of inches.
Xm1000TH_INCHESThe returned values will be the number of 1/100 inches.
XmPOINTSThe returned values will be the number of points. A point is a text
processing unit defined as 1/72 of an inch.
Xm100TH_POINTSThe returned values will be the number of 1/100 points.
XmFONT_UNITSAll 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 XmNhorizontalFontUnit and XmNverticalFontUnit.
Xm100TH_FONT_UNITSAll 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 XmNhorizontalFontUnit and XmNverticalFontUnit.
parse_errorSpecifies 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.
RETURN
Returns the converted value. If a NULL screen, incorrect
orientation, or incorrect unit_type is supplied as parameter
data, or if a parsing error occurred, 0 (zero) is returned.
RELATED
XmConvertUnits
(3), XmSetFontUnits
(3), and
XmScreen
(3).
[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]