1
<section id="prefs-tag-unit" xmlns:xi="http://www.w3.org/2001/XInclude">
2
<title><unit></title>
4
<para>A configuration item for setting geometry values. The user can enter
5
a value and select from the supported measurement units.
12
<imagedata fileref="gfx/prefs-float" format="PNG"/>
18
<section><title>Attributes</title>
20
<informaltable frame="topbot">
27
<entry>Default Value</entry>
28
<entry>Description</entry>
34
<entry valign="top">as_cm()</entry>
35
<entry valign="top">string</entry>
36
<entry valign="top"></entry>
37
<entry valign="top">The value of the unit in centimeters.</entry>
40
<entry valign="top">as_in()</entry>
41
<entry valign="top">string</entry>
42
<entry valign="top"></entry>
43
<entry valign="top">The value of the unit in inches.</entry>
46
<entry valign="top">as_percent()</entry>
47
<entry valign="top">string</entry>
48
<entry valign="top"></entry>
49
<entry valign="top">The value of the unit as a percentage of it's
50
parent container's size.</entry>
53
<entry valign="top">as_pt()</entry>
54
<entry valign="top">string</entry>
55
<entry valign="top"></entry>
56
<entry valign="top">The value of the unit in DTP points (1 pt = 1/72 inch).</entry>
59
<entry valign="top">as_px()</entry>
60
<entry valign="top">string</entry>
61
<entry valign="top"></entry>
62
<entry valign="top">The value of the unit in pixels.</entry>
65
<entry valign="top">bind</entry>
66
<entry valign="top">string</entry>
67
<entry valign="top"></entry>
68
<entry valign="top">The name of the variable or property to which the
69
configuration element is bound.</entry>
72
<entry valign="top">digits</entry>
73
<entry valign="top">integer</entry>
74
<entry valign="top">2</entry>
75
<entry valign="top">The number of decimal digits.</entry>
78
<entry valign="top">callback</entry>
79
<entry valign="top">function</entry>
80
<entry valign="top"></entry>
81
<entry valign="top"> A callback function which is called every time
82
the value changes. The callback takes the name of the bound
83
property and the new value as arguments.</entry>
86
<entry valign="top">enabled</entry>
87
<entry valign="top">boolean</entry>
88
<entry valign="top">true</entry>
89
<entry valign="top">Whether the config item is enabled.
90
Disabled items appear greyed out.</entry>
93
<entry valign="top">help</entry>
94
<entry valign="top">string</entry>
95
<entry valign="top"></entry>
96
<entry valign="top">The tooltip text for the element in the
97
configuration dialog.</entry>
100
<entry valign="top">label</entry>
101
<entry valign="top">string</entry>
102
<entry valign="top"></entry>
103
<entry valign="top">The label text for the element in the
104
configuration dialog.</entry>
107
<entry valign="top">min</entry>
108
<entry valign="top">float</entry>
109
<entry valign="top">0.0</entry>
110
<entry valign="top">The minimal value allowed.</entry>
113
<entry valign="top">max</entry>
114
<entry valign="top">float</entry>
115
<entry valign="top">9999.0</entry>
116
<entry valign="top">The maximal value allowed.</entry>
127
<section><title>Examples</title>
129
<programlisting><![CDATA[
130
<unit label="Width:" bind="Dsp.win.width" min="0.5" max="50.0"
131
help="The width of the display."/>