aboutsummaryrefslogtreecommitdiff
path: root/libXaw/spec/Form
blob: 9ada171dd73b46e5090f18e4c80886a07c5a971d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
.\" $Xorg: Form,v 1.3 2000/08/17 19:42:26 cpqbld Exp $
.NH 2
Form Widget
.LP
.XS
	Form Widget
.XE
.IN "Form widget" "" "@DEF@"
.Ds 0
.TA 2.0i
.ta 2.0i
.sp
Application Header file	<X11/Xaw/Form.h>
.IN "Form.h" ""
Class Header file	<X11/Xaw/FormP.h>
.IN "FormP.h" ""
Class		formWidgetClass
.IN "formWidgetClass" ""
Class Name	Form
.IN "Form widget" "class name"
Superclass	Constraint
.sp
.De
.LP
The Form widget can contain an arbitrary number of children or
subwidgets.  The Form provides geometry management for its children,
which allows individual control of the position of each child.  Any
combination of children can be added to a Form.  The initial positions
of the children may be computed relative to the positions of previously
created children.  When the Form is resized, it computes new positions and
sizes for its children.  This computation is based upon information
provided when a child is added to the Form.
.LP
The default width of the Form is the minimum width needed to
enclose the children after computing their initial layout, with a
margin of \fBdefaultDistance\fP
at the right and bottom edges.  If a width and height is assigned
to the Form that is too small for the layout, the children will
be clipped by the right and bottom edges of the Form.
.NH 3
Resources
.LP
When creating a Form widget instance, the following resources are
retrieved from the argument list or from the resource database:
.LP
.IN "Form widget" "resources"
.TS H
expand;
lw(1i) lw(1i) lw(1i) lw(.5i) lw(2i).
_
.sp 3p
.TB
Name	Class	Type	Notes	Default Value
.sp 3p
_
.TH
.R
.sp 3p
accelerators	Accelerators	AcceleratorTable		NULL
ancestorSensitive	AncestorSensitive	Boolean	D	True
background	Background	Pixel		XtDefaultBackground
backgroundPixmap	Pixmap	Pixmap		XtUnspecifiedPixmap
borderColor	BorderColor	Pixel		XtDefaultForeground
borderPixmap	Pixmap	Pixmap		XtUnspecifiedPixmap
borderWidth	BorderWidth	Dimension		1
children	ReadOnly	WidgetList	R	NULL
colormap	Colormap	Colormap		Parent's Colormap
defaultDistance	Thickness	int		4
depth	Depth	int	C	Parent's Depth
destroyCallback	Callback	XtCallbackList		NULL
height	Height	Dimension	A	Enough space to contain all children
mappedWhenManaged	MappedWhenManaged	Boolean		True
numChildren	ReadOnly	Cardinal	R	0
screen	Screen	Screen	R	Parent's Screen
sensitive	Sensitive	Boolean		True
translations	Translations	TranslationTable		NULL
width	Width	Dimension	A	Enough space to contain all children
x	Position	Position		0
y	Position	Position		0
.sp 3p
_
.TE
.Ac
.As
.Bg
.Gp
.Bc
.Bp
.Bw
.Ch
.Cm
.Dd Bold
.Dp
.Dc
.Hw
.Mm
.Nc
.Sc
.Se
.Tr
.Xy
.NH 3
Constraint Resources
.LP
.IN "Form widget" "constraint resources"
Each child of the Form widget may request special layout resources
be applied to it.  These \fIconstraint\fP resources allow the Form
widget's children to specify individual layout requirements.
.LP
.LP
.TS H
lw(1i) lw(1i) lw(1i) lw(.5i) lw(2i).
_
.sp 3p
.TB
Name	Class	Type	Notes	Default Value
.sp 3p
_
.TH
.R
.sp 3p
bottom	Edge	XawEdgeType		XawRubber
fromHoriz	Widget	Widget		NULL (left edge of Form)
fromVert	Widget	Widget 		NULL (top edge of Form)
horizDistance	Thickness	int		\fBdefaultDistance\fP resource
left	Edge	XawEdgeType		XawRubber
.IN "XawEdgeType" ""
resizable	Boolean	Boolean		FALSE
right	Edge	XawEdgeType		XawRubber
.IN "XawRubber" ""
top	Edge	XawEdgeType		XawRubber
vertDistance	Thickness	int		\fBdefaultDistance\fP resource
.sp 3p
_
.TE
.Bt Bold
.Fh Bold
.Hd Bold
.Rl Bold
.NH 3
Layout Semantics
.LP
.Lt Form
.LP
.TS H
lw(1.5i) lw(1i) lw(3i).
_
.sp 3p
.TB
Edge Type	Resource Name	Description
.sp 3p
_
.TH
.R
.sp 3p
XawChainBottom	ChainBottom	Edge remains a fixed distance from bottom of Form
.IN "XawChainBottom" ""
XawChainLeft	ChainLeft	Edge remains a fixed distance from left of Form
.IN "XawChainLeft" ""
XawChainRight	ChainRight	Edge remains a fixed distance from right of Form
.IN "XawChainRight" ""
XawChainTop	ChainTop	Edge remains a fixed distance from top of Form
.IN "XawChainTop" ""
XawRubber	Rubber	Edges will move a proportional distance
.IN "XawRubber" ""
.sp 3p
_
.TE
.NH 4
Example
.LP
If you wish to force the Form to never resize one or more of its
children, then set \fBleft\fP and \fBright\fP to \fBXawChainLeft\fP and
\fBtop\fP and \fBbottom\fP to \fBXawChainTop\fP.  This will cause the
child to remain a fixed distance from the top and left edges of the
Form, and never to resize.
.NH 3
Convenience Routines
.LP
To force or defer a re-layout of the Form, use
.PN XawFormDoLayout .
.IN "Form widget" "re-layout"
.IN "XawFormDoLayout" "" "@DEF@"
.FD 0
void XawFormDoLayout(\fIw\fP, \fIdo_layout\fP)
.br
     Widget \fIw\fP;
.br
     Boolean \fIdo_layout\fP;
.FN
.IP \fIw\fP 1i
Specifies the Form widget.
.IP \fIdo_layout\fP 1i
Specifies whether the layout of the Form widget is enabled (\fBTrue\fP)
or disabled (\fBFalse\fP).
.LP
When making several changes to the children of a Form widget
after the Form has been realized, it is a good idea to disable
relayout until after all changes have been made.