1XmConvertStringToUnits(library call) XmConvertStringToUnits(library call)
2
3
4
6 XmConvertStringToUnits — A function that converts a string specifica‐
7 tion to a unit value
8
10 #include <Xm/Xm.h>
11 int XmConvertStringToUnits(
12 Screen *screen,
13 String spec,
14 int orientation,
15 int to_type,
16 XtEnum *parse_error);
17
19 XmConvertStringToUnits converts a string specification value and
20 returns the converted value as the return value from the function.
21 This function uses the specified screen's resolution to compute the
22 number of units for the string specification.
23
24 screen Specifies the screen whose resolution is to be used for the
25 computation.
26
27 spec Specifies the string, in <floating value><unit> format, to be
28 converted.
29
30 orientation
31 Specifies whether the converter uses the horizontal or verti‐
32 cal screen resolution when performing the conversion. The
33 orientation parameter can have values of XmHORIZONTAL or
34 XmVERTICAL.
35
36 to_type Converts the value to the unit type specified. Refer to the
37 XmNunitType resource of the XmGadget, XmManager, or XmPrimi‐
38 tive reference page. This parameter can have one of the fol‐
39 lowing values:
40
41 XmPIXELS The returned value will be the number of pixels.
42
43 XmMILLIMETERS
44 The returned value will be the number of millime‐
45 ters.
46
47 Xm100TH_MILLIMETERS
48 The returned values will be the number of 1/100
49 millimeters.
50
51 XmCENTIMETERS
52 The returned values will be the number of centime‐
53 ters.
54
55 XmINCHES The returned values will be the number of inches.
56
57 Xm1000TH_INCHES
58 The returned values will be the number of 1/100
59 inches.
60
61 XmPOINTS The returned values will be the number of points.
62 A point is a text processing unit defined as 1/72
63 of an inch.
64
65 Xm100TH_POINTS
66 The returned values will be the number of 1/100
67 points.
68
69 XmFONT_UNITS
70 All values provided to the widget are treated as
71 font units. A font unit has horizontal and vertical
72 components. These are the values of the XmScreen
73 resources XmNhorizontalFontUnit and XmNvertical‐
74 FontUnit.
75
76 Xm100TH_FONT_UNITS
77 All values provided to the widget are treated as
78 1/100 of a font unit. A font unit has horizontal
79 and vertical components. These are the values of
80 the XmScreen resources XmNhorizontalFontUnit and
81 XmNverticalFontUnit.
82
83 parse_error
84 Specifies if a parsing error occurred. This is set to a value
85 of True indicates that an error occurred, a value of False to
86 indicate no error.
87
89 Returns the converted value. If a NULL screen, incorrect orientation,
90 or incorrect unit_type is supplied as parameter data, or if a parsing
91 error occurred, 0 (zero) is returned.
92
94 XmConvertUnits(3), XmSetFontUnits(3), and XmScreen(3).
95
96
97
98 XmConvertStringToUnits(library call)